linux/arch/arm64
Mark Rutland 0bb1fbffc6 arm64: mm: kfence: only handle translation faults
Alexander noted that KFENCE only expects to handle faults from invalid page
table entries (i.e. translation faults), but arm64's fault handling logic will
call kfence_handle_page_fault() for other types of faults, including alignment
faults caused by unaligned atomics. This has the unfortunate property of
causing those other faults to be reported as "KFENCE: use-after-free",
which is misleading and hinders debugging.

Fix this by only forwarding unhandled translation faults to the KFENCE
code, similar to what x86 does already.

Alexander has verified that this passes all the tests in the KFENCE test
suite and avoids bogus reports on misaligned atomics.

Link: https://lore.kernel.org/all/20221102081620.1465154-1-zhongbaisong@huawei.com/
Fixes: 840b239863 ("arm64, kfence: enable KFENCE for ARM64")
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
Tested-by: Alexander Potapenko <glider@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Marco Elver <elver@google.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20221114104411.2853040-1-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2022-11-15 13:29:05 +00:00
..
boot Armv8 Juno fix for v6.1 2022-11-02 21:58:46 +01:00
configs This update includes the following changes: 2022-10-10 13:04:25 -07:00
crypto This update includes the following changes: 2022-10-10 13:04:25 -07:00
hyperv hyperv: simplify and rename generate_guest_id 2022-09-28 13:36:56 +00:00
include arm64/mm: Simplify and document pte_to_phys() for 52 bit addresses 2022-11-09 18:13:18 +00:00
kernel arm64 fixes: 2022-11-04 19:52:24 -07:00
kvm KVM: arm64: Fix SMPRI_EL1/TPIDR2_EL0 trapping on VHE 2022-11-01 15:56:52 +00:00
lib Networking changes for 6.0. 2022-08-03 16:29:08 -07:00
mm arm64: mm: kfence: only handle translation faults 2022-11-15 13:29:05 +00:00
net bpf: arm64: No support of struct argument in trampoline programs 2022-09-06 19:51:14 -07:00
tools arm64/sysreg: Fix typo in SCTR_EL1.SPINTMASK 2022-10-07 14:30:11 +01:00
xen
Kbuild
Kconfig arm64 fixes: 2022-10-14 12:38:03 -07:00
Kconfig.debug
Kconfig.platforms ARM: SoC code changes for 6.1 2022-10-06 11:22:25 -07:00
Makefile Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00