]> git.ipfire.org Git - thirdparty/linux.git/commit
btrfs: fix use-after-free waiting for encoded read endios
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Wed, 13 Nov 2024 17:16:49 +0000 (18:16 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Dec 2024 20:55:06 +0000 (21:55 +0100)
commitd29662695ed7c015521e5fc9387df25aab192a2e
tree6811491f4cb6a9e49f7ed108f5dcff21525013bd
parentf10bef73fb355e3fc85e63a50386798be68ff486
btrfs: fix use-after-free waiting for encoded read endios

Fix a use-after-free in the I/O completion path for encoded reads by
using a completion instead of a wait_queue for synchronizing the
destruction of 'struct btrfs_encoded_read_private'.

Fixes: 1881fba89bd5 ("btrfs: add BTRFS_IOC_ENCODED_READ ioctl")
CC: stable@vger.kernel.org # 6.1+
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c