Commit 346e7bb4 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86_64: Handle NX correctly in pageattr

Handle NX correctly in pageattr

Second attempt to try to fix an long standing NX bug in change_page_attr.
Hopefully this version will be better.

The kernel text mapping aliases part of the physical memory and needs its
caching attributes changed too.  But when doing this one has to be very
careful to handle the NX bit correctly.

A previous slightly different version of this broke the X server on some RH
systems.  I hope this version will be better, but if you have X server
problems please revert this one.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e759cc08
......@@ -183,11 +183,12 @@ int change_page_attr_addr(unsigned long address, int numpages, pgprot_t prot)
break;
/* Handle kernel mapping too which aliases part of the
* lowmem */
/* Disabled right now. Fixme */
if (0 && __pa(address) < KERNEL_TEXT_SIZE) {
if (__pa(address) < KERNEL_TEXT_SIZE) {
unsigned long addr2;
pgprot_t prot2 = prot;
addr2 = __START_KERNEL_map + __pa(address);
err = __change_page_attr(addr2, pfn, prot, PAGE_KERNEL_EXEC);
pgprot_val(prot2) &= ~_PAGE_NX;
err = __change_page_attr(addr2, pfn, prot2, PAGE_KERNEL_EXEC);
}
}
up_write(&init_mm.mmap_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment