2014/1/15 David Sterba <dsterba@xxxxxxx>: > The owner and capability checks in IOC_SUBVOL_SETFLAGS and > SET_RECEIVED_SUBVOL should be called before any other checks are done. > > Also unify the error code to EPERM. > > Signed-off-by: David Sterba <dsterba@xxxxxxx> > --- > fs/btrfs/ioctl.c | 22 +++++++++------------- > 1 file changed, 9 insertions(+), 13 deletions(-) > > diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c > index 21da5762b0b1..f21facd84947 100644 > --- a/fs/btrfs/ioctl.c > +++ b/fs/btrfs/ioctl.c > @@ -190,6 +190,9 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) > unsigned int i_oldflags; > umode_t mode; > > + if (!inode_owner_or_capable(inode)) > + return -PERM; You forgot an "E". -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
