#include <linux/highmem.h>
#include <linux/security.h>
#include <linux/mempolicy.h>
+#include <linux/personality.h>
#include <asm/uaccess.h>
-#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
* vm_flags and vm_page_prot are protected by the mmap_sem
* held in write mode.
*/
+ vm_stat_unaccount(vma);
vma->vm_flags = newflags;
vma->vm_page_prot = newprot;
change_protection(vma, start, end, newprot);
+ vm_stat_account(vma);
return 0;
fail:
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);