From: Kusanagi Kouichi Date: Mon, 28 Jan 2013 11:33:31 +0000 (+0000) Subject: Btrfs: Check CAP_DAC_READ_SEARCH for BTRFS_IOC_INO_PATHS X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=82b22ac8f651aebbf0149cbbbd5808f07753b09c;p=~shefty%2Frdma-dev.git Btrfs: Check CAP_DAC_READ_SEARCH for BTRFS_IOC_INO_PATHS CAP_DAC_READ_SEARCH overrides read and search permission check on file and directory. It seems fit for BTRFS_IOC_INO_PATHS. Signed-off-by: Kusanagi Kouichi Signed-off-by: Josef Bacik --- diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 744aabf11ce..1b554b47e81 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3290,7 +3290,7 @@ static long btrfs_ioctl_ino_to_path(struct btrfs_root *root, void __user *arg) struct inode_fs_paths *ipath = NULL; struct btrfs_path *path; - if (!capable(CAP_SYS_ADMIN)) + if (!capable(CAP_DAC_READ_SEARCH)) return -EPERM; path = btrfs_alloc_path();