OpenCloudOS-Kernel/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
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
kvm ARM: 2023-02-25 11:30:21 -08:00
lib
math-emu
mm powerpc/mm: Fix false detection of read faults 2023-03-15 20:48:53 +11:00
net
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
sysdev
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
Makefile Kbuild updates for v6.3 2023-02-26 11:53:25 -08:00
Makefile.postlink