aboutsummaryrefslogtreecommitdiffstats
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
authorFilipe Manana <[email protected]>2025-02-15 11:36:15 +0000
committerDavid Sterba <[email protected]>2025-02-21 08:31:48 +0000
commit59f37036bb7ab3d554c24abc856aabca01126414 (patch)
tree5524649f231619054440a3e27d9c5f555c03e06c /net/switchdev/switchdev.c
parentbtrfs: selftests: fix btrfs_test_delayed_refs() leak of transaction (diff)
downloadkernel-59f37036bb7ab3d554c24abc856aabca01126414.tar.gz
kernel-59f37036bb7ab3d554c24abc856aabca01126414.zip
btrfs: fix use-after-free on inode when scanning root during em shrinking
At btrfs_scan_root() we are accessing the inode's root (and fs_info) in a call to btrfs_fs_closing() after we have scheduled the inode for a delayed iput, and that can result in a use-after-free on the inode in case the cleaner kthread does the iput before we dereference the inode in the call to btrfs_fs_closing(). Fix this by using the fs_info stored already in a local variable instead of doing inode->root->fs_info. Fixes: 102044384056 ("btrfs: make the extent map shrinker run asynchronously as a work queue job") CC: [email protected] # 6.13+ Tested-by: Ivan Shapovalov <[email protected]> Link: https://lore.kernel.org/linux-btrfs/[email protected]/ Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions