acrn-kernel/arch/powerpc/mm
Russell Currey 5ca66a9fff powerpc/mm: Fix false detection of read faults
[ Upstream commit f2c7e3562b ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-22 13:33:47 +01:00
..
book3s32 - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
book3s64 powerpc/mm: Rearrange if-else block to avoid clang warning 2023-03-10 09:32:32 +01:00
kasan powerpc/32s: Fix boot failure with KASAN + SMP + JUMP_LABEL_FEATURE_CHECK_DEBUG 2022-07-27 21:36:05 +10:00
nohash powerpc/64e: provide an addressing macro for use with TOC in alternate register 2022-09-28 19:22:12 +10:00
ptdump powerpc: Remove CONFIG_PPC_BOOK3E_MMU 2022-09-26 23:00:14 +10:00
Makefile
cacheflush.c powerpc: Fix all occurences of "the the" 2022-05-22 15:59:43 +10:00
copro_fault.c mm: avoid unnecessary page fault retires on shared memory types 2022-06-16 19:48:27 -07:00
dma-noncoherent.c
drmem.c
fault.c powerpc/mm: Fix false detection of read faults 2023-03-22 13:33:47 +01:00
hugetlbpage.c powerpc/mm: Fix UBSAN warning reported on hugetlb 2022-09-30 18:35:52 +10:00
init-common.c
init_32.c powerpc: Remove CONFIG_FSL_BOOKE 2022-09-26 22:47:37 +10:00
init_64.c Merge branch 'topic/ppc-kvm' into next 2022-05-19 23:10:42 +10:00
ioremap.c
ioremap_32.c
ioremap_64.c
maccess.c
mem.c powerpc: Remove CONFIG_PPC_FSL_BOOK3E 2022-09-26 23:00:13 +10:00
mmu_context.c
mmu_decl.h powerpc: Remove CONFIG_PPC_FSL_BOOK3E 2022-09-26 23:00:13 +10:00
numa.c powerpc/mm: Always update max/min_low_pfn in mem_topology_setup() 2022-09-30 18:35:52 +10:00
pageattr.c
pgtable-frag.c
pgtable.c powerpc/mm: move protection_map[] inside the platform 2022-07-17 17:14:37 -07:00
pgtable_32.c powerpc: move __end_rodata to cover arch read-only sections 2022-09-26 20:58:16 +10:00
pgtable_64.c