Someone setting NX on the kernel text tends to result in nasty failures and triple faults, so BUG_ON early for that. Does not cover __inittext. Signed-off-by: Andi Kleen <ak@suse.de> Acked-by: Jan Beulich <jbeulich@novell.com> --- arch/x86/mm/pageattr_32.c | 8 ++++++++ 1 file changed, 8 insertions(+) Index: linux/arch/x86/mm/pageattr_32.c =================================================================== --- linux.orig/arch/x86/mm/pageattr_32.c +++ linux/arch/x86/mm/pageattr_32.c @@ -242,6 +242,14 @@ __change_page_attr(struct page *page, pg BUG_ON(PageLRU(kpte_page)); BUG_ON(PageCompound(kpte_page)); + /* + * Better fail early if someone sets the kernel text to NX. + * Does not cover __inittext + */ + BUG_ON(address >= (unsigned long)&_text && + address < (unsigned long)&_etext && + (pgprot_val(prot) & _PAGE_NX)); + set_tlb_flush(address, cache_attr_changed(*kpte, prot, level), level < 3); --
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Andi Kleen | [PATCH x86] [0/16] Various i386/x86-64 changes |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Linus Torvalds | Re: [GIT]: Networking |
| Jeff Kirsher | [net-next PATCH 1/7] e1000e: enable CRC stripping by default |
| Jukka Andberg | ata/wdc vs gcc3 on amiga |
| YAMAMOTO Takashi | Re: wd.c patch to reduce kernel stack usage |
| Jason Thorpe | Re: ksyms patches. |
| rick | NFS transport |
