diff options
author | Christoph Hellwig <hch@lst.de> | 2007-05-23 16:57:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-23 23:14:13 -0400 |
commit | 492c8b332e3af279ffadf49b85967d5e43810923 (patch) | |
tree | 401977e562937b80385cbace842aae01a8dd2ad2 /fs/exec.c | |
parent | 5a1b63914815e4223ceb3d079286e18f9ee92b4b (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>
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; |