X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=fs%2Fopen.c;h=2a731b0d08bc456af047ad58ce68c6823f7b1972;hb=9e210be68a396da0f1d030289c323f1785f29d33;hp=7931f76acc2beede0298747df1d505b30cd225b4;hpb=0bc2ba94a65d2cd2ad01004d2d3f94f31c6064bd;p=karo-tx-linux.git diff --git a/fs/open.c b/fs/open.c index 7931f76acc2b..2a731b0d08bc 100644 --- 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; }