Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=687c4825b6ccab69b85f266ae925500b27aab6c2
Commit:     687c4825b6ccab69b85f266ae925500b27aab6c2
Parent:     30551bb3ce9257a2352b3cb4e45010d415cc0ad5
Author:     Ingo Molnar <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:34:04 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:34:04 2008 +0100

    x86: keep the BIOS area executable
    
    keep the BIOS area executable.
    
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/mm/pageattr.c |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 4589a13..effcd78 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -22,6 +22,27 @@ void clflush_cache_range(void *addr, int size)
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
 
+/*
+ * We allow the BIOS range to be executable:
+ */
+#define BIOS_BEGIN             0x000a0000
+#define BIOS_END               0x00100000
+
+static inline pgprot_t check_exec(pgprot_t prot, unsigned long address)
+{
+       if (__pa(address) >= BIOS_BEGIN && __pa(address) < BIOS_END)
+               pgprot_val(prot) &= ~_PAGE_NX;
+       /*
+        * 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));
+
+       return prot;
+}
+
 pte_t *lookup_address(unsigned long address, int *level)
 {
        pgd_t *pgd = pgd_offset_k(address);
@@ -140,13 +161,7 @@ repeat:
        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));
+       prot = check_exec(prot, address);
 
        if (level == PG_LEVEL_4K) {
                set_pte_atomic(kpte, mk_pte(page, canon_pgprot(prot)));
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to