bcachefs: Fix alloc_req use after free
authorAlan Huang <mmpgouride@gmail.com>
Fri, 13 Jun 2025 14:54:59 +0000 (22:54 +0800)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 16 Jun 2025 02:11:55 +0000 (22:11 -0400)
commit9b54efe66c9b44e7446e8a81a058c014cd43661d
tree9758575a268a49bd7637a62b874353586530211f
parent9b9a3270092bf8030dbe21ce90b2d0c8d98d33c7
bcachefs: Fix alloc_req use after free

Now the alloc_req is allocated from the bump allocator, if there is
reallocation, the memory of alloc_req would be frees, fix by delaying the
reallocation to transaction restart, it has to restart anyway.

Reported-by: syzbot+2887a13a5c387e616a68@syzkaller.appspotmail.com
Signed-off-by: Alan Huang <mmpgouride@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_types.h