linux_dsm_epyc7002/arch/powerpc
Christophe Leroy 810e9f86f3 powerpc/nohash: fix pte_access_permitted()
Commit 5769beaf18 ("powerpc/mm: Add proper pte access check helper
for other platforms") replaced generic pte_access_permitted() by an
arch specific one.

The generic one is defined as
(pte_present(pte) && (!(write) || pte_write(pte)))

The arch specific one is open coded checking that _PAGE_USER and
_PAGE_WRITE (_PAGE_RW) flags are set, but lacking to check that
_PAGE_RO and _PAGE_PRIVILEGED are unset, leading to a useless test
on targets like the 8xx which defines _PAGE_RW and _PAGE_USER as 0.

Commit 5fa5b16be5 ("powerpc/mm/hugetlb: Use pte_access_permitted
for hugetlb access check") replaced some tests performed with
pte helpers by a call to pte_access_permitted(), leading to the same
issue.

This patch rewrites powerpc/nohash pte_access_permitted()
using pte helpers.

Fixes: 5769beaf18 ("powerpc/mm: Add proper pte access check helper for other platforms")
Fixes: 5fa5b16be5 ("powerpc/mm/hugetlb: Use pte_access_permitted for hugetlb access check")
Cc: stable@vger.kernel.org # v4.15+
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-08-23 12:15:58 +10:00
..
boot powerpc/dts/fsl: t2080rdb: use the Cortina PHY driver compatible 2018-08-08 17:18:02 -05:00
configs powerpc/configs/dpaa: enable the Cortina PHY driver 2018-08-08 17:13:45 -05:00
crypto powerpc: move ASM_CONST and stringify_in_c() into asm-const.h 2018-07-30 22:48:16 +10:00
include powerpc/nohash: fix pte_access_permitted() 2018-08-23 12:15:58 +10:00
kernel powerpc/topology: Get topology for shared processors at boot 2018-08-21 16:01:59 +10:00
kvm powerpc64/ftrace: Include ftrace.h needed for enable/disable calls 2018-08-21 15:58:34 +10:00
lib powerpc/lib: Use patch_site to patch copy_32 functions once cache is enabled 2018-08-10 22:12:35 +10:00
math-emu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mm powerpc/topology: Get topology for shared processors at boot 2018-08-21 16:01:59 +10:00
net powerpc/Makefiles: Convert ifeq to ifdef where possible 2018-08-08 00:32:36 +10:00
oprofile treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
perf powerpc/perf: Remove sched_task function defined for thread-imc 2018-08-08 00:32:32 +10:00
platforms powerpc/powernv/pci: Work around races in PCI bridge enabling 2018-08-20 20:29:17 +10:00
purgatory powerpc: move ASM_CONST and stringify_in_c() into asm-const.h 2018-07-30 22:48:16 +10:00
sysdev powerpc/cpm1: fix compilation error with CONFIG_PPC_EARLY_DEBUG_CPM 2018-08-10 22:12:33 +10:00
tools powerpc: Add a checkpatch wrapper with our preferred settings 2018-08-07 21:49:25 +10:00
xmon Merge branch 'fixes' into next 2018-08-13 15:59:06 +10:00
Kconfig powerpc/fsl: Add barrier_nospec implementation for NXP PowerPC Book3E 2018-08-08 00:32:24 +10:00
Kconfig.debug powerpc: Add new kconfig CONFIG_PPC_IRQ_SOFT_MASK_DEBUG 2018-01-19 22:37:03 +11:00
Makefile Merge branch 'fixes' into next 2018-08-13 15:59:06 +10:00
Makefile.postlink License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00