summaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorNaohiro Aota2018-07-27 02:04:55 +0200
committerDavid Sterba2018-08-06 13:13:04 +0200
commit39379faaad79e3cf403a6904a08676b7850043ae (patch)
tree6b7f07df694ff8e502a024f71a2dd0020f23e5c3 /include/trace
parentbtrfs: Exit gracefully when chunk map cannot be inserted to the tree (diff)
downloadkernel-qcow2-linux-39379faaad79e3cf403a6904a08676b7850043ae.tar.gz
kernel-qcow2-linux-39379faaad79e3cf403a6904a08676b7850043ae.tar.xz
kernel-qcow2-linux-39379faaad79e3cf403a6904a08676b7850043ae.zip
btrfs: revert fs_devices state on error of btrfs_init_new_device
When btrfs hits error after modifying fs_devices in btrfs_init_new_device() (such as btrfs_add_dev_item() returns error), it leaves everything as is, but frees allocated btrfs_device. As a result, fs_devices->devices and fs_devices->alloc_list contain already freed btrfs_device, leading to later use-after-free bug. Error path also messes the things like ->num_devices. While they go back to the original value by unscanning btrfs devices, it is safe to revert them here. Fixes: 79787eaab461 ("btrfs: replace many BUG_ONs with proper error handling") Signed-off-by: Naohiro Aota <naota@elisp.net> Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'include/trace')
0 files changed, 0 insertions, 0 deletions