Skip to content

Commit 17adaea

Browse files
committed
Merge tag 'powerpc-6.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: - Fix false detection of read faults, introduced by execute-only support - Fix a build failure when GENERIC_ALLOCATOR is not selected Thanks to Russell Currey, Randy Dunlap, Michal Suchánek, Nathan Lynch, and Benjamin Gray. * tag 'powerpc-6.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/mm: Fix false detection of read faults powerpc/pseries: RTAS work area requires GENERIC_ALLOCATOR
2 parents 2c50b0c + f2c7e35 commit 17adaea

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

arch/powerpc/mm/fault.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,16 @@ static bool access_error(bool is_write, bool is_exec, struct vm_area_struct *vma
271271
}
272272

273273
/*
274-
* Check for a read fault. This could be caused by a read on an
275-
* inaccessible page (i.e. PROT_NONE), or a Radix MMU execute-only page.
274+
* VM_READ, VM_WRITE and VM_EXEC all imply read permissions, as
275+
* defined in protection_map[]. Read faults can only be caused by
276+
* a PROT_NONE mapping, or with a PROT_EXEC-only mapping on Radix.
276277
*/
277-
if (unlikely(!(vma->vm_flags & VM_READ)))
278+
if (unlikely(!vma_is_accessible(vma)))
278279
return true;
280+
281+
if (unlikely(radix_enabled() && ((vma->vm_flags & VM_ACCESS_FLAGS) == VM_EXEC)))
282+
return true;
283+
279284
/*
280285
* We should ideally do the vma pkey access check here. But in the
281286
* fault path, handle_mm_fault() also does the same check. To avoid

arch/powerpc/platforms/pseries/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ config PPC_PSERIES
77
select OF_DYNAMIC
88
select FORCE_PCI
99
select PCI_MSI
10+
select GENERIC_ALLOCATOR
1011
select PPC_XICS
1112
select PPC_XIVE_SPAPR
1213
select PPC_ICP_NATIVE

0 commit comments

Comments
 (0)