]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
selinux: opened file can't have NULL or negative ->f_path.dentry
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 23 Jan 2013 21:24:16 +0000 (16:24 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 27 Feb 2013 18:22:14 +0000 (13:22 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
security/selinux/hooks.c

index 84b591711eec4515164575809ecfbb99d155d367..2fa28c88900c1cb4ad7a1cc57e7b28421f4c1587 100644 (file)
@@ -3135,11 +3135,6 @@ static int selinux_file_fcntl(struct file *file, unsigned int cmd,
 
        switch (cmd) {
        case F_SETFL:
-               if (!file->f_path.dentry || !file->f_path.dentry->d_inode) {
-                       err = -EINVAL;
-                       break;
-               }
-
                if ((file->f_flags & O_APPEND) && !(arg & O_APPEND)) {
                        err = file_has_perm(cred, file, FILE__WRITE);
                        break;
@@ -3162,10 +3157,6 @@ static int selinux_file_fcntl(struct file *file, unsigned int cmd,
        case F_SETLK64:
        case F_SETLKW64:
 #endif
-               if (!file->f_path.dentry || !file->f_path.dentry->d_inode) {
-                       err = -EINVAL;
-                       break;
-               }
                err = file_has_perm(cred, file, FILE__LOCK);
                break;
        }