diff options
author | Christoph Hellwig <hch@lst.de> | 2007-05-23 22:57:53 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-24 05:14:13 +0200 |
commit | 492c8b332e3af279ffadf49b85967d5e43810923 (patch) | |
tree | 401977e562937b80385cbace842aae01a8dd2ad2 /fs/exec.c | |
parent | Missing 'const' from reiserfs MIN_KEY declaration. (diff) | |
download | linux-492c8b332e3af279ffadf49b85967d5e43810923.tar.xz linux-492c8b332e3af279ffadf49b85967d5e43810923.zip |
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>
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 3 |
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) if (error) goto out; + error = -EACCES; + if (nd.mnt->mnt_flags & MNT_NOEXEC) + goto exit; error = -EINVAL; if (!S_ISREG(nd.dentry->d_inode->i_mode)) goto exit; |