lkml.org 
[lkml]   [2006]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] close mprotect noexec hole
The following patch closes the hole in mprotect discovered during
the noexec mount discussions. Without this the protection is
incomplete and pretty much useless. With it and additional techniques
like SELinux all holes can be plugged in a fine-grained way.

I think it should be in .19 since it's a security problem not to have
it. Tested on x86-64.


Signed-off-by: Ulrich Drepper <drepper@redhat.com>

--- mm/mprotect.c 2006-10-01 09:35:14.000000000 -0700
+++ mm/mprotect.c-new 2006-10-11 14:54:55.000000000 -0700
@@ -251,6 +251,10 @@
error = -ENOMEM;
if (!vma)
goto out;
+ error = -EACCES;
+ if ((reqprot & PROT_EXEC) && vma->vm_file &&
+ (vma->vm_file->f_vfsmnt->mnt_flags & MNT_NOEXEC))
+ goto out;
if (unlikely(grows & PROT_GROWSDOWN)) {
if (vma->vm_start >= end)
goto out;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-10-15 20:37    [W:0.035 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site