bcachefs: Fix UAFs of btree_insert_entry array
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 11 Apr 2024 21:47:42 +0000 (17:47 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 14 Apr 2024 02:48:16 +0000 (22:48 -0400)
commit58caa786f1c02fd84919fb6db9eaecb22e8f7983
treee100a81e7b7afa4d14003c4f742a378c3b8a21c5
parent2b3e79fea66e166622a454715ce981432ac8c6e3
bcachefs: Fix UAFs of btree_insert_entry array

The btree paths array is now dynamically resizable - and as well the
btree_insert_entries array, as it needs to be the same size.

The merge path (and interior update path) allocates new btree paths,
thus can trigger a resize; thus we need to not retain direct pointers
after invoking merge; similarly when running btree node triggers.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_trans_commit.c