Skip to content

Commit

Permalink
VFS: Remove redundant open-coded mode bit check in prepare_binfmt().
Browse files Browse the repository at this point in the history
The check in prepare_binfmt() for inode->i_mode & 0111 is redundant,
since open_exec() will already have done that.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 822dec482ced07af32c378cd936d77345786572b commit)
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Aug 24, 2006
1 parent a343bb7 commit 9167b0b
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,12 +922,6 @@ int prepare_binprm(struct linux_binprm *bprm)
int retval;

mode = inode->i_mode;
/*
* Check execute perms again - if the caller has CAP_DAC_OVERRIDE,
* generic_permission lets a non-executable through
*/
if (!(mode & 0111)) /* with at least _one_ execute bit set */
return -EACCES;
if (bprm->file->f_op == NULL)
return -EACCES;

Expand Down

0 comments on commit 9167b0b

Please sign in to comment.