Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm...
[platform/adaptation/renesas_rcar/renesas_kernel.git] / fs / open.c
index 7931f76..2a731b0 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -443,7 +443,7 @@ retry:
                goto dput_and_out;
 
        error = -EPERM;
-       if (!nsown_capable(CAP_SYS_CHROOT))
+       if (!ns_capable(current_user_ns(), CAP_SYS_CHROOT))
                goto dput_and_out;
        error = security_path_chroot(&path);
        if (error)
@@ -485,14 +485,13 @@ out_unlock:
 
 SYSCALL_DEFINE2(fchmod, unsigned int, fd, umode_t, mode)
 {
-       struct file * file;
+       struct fd f = fdget(fd);
        int err = -EBADF;
 
-       file = fget(fd);
-       if (file) {
-               audit_inode(NULL, file->f_path.dentry, 0);
-               err = chmod_common(&file->f_path, mode);
-               fput(file);
+       if (f.file) {
+               audit_inode(NULL, f.file->f_path.dentry, 0);
+               err = chmod_common(&f.file->f_path, mode);
+               fdput(f);
        }
        return err;
 }