diff --git a/[refs] b/[refs] index 8f96950fa959..61797a84ef35 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ed07536ed6731775219c1df7fa26a7588753e693 +refs/heads/master: 317a40ac2237732aba531eee2c7b5e39dd40e959 diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 28d49b301d55..61f99c1967d9 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -249,9 +249,11 @@ int permission(struct inode *inode, int mask, struct nameidata *nd) /* * MAY_EXEC on regular files requires special handling: We override - * filesystem execute permissions if the mode bits aren't set. + * filesystem execute permissions if the mode bits aren't set or + * the fs is mounted with the "noexec" flag. */ - if ((mask & MAY_EXEC) && S_ISREG(mode) && !(mode & S_IXUGO)) + if ((mask & MAY_EXEC) && S_ISREG(mode) && (!(mode & S_IXUGO) || + (nd && nd->mnt && (nd->mnt->mnt_flags & MNT_NOEXEC)))) return -EACCES; /* Ordinary permission routines do not understand MAY_APPEND. */