]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
btrfs: Verify that every chunk has corresponding block group at mount time
authorQu Wenruo <wqu@suse.com>
Wed, 1 Aug 2018 02:37:17 +0000 (10:37 +0800)
committerSultan Alsawaf <sultan.alsawaf@canonical.com>
Wed, 24 Jul 2019 15:44:56 +0000 (09:44 -0600)
commitf066b85de92d540c8c94e580b441203eaf12629b
treec631591d5f682237d1d87f67d9ee347911119180
parent75d0186fcd7a0b57b68e4d3bc1c21371743c31ad
btrfs: Verify that every chunk has corresponding block group at mount time

BugLink: https://bugs.launchpad.net/bugs/1836968
commit 7ef49515fa6727cb4b6f2f5b0ffbc5fc20a9f8c6 upstream.

If a crafted image has missing block group items, it could cause
unexpected behavior and breaks the assumption of 1:1 chunk<->block group
mapping.

Although we have the block group -> chunk mapping check, we still need
chunk -> block group mapping check.

This patch will do extra check to ensure each chunk has its
corresponding block group.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=199847
Reported-by: Xu Wen <wen.xu@gatech.edu>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Gu Jinxiang <gujx@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/btrfs/extent-tree.c