aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-05-23 16:57:53 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-23 23:14:13 -0400
commit492c8b332e3af279ffadf49b85967d5e43810923 (patch)
tree401977e562937b80385cbace842aae01a8dd2ad2
parent5a1b63914815e4223ceb3d079286e18f9ee92b4b (diff)
uselib: add missing MNT_NOEXEC check
We don't allow loading ELF shared library from noexec points so the same should apply to sys_uselib aswell. Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Ulrich Drepper <drepper@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/exec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 0b685888ff6f..f20561ff4528 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -134,6 +134,9 @@ asmlinkage long sys_uselib(const char __user * library)
134 if (error) 134 if (error)
135 goto out; 135 goto out;
136 136
137 error = -EACCES;
138 if (nd.mnt->mnt_flags & MNT_NOEXEC)
139 goto exit;
137 error = -EINVAL; 140 error = -EINVAL;
138 if (!S_ISREG(nd.dentry->d_inode->i_mode)) 141 if (!S_ISREG(nd.dentry->d_inode->i_mode))
139 goto exit; 142 goto exit;