Revert "arm64: mm: add support for WXN memory translation attribute"
authorCatalin Marinas <catalin.marinas@arm.com>
Tue, 12 Mar 2024 20:00:20 +0000 (20:00 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 13 Mar 2024 10:53:20 +0000 (10:53 +0000)
commit69ebc0182406541f0be0f086cdfff13ac56e7385
tree30d949dc857a11ebd5ebd5920b49cbc46edd65f6
parentf1bbc4e9cfa4c0f29883171e9d01c01cbe94becc
Revert "arm64: mm: add support for WXN memory translation attribute"

This reverts commit 50e3ed0f93f4f62ed2aa83de5db6cb84ecdd5707.

The SCTLR_EL1.WXN control forces execute-never when a page has write
permissions. While the idea of hardening such write/exec combinations is
good, with permissions indirection enabled (FEAT_PIE) this control
becomes RES0. FEAT_PIE introduces a slightly different form of WXN which
only has an effect when the base permission is RWX and the write is
toggled by the permission overlay (FEAT_POE, not yet supported by the
arm64 kernel). Revert the patch for now.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/ZfGESD3a91lxH367@arm.com
arch/arm64/Kconfig
arch/arm64/include/asm/cpufeature.h
arch/arm64/include/asm/mman.h
arch/arm64/include/asm/mmu_context.h
arch/arm64/kernel/pi/idreg-override.c
arch/arm64/kernel/pi/map_kernel.c
arch/arm64/mm/proc.S