OSDN Git Service

btrfs: promote debugging asserts to full-fledged checks in validate_super
authorNikolay Borisov <nborisov@suse.com>
Mon, 31 May 2021 09:26:01 +0000 (12:26 +0300)
committerDavid Sterba <dsterba@suse.com>
Fri, 4 Jun 2021 11:12:06 +0000 (13:12 +0200)
commitaefd7f7065567a4666f42c0fc8cdb379d2e036bf
tree928eb370d723e46a571f7c7e5cba750a9be4e87f
parente7b2ec3d3d4ebeb4cff7ae45cf430182fa6a49fb
btrfs: promote debugging asserts to full-fledged checks in validate_super

Syzbot managed to trigger this assert while performing its fuzzing.
Turns out it's better to have those asserts turned into full-fledged
checks so that in case buggy btrfs images are mounted the users gets
an error and mounting is stopped. Alternatively with CONFIG_BTRFS_ASSERT
disabled such image would have been erroneously allowed to be mounted.

Reported-by: syzbot+a6bf271c02e4fe66b4e4@syzkaller.appspotmail.com
CC: stable@vger.kernel.org # 5.4+
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ add uuids to the messages ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c