aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-23 16:24:16 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-27 13:22:14 -0500
commit45e09bd51b2be1fbb86c2e3d5bb00d32744f1ecb (patch)
tree4cf68d20342e7b0253ea07ae2b265b15b994f684 /security
parentd895cb1af15c04c522a25c79cc429076987c089b (diff)
selinux: opened file can't have NULL or negative ->f_path.dentry
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security')
-rw-r--r--security/selinux/hooks.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 84b591711eec..2fa28c88900c 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3135,11 +3135,6 @@ static int selinux_file_fcntl(struct file *file, unsigned int cmd,
3135 3135
3136 switch (cmd) { 3136 switch (cmd) {
3137 case F_SETFL: 3137 case F_SETFL:
3138 if (!file->f_path.dentry || !file->f_path.dentry->d_inode) {
3139 err = -EINVAL;
3140 break;
3141 }
3142
3143 if ((file->f_flags & O_APPEND) && !(arg & O_APPEND)) { 3138 if ((file->f_flags & O_APPEND) && !(arg & O_APPEND)) {
3144 err = file_has_perm(cred, file, FILE__WRITE); 3139 err = file_has_perm(cred, file, FILE__WRITE);
3145 break; 3140 break;
@@ -3162,10 +3157,6 @@ static int selinux_file_fcntl(struct file *file, unsigned int cmd,
3162 case F_SETLK64: 3157 case F_SETLK64:
3163 case F_SETLKW64: 3158 case F_SETLKW64:
3164#endif 3159#endif
3165 if (!file->f_path.dentry || !file->f_path.dentry->d_inode) {
3166 err = -EINVAL;
3167 break;
3168 }
3169 err = file_has_perm(cred, file, FILE__LOCK); 3160 err = file_has_perm(cred, file, FILE__LOCK);
3170 break; 3161 break;
3171 } 3162 }