diff options
-rw-r--r-- | arch/x86/mm/fault.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 51f7ee71d6c7..caec22906d7c 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -872,8 +872,14 @@ spurious_fault(unsigned long error_code, unsigned long address) | |||
872 | if (pmd_large(*pmd)) | 872 | if (pmd_large(*pmd)) |
873 | return spurious_fault_check(error_code, (pte_t *) pmd); | 873 | return spurious_fault_check(error_code, (pte_t *) pmd); |
874 | 874 | ||
875 | /* | ||
876 | * Note: don't use pte_present() here, since it returns true | ||
877 | * if the _PAGE_PROTNONE bit is set. However, this aliases the | ||
878 | * _PAGE_GLOBAL bit, which for kernel pages give false positives | ||
879 | * when CONFIG_DEBUG_PAGEALLOC is used. | ||
880 | */ | ||
875 | pte = pte_offset_kernel(pmd, address); | 881 | pte = pte_offset_kernel(pmd, address); |
876 | if (!pte_present(*pte)) | 882 | if (!(pte_flags(*pte) & _PAGE_PRESENT)) |
877 | return 0; | 883 | return 0; |
878 | 884 | ||
879 | ret = spurious_fault_check(error_code, pte); | 885 | ret = spurious_fault_check(error_code, pte); |