]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'tip/x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rosted...
authorIngo Molnar <mingo@elte.hu>
Fri, 20 Feb 2009 17:51:43 +0000 (18:51 +0100)
committerIngo Molnar <mingo@elte.hu>
Fri, 20 Feb 2009 17:51:43 +0000 (18:51 +0100)
arch/x86/mm/fault.c

index 29644175490f826893102bf26c425b06b857d98a..e4b9fc5001c6b3aa1de28e3392be8859c2917fca 100644 (file)
@@ -645,6 +645,7 @@ static noinline int spurious_fault(unsigned long error_code,
        pud_t *pud;
        pmd_t *pmd;
        pte_t *pte;
+       int ret;
 
        /* Reserved-bit violation or user access to kernel space? */
        if (error_code & (PF_USER | PF_RSVD))
@@ -672,7 +673,17 @@ static noinline int spurious_fault(unsigned long error_code,
        if (!pte_present(*pte))
                return 0;
 
-       return spurious_fault_check(error_code, pte);
+       ret = spurious_fault_check(error_code, pte);
+       if (!ret)
+               return 0;
+
+       /*
+        * Make sure we have permissions in PMD
+        * If not, then there's a bug in the page tables.
+        */
+       ret = spurious_fault_check(error_code, (pte_t *) pmd);
+       WARN_ONCE(!ret, "PMD has incorrect permission bits\n");
+       return ret;
 }
 
 /*