From: Christoph Hellwig Date: Wed, 23 May 2007 20:57:53 +0000 (-0700) Subject: uselib: add missing MNT_NOEXEC check X-Git-Tag: v2.6.22-rc3~53 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=492c8b332e3af279ffadf49b85967d5e43810923;p=linux-2.6 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 Cc: Ulrich Drepper Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/exec.c b/fs/exec.c index 0b685888ff..f20561ff45 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;