powerpc/8xx: Add Kernel Userspace Execution Prevention
authorChristophe Leroy <christophe.leroy@c-s.fr>
Mon, 11 Mar 2019 08:30:33 +0000 (08:30 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 21 Apr 2019 13:11:46 +0000 (23:11 +1000)
commit06fbe81b5909847aa13f9c86c2b6f9bbc5c2795b
treedd48ae9729e84beaa712f9d5dfa9ba9638f74d25
parentc341a108a58100b4d0774ddb1dacbd67dfa749b3
powerpc/8xx: Add Kernel Userspace Execution Prevention

This patch adds Kernel Userspace Execution Prevention on the 8xx.

When a page is Executable, it is set Executable for Key 0 and NX
for Key 1.

Up to now, the User group is defined with Key 0 for both User and
Supervisor.

By changing the group to Key 0 for User and Key 1 for Supervisor,
this patch prevents the Kernel from being able to execute user code.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/nohash/32/mmu-8xx.h
arch/powerpc/mm/8xx_mmu.c
arch/powerpc/platforms/Kconfig.cputype