git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git]
/
mm
/
mprotect.c
diff --git
a/mm/mprotect.c
b/mm/mprotect.c
index
5b438e1
..
88041d4
100644
(file)
--- a/
mm/mprotect.c
+++ b/
mm/mprotect.c
@@
-17,9
+17,9
@@
#include <linux/highmem.h>
#include <linux/security.h>
#include <linux/mempolicy.h>
#include <linux/highmem.h>
#include <linux/security.h>
#include <linux/mempolicy.h>
+#include <linux/personality.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
-#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
#include <asm/pgtable.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
@@
-206,6
+206,12
@@
sys_mprotect(unsigned long start, size_t len, unsigned long prot)
return -EINVAL;
if (end == start)
return 0;
return -EINVAL;
if (end == start)
return 0;
+ /*
+ * Does the application expect PROT_READ to imply PROT_EXEC:
+ */
+ if (unlikely((prot & PROT_READ) &&
+ (current->personality & READ_IMPLIES_EXEC)))
+ prot |= PROT_EXEC;
vm_flags = calc_vm_prot_bits(prot);
vm_flags = calc_vm_prot_bits(prot);