]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bcachefs: fix null-ptr-deref in have_stripes()
authorJeongjun Park <aha310510@gmail.com>
Wed, 23 Oct 2024 16:13:45 +0000 (01:13 +0900)
committerKent Overstreet <kent.overstreet@linux.dev>
Fri, 25 Oct 2024 17:17:06 +0000 (13:17 -0400)
commita25a83de45b435cf89e55c7fb8733f83c7826004
tree2a7ba3448fc5df63cafef80f3bf87664fb63bb9d
parent5c41f75d1b921b9eaf79588cdd3b22b00fb4ec52
bcachefs: fix null-ptr-deref in have_stripes()

c->btree_roots_known[i].b can be NULL. In this case, a NULL pointer dereference
occurs, so you need to add code to check the variable.

Reported-by: syzbot+b468b9fef56949c3b528@syzkaller.appspotmail.com
Fixes: 7773df19c35f ("bcachefs: metadata version bucket_stripe_sectors")
Signed-off-by: Jeongjun Park <aha310510@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/sb-downgrade.c