Re: [PATCH] uselib: add missing MNT_NOEXEC check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 17, 2007 at 09:14:06AM -0700, Ulrich Drepper wrote:
> >        error = -EINVAL;
> >+       if (nd.mnt->mnt_flags & MNT_NOEXEC)
> >+               goto exit;
> 
> ... the error here should be EACCES.  Aside from that you get an ACK from 
> me.

updated patch below:

Index: linux-2.6/fs/exec.c
===================================================================
--- linux-2.6.orig/fs/exec.c	2007-05-17 14:43:25.000000000 +0200
+++ linux-2.6/fs/exec.c	2007-05-17 19:42:49.000000000 +0200
@@ -134,6 +134,9 @@ asmlinkage long sys_uselib(const char __
 	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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux