aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/mm/pageattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/mm/pageattr.c')
-rw-r--r--arch/x86_64/mm/pageattr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86_64/mm/pageattr.c b/arch/x86_64/mm/pageattr.c
index 2685b1f3671c..01591b649f4e 100644
--- a/arch/x86_64/mm/pageattr.c
+++ b/arch/x86_64/mm/pageattr.c
@@ -190,10 +190,12 @@ int change_page_attr_addr(unsigned long address, int numpages, pgprot_t prot)
190 * lowmem */ 190 * lowmem */
191 if (__pa(address) < KERNEL_TEXT_SIZE) { 191 if (__pa(address) < KERNEL_TEXT_SIZE) {
192 unsigned long addr2; 192 unsigned long addr2;
193 pgprot_t prot2 = prot; 193 pgprot_t prot2;
194 addr2 = __START_KERNEL_map + __pa(address); 194 addr2 = __START_KERNEL_map + __pa(address);
195 pgprot_val(prot2) &= ~_PAGE_NX; 195 /* Make sure the kernel mappings stay executable */
196 err = __change_page_attr(addr2, pfn, prot2, PAGE_KERNEL_EXEC); 196 prot2 = pte_pgprot(pte_mkexec(pfn_pte(0, prot)));
197 err = __change_page_attr(addr2, pfn, prot2,
198 PAGE_KERNEL_EXEC);
197 } 199 }
198 } 200 }
199 up_write(&init_mm.mmap_sem); 201 up_write(&init_mm.mmap_sem);