]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: prevent NULL pointer dereference in extent_io_tree_panic
authorSu Yue <l@damenly.su>
Sun, 3 Jan 2021 09:28:03 +0000 (17:28 +0800)
committerDavid Sterba <dsterba@suse.com>
Thu, 7 Jan 2021 16:25:05 +0000 (17:25 +0100)
commitb198cf6527cc5b57cd3ce367ad66635a04a1f31d
tree566b6c8508abfb62382bb43d9f7c2e4a46716324
parenta18f1cbc3502866a2ea259bbecb8af7f1005ab6d
btrfs: prevent NULL pointer dereference in extent_io_tree_panic

Some extent io trees are initialized with NULL private member (e.g.
btrfs_device::alloc_state and btrfs_fs_info::excluded_extents).
Dereference of a NULL tree->private as inode pointer will cause panic.

Pass tree->fs_info as it's known to be valid in all cases.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=208929
Fixes: 846c1536e51b ("btrfs: drop extent_io_ops::tree_fs_info callback")
CC: stable@vger.kernel.org # 4.19+
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Su Yue <l@damenly.su>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c