Re: [RESEND PATCH] btrfs: Fix UAF when cleaning up fs_devs with a single stale device

2018-02-02 Thread David Sterba
On Tue, Jan 30, 2018 at 04:07:37PM +0200, Nikolay Borisov wrote: > Commit 4fde46f0cc71 ("Btrfs: free the stale device") introduced > btrfs_free_stale_device which iterates the device lists for all > registered btrfs filesystems and deletes those devices which aren't > mounted. In a btrfs_devices

[RESEND PATCH] btrfs: Fix UAF when cleaning up fs_devs with a single stale device

2018-01-30 Thread Nikolay Borisov
Commit 4fde46f0cc71 ("Btrfs: free the stale device") introduced btrfs_free_stale_device which iterates the device lists for all registered btrfs filesystems and deletes those devices which aren't mounted. In a btrfs_devices structure has only 1 device attached to it and it is unused then