VFS: Remove redundant open-coded mode bit check in prepare_binfmt().
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 23 Aug 2006 00:06:03 +0000 (20:06 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 24 Aug 2006 19:55:06 +0000 (15:55 -0400)
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)

fs/exec.c

index 8344ba73a2a670d37d2b08a2587e149490f87eaa..a6f64a98ac508a5d29da37f30988e83ef7b1ec9c 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -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;