Btrfs: fix a use-after-free bug in btrfs_dev_replace_finishing
authorIlya Dryomov <idryomov@gmail.com>
Wed, 2 Oct 2013 17:41:01 +0000 (20:41 +0300)
committerJosef Bacik <jbacik@fusionio.com>
Fri, 4 Oct 2013 20:02:14 +0000 (16:02 -0400)
free_device rcu callback, scheduled from btrfs_rm_dev_replace_srcdev,
can be processed before btrfs_scratch_superblock is called, which would
result in a use-after-free on btrfs_device contents.  Fix this by
zeroing the superblock before the rcu callback is registered.

Cc: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>

No differences found