]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: ensure that file descriptor used with subvol ioctls is a dir
authorJeff Mahoney <jeffm@suse.com>
Wed, 21 Sep 2016 12:31:29 +0000 (08:31 -0400)
committerChris Mason <clm@fb.com>
Thu, 22 Sep 2016 00:22:16 +0000 (17:22 -0700)
commit26b0aec0d71c1dc298980fac23cbf1e25d7e2081
treeaf8ac48b434b15fa4efa6dead7ea2c037d03fc99
parent1bfc58727cd6c81e010f72efc89e5d69ae63aa28
btrfs: ensure that file descriptor used with subvol ioctls is a dir

If the subvol/snapshot create/destroy ioctls are passed a regular file
with execute permissions set, we'll eventually Oops while trying to do
inode->i_op->lookup via lookup_one_len.

This patch ensures that the file descriptor refers to a directory.

Fixes: 813e42371c (Btrfs: Fix subvolume creation locking rules)
Fixes: 319a8d4f1f (Btrfs: add snapshot/subvolume destroy ioctl)
Cc: <stable@vger.kernel.org> #v2.6.29+
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/ioctl.c