]> Git Repo - linux.git/commit
arm64: mm: kfence: only handle translation faults
authorMark Rutland <[email protected]>
Mon, 14 Nov 2022 10:44:11 +0000 (10:44 +0000)
committerWill Deacon <[email protected]>
Tue, 15 Nov 2022 13:29:05 +0000 (13:29 +0000)
commit0bb1fbffc631064db567ccaeb9ed6b6df6342b66
tree7a383af1a4f9e9c1ab1c92dab85e81a188ab11ee
parenta4ee28615c7a1e2925e1fcb4ba0fa1aeee633d78
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/[email protected]/
Fixes: 840b23986344 ("arm64, kfence: enable KFENCE for ARM64")
Signed-off-by: Mark Rutland <[email protected]>
Reviewed-by: Alexander Potapenko <[email protected]>
Tested-by: Alexander Potapenko <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Marco Elver <[email protected]>
Cc: Will Deacon <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[email protected]>
arch/arm64/mm/fault.c
This page took 0.054423 seconds and 4 git commands to generate.