]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bcachefs: Fix invalid shift in validate_sb_layout()
authorGianfranco Trad <gianf.trad@gmail.com>
Wed, 23 Oct 2024 21:30:44 +0000 (23:30 +0200)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 24 Oct 2024 21:41:43 +0000 (17:41 -0400)
commit2045fc4295c427d420aa1ff551b4de8179b6e5d5
treeecd78fa27c1db3b22f2827dfdf99cc0fc8f967e4
parenta069f014797fdef8757f3adebc1c16416271a599
bcachefs: Fix invalid shift in validate_sb_layout()

Add check on layout->sb_max_size_bits against BCH_SB_LAYOUT_SIZE_BITS_MAX
to prevent UBSAN shift-out-of-bounds in validate_sb_layout().

Reported-by: syzbot+089fad5a3a5e77825426@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=089fad5a3a5e77825426
Fixes: 03ef80b469d5 ("bcachefs: Ignore unknown mount options")
Tested-by: syzbot+089fad5a3a5e77825426@syzkaller.appspotmail.com
Signed-off-by: Gianfranco Trad <gianf.trad@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/errcode.h
fs/bcachefs/super-io.c