diff options
author | Will Deacon <will@kernel.org> | 2022-12-06 11:21:21 +0000 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2022-12-06 11:21:21 +0000 |
commit | c947948f7aa4fc8ffca598866f1955fad2860b72 (patch) | |
tree | 373f043e4580b61a0276abfc9d7a88badb9e1590 /arch/arm64/mm | |
parent | 37f5d61a96a16431549f7c0641086b4a9bb52601 (diff) | |
parent | 453dfcee70c5c344ca09396ff5b0baf177eb327e (diff) | |
download | linux-stable-c947948f7aa4fc8ffca598866f1955fad2860b72.tar.gz linux-stable-c947948f7aa4fc8ffca598866f1955fad2860b72.tar.bz2 linux-stable-c947948f7aa4fc8ffca598866f1955fad2860b72.zip |
Merge branch 'for-next/mm' into for-next/core
* for-next/mm:
arm64: booting: Require placement within 48-bit addressable memory
arm64: mm: kfence: only handle translation faults
arm64/mm: Simplify and document pte_to_phys() for 52 bit addresses
Diffstat (limited to 'arch/arm64/mm')
-rw-r--r-- | arch/arm64/mm/fault.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 3e9cf9826417..3eb2825d08cf 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -354,6 +354,11 @@ static bool is_el1_mte_sync_tag_check_fault(unsigned long esr) return false; } +static bool is_translation_fault(unsigned long esr) +{ + return (esr & ESR_ELx_FSC_TYPE) == ESR_ELx_FSC_FAULT; +} + static void __do_kernel_fault(unsigned long addr, unsigned long esr, struct pt_regs *regs) { @@ -386,7 +391,8 @@ static void __do_kernel_fault(unsigned long addr, unsigned long esr, } else if (addr < PAGE_SIZE) { msg = "NULL pointer dereference"; } else { - if (kfence_handle_page_fault(addr, esr & ESR_ELx_WNR, regs)) + if (is_translation_fault(esr) && + kfence_handle_page_fault(addr, esr & ESR_ELx_WNR, regs)) return; msg = "paging request"; |