Skip to content

Commit

Permalink
selinux: opened file can't have NULL or negative ->f_path.dentry
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Feb 27, 2013
1 parent d895cb1 commit 45e09bd
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit 45e09bd

Please sign in to comment.