summaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-07-22 06:02:33 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2008-07-27 02:53:30 +0200
commit30524472c2f728c20d6bf35191042a5d455c0a64 (patch)
treee9985d3883b45c4a9f5ef8185fa79c7b568bb4bd /fs/exec.c
parentRe: [PATCH 3/6] vfs: open_exec cleanup (diff)
downloadlinux-30524472c2f728c20d6bf35191042a5d455c0a64.tar.xz
linux-30524472c2f728c20d6bf35191042a5d455c0a64.zip
[PATCH] take noexec checks to very few callers that care
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 346e3f69c6e0..eca58c29eded 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -118,6 +118,10 @@ asmlinkage long sys_uselib(const char __user * library)
if (!S_ISREG(nd.path.dentry->d_inode->i_mode))
goto exit;
+ error = -EACCES;
+ if (nd.path.mnt->mnt_flags & MNT_NOEXEC)
+ goto exit;
+
error = vfs_permission(&nd, MAY_READ | MAY_EXEC | MAY_OPEN);
if (error)
goto exit;
@@ -668,6 +672,9 @@ struct file *open_exec(const char *name)
if (!S_ISREG(nd.path.dentry->d_inode->i_mode))
goto out_path_put;
+ if (nd.path.mnt->mnt_flags & MNT_NOEXEC)
+ goto out_path_put;
+
err = vfs_permission(&nd, MAY_EXEC | MAY_OPEN);
if (err)
goto out_path_put;