summaryrefslogtreecommitdiffstats
path: root/security/selinux
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-23 22:24:16 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-27 19:22:14 +0100
commit45e09bd51b2be1fbb86c2e3d5bb00d32744f1ecb (patch)
tree4cf68d20342e7b0253ea07ae2b265b15b994f684 /security/selinux
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vir... (diff)
downloadlinux-45e09bd51b2be1fbb86c2e3d5bb00d32744f1ecb.tar.xz
linux-45e09bd51b2be1fbb86c2e3d5bb00d32744f1ecb.zip
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/selinux')
-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,
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;
}