aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
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)
118 if (!S_ISREG(nd.path.dentry->d_inode->i_mode)) 118 if (!S_ISREG(nd.path.dentry->d_inode->i_mode))
119 goto exit; 119 goto exit;
120 120
121 error = -EACCES;
122 if (nd.path.mnt->mnt_flags & MNT_NOEXEC)
123 goto exit;
124
121 error = vfs_permission(&nd, MAY_READ | MAY_EXEC | MAY_OPEN); 125 error = vfs_permission(&nd, MAY_READ | MAY_EXEC | MAY_OPEN);
122 if (error) 126 if (error)
123 goto exit; 127 goto exit;
@@ -668,6 +672,9 @@ struct file *open_exec(const char *name)
668 if (!S_ISREG(nd.path.dentry->d_inode->i_mode)) 672 if (!S_ISREG(nd.path.dentry->d_inode->i_mode))
669 goto out_path_put; 673 goto out_path_put;
670 674
675 if (nd.path.mnt->mnt_flags & MNT_NOEXEC)
676 goto out_path_put;
677
671 err = vfs_permission(&nd, MAY_EXEC | MAY_OPEN); 678 err = vfs_permission(&nd, MAY_EXEC | MAY_OPEN);
672 if (err) 679 if (err)
673 goto out_path_put; 680 goto out_path_put;