Merge "arm: mm: restrict EXEC to text and init"
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index f898706..d9375c1 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -1672,7 +1672,13 @@
pte = start_pte;
do {
- set_pte_ext(pte, pfn_pte(pfn, type->prot_pte), 0);
+ if (((unsigned long)_stext <= addr) &&
+ (addr < (unsigned long)__init_end))
+ set_pte_ext(pte, pfn_pte(pfn,
+ mem_types[MT_MEMORY_RWX].prot_pte), 0);
+ else
+ set_pte_ext(pte, pfn_pte(pfn,
+ mem_types[MT_MEMORY_RW].prot_pte), 0);
pfn++;
} while (pte++, addr += PAGE_SIZE, addr != end);