diff options
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c index 28d49b301d55..db1bca26d88c 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -249,9 +249,11 @@ int permission(struct inode *inode, int mask, struct nameidata *nd) | |||
249 | 249 | ||
250 | /* | 250 | /* |
251 | * MAY_EXEC on regular files requires special handling: We override | 251 | * MAY_EXEC on regular files requires special handling: We override |
252 | * filesystem execute permissions if the mode bits aren't set. | 252 | * filesystem execute permissions if the mode bits aren't set or |
253 | * the fs is mounted with the "noexec" flag. | ||
253 | */ | 254 | */ |
254 | if ((mask & MAY_EXEC) && S_ISREG(mode) && !(mode & S_IXUGO)) | 255 | if ((mask & MAY_EXEC) && S_ISREG(mode) && (!(mode & S_IXUGO) || |
256 | (nd && nd->mnt && (nd->mnt->mnt_flags & MNT_NOEXEC)))) | ||
255 | return -EACCES; | 257 | return -EACCES; |
256 | 258 | ||
257 | /* Ordinary permission routines do not understand MAY_APPEND. */ | 259 | /* Ordinary permission routines do not understand MAY_APPEND. */ |
@@ -1996,8 +1998,7 @@ asmlinkage long sys_mkdir(const char __user *pathname, int mode) | |||
1996 | void dentry_unhash(struct dentry *dentry) | 1998 | void dentry_unhash(struct dentry *dentry) |
1997 | { | 1999 | { |
1998 | dget(dentry); | 2000 | dget(dentry); |
1999 | if (atomic_read(&dentry->d_count)) | 2001 | shrink_dcache_parent(dentry); |
2000 | shrink_dcache_parent(dentry); | ||
2001 | spin_lock(&dcache_lock); | 2002 | spin_lock(&dcache_lock); |
2002 | spin_lock(&dentry->d_lock); | 2003 | spin_lock(&dentry->d_lock); |
2003 | if (atomic_read(&dentry->d_count) == 2) | 2004 | if (atomic_read(&dentry->d_count) == 2) |