Skip to content

Commit 45e09bd

Browse files
author
Al Viro
committed
selinux: opened file can't have NULL or negative ->f_path.dentry
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent d895cb1 commit 45e09bd

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

‎security/selinux/hooks.c‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3135,11 +3135,6 @@ static int selinux_file_fcntl(struct file *file, unsigned int cmd,
31353135

31363136
switch (cmd) {
31373137
case F_SETFL:
3138-
if (!file->f_path.dentry || !file->f_path.dentry->d_inode) {
3139-
err = -EINVAL;
3140-
break;
3141-
}
3142-
31433138
if ((file->f_flags & O_APPEND) && !(arg & O_APPEND)) {
31443139
err = file_has_perm(cred, file, FILE__WRITE);
31453140
break;
@@ -3162,10 +3157,6 @@ static int selinux_file_fcntl(struct file *file, unsigned int cmd,
31623157
case F_SETLK64:
31633158
case F_SETLKW64:
31643159
#endif
3165-
if (!file->f_path.dentry || !file->f_path.dentry->d_inode) {
3166-
err = -EINVAL;
3167-
break;
3168-
}
31693160
err = file_has_perm(cred, file, FILE__LOCK);
31703161
break;
31713162
}

0 commit comments

Comments
 (0)