]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.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)
committerIshan Mittal <imittal@nvidia.com>
Fri, 6 Jan 2017 10:13:42 +0000 (15:43 +0530)
commit00ccaaf62e2b74c76dbd9b80b0c76662473c026a
treec445924163e8f188c2580d0c5cae2bceb72a2df0
parent2b1bb3f16e05971730b883f2b8b7fd1e60dc29cc
btrfs: ensure that file descriptor used with subvol ioctls is a dir

commit 325c50e3cebb9208009083e841550f98a863bfa0 upstream.

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: cb8e70901d (Btrfs: Fix subvolume creation locking rules)
Fixes: 76dda93c6a (Btrfs: add snapshot/subvolume destroy ioctl)
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/ioctl.c