diff options
| author | Mark Harmstone <mark@harmstone.com> | 2026-02-19 17:03:53 +0000 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-03-17 11:43:08 +0100 |
| commit | 057495ccc0ad381015b45d3edf995c2b6b982474 (patch) | |
| tree | af9348355aa9bc944b2ccd82ee1b379d92275f39 /scripts/dummy-tools/python3 | |
| parent | 5118130e722b1261a2e92b2fb0b067463c39ecc7 (diff) | |
btrfs: hold block group reference during entire move_existing_remap()
There is a potential use-after-free in move_existing_remap(): we're calling
btrfs_put_block_group() on dest_bg, then passing it to
btrfs_add_block_group_free_space() a few lines later.
Fix this by getting the BG at the start of the function and putting it
near the end. This also means we're not doing a lookup twice for the
same thing.
Reported-by: Chris Mason <clm@fb.com>
Link: https://lore.kernel.org/linux-btrfs/20260125123908.2096548-1-clm@meta.com/
Fixes: bbea42dfb91f ("btrfs: move existing remaps before relocating block group")
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Mark Harmstone <mark@harmstone.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'scripts/dummy-tools/python3')
0 files changed, 0 insertions, 0 deletions
