X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=mm%2Fmprotect.c;h=88041d46ad0b6b428658057f53d5f0e92fcaa612;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=5b438e1a01262d2be79813b041b7aa13bf0888cb;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/mm/mprotect.c b/mm/mprotect.c index 5b438e1a0..88041d46a 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -17,9 +17,9 @@ #include #include #include +#include #include -#include #include #include #include @@ -206,6 +206,12 @@ sys_mprotect(unsigned long start, size_t len, unsigned long prot) 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);