diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-20 18:51:43 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-20 18:51:43 +0100 |
commit | c9e1585b1b7e36a72181f2c59c2abfd476512e93 (patch) | |
tree | e293a9a316a220a1a9c40ea29a718cd49a4ac8df /arch/x86/mm/fault.c | |
parent | x86, pat: add large-PAT check to split_large_page() (diff) | |
parent | x86: check PMD in spurious_fault handler (diff) | |
download | linux-c9e1585b1b7e36a72181f2c59c2abfd476512e93.tar.xz linux-c9e1585b1b7e36a72181f2c59c2abfd476512e93.zip |
Merge branch 'tip/x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into x86/mm
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r-- | arch/x86/mm/fault.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 29644175490f..e4b9fc5001c6 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -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; } /* |