linux/arch/powerpc
Russell Currey f2c7e3562b powerpc/mm: Fix false detection of read faults
To support detection of read faults with Radix execute-only memory, the
vma_is_accessible() check in access_error() (which checks for PROT_NONE)
was replaced with a check to see if VM_READ was missing, and if so,
returns true to assert the fault was caused by a bad read.

This is incorrect, as it ignores that both VM_WRITE and VM_EXEC imply
read on powerpc, as defined in protection_map[].  This causes mappings
containing VM_WRITE or VM_EXEC without VM_READ to misreport the cause of
page faults, since the MMU is still allowing reads.

Correct this by restoring the original vma_is_accessible() check for
PROT_NONE mappings, and adding a separate check for Radix PROT_EXEC-only
mappings.

Fixes: 395cac7752 ("powerpc/mm: Support execute-only memory on the Radix MMU")
Reported-by: Michal Suchánek <msuchanek@suse.de>
Link: https://lore.kernel.org/r/20230308152702.GR19419@kitsune.suse.cz
Tested-by: Benjamin Gray <bgray@linux.ibm.com>
Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230310050834.63105-1-ruscur@russell.cc
2023-03-15 20:48:53 +11:00
..
boot powerpc: dts: t1040rdb: enable both CPU ports 2023-02-28 14:13:32 -08:00
configs eth: fealnx: bring back this old driver 2023-03-08 23:22:04 -08:00
crypto crypto: powerpc - Use address generation helper for asm 2023-02-10 22:17:36 +11:00
include ARM: 2023-02-25 11:30:21 -08:00
kernel powerpc fixes for 6.3 #2 2023-03-04 11:20:42 -08:00
kexec powerpc/kexec_file: print error string on usable memory property update failure 2023-02-15 23:14:06 +11:00
kvm ARM: 2023-02-25 11:30:21 -08:00
lib powerpc/kcsan: Add exclusions from instrumentation 2023-02-10 22:19:56 +11:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc/mm: Fix false detection of read faults 2023-03-15 20:48:53 +11:00
net powerpc/bpf/32: perform three operands ALU operations 2023-02-10 22:17:35 +11:00
perf powerpc updates for 6.3 2023-02-25 11:00:06 -08:00
platforms powerpc/pseries: RTAS work area requires GENERIC_ALLOCATOR 2023-03-14 23:03:36 +11:00
purgatory powerpc/kcsan: Add exclusions from instrumentation 2023-02-10 22:19:56 +11:00
sysdev powerpc/rtas: arch-wide function token lookup conversions 2023-02-13 22:35:03 +11:00
tools
xmon cpumask: fix incorrect cpumask scanning result checks 2023-03-06 12:15:13 -08:00
Kbuild
Kconfig powerpc: Avoid dead code/data elimination when using recordmcount 2023-02-28 14:32:34 +11:00
Kconfig.debug powerpc: Add support for early debugging via Serial 16550 console 2022-09-28 19:22:09 +10:00
Makefile Kbuild updates for v6.3 2023-02-26 11:53:25 -08:00
Makefile.postlink kbuild: remove --include-dir MAKEFLAG from top Makefile 2023-02-05 18:51:22 +09:00