arm64: kernel: Add support for Privileged Access Never
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest0 of 6 patches 0 repliesNew
Patches in v2 No applies recorded yet
None of the 6 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/6] arm64: kernel: Add support for Privileged Access Never
Quoted 18 lines · James Morse
This series adds support for Privileged Access Never (PAN; part of the ARMv8.1 Extensions). When enabled, this feature causes a permission fault if the kernel attempts to access memory that is also accessible by userspace - instead the PAN bit must be cleared when accessing userspace memory. (or use the ldt*/stt* instructions).
This series detects and enables this feature, and uses alternatives to change {get,put}_user() et al to clear the PAN bit while they do their work.
Changes since v1:
* Copiedcpuid_feature_extract_field()fromarch/armas a new patch, suggested by Russell King [1].
* Changed feature-detection patch to usecpuid_feature_extract_field()for sign extension, and '>='.
* Moved SCTLR_EL1_* fromasm/cputype.htoasm/sysreg.h
* AddedPSR_PAN_BITinuapi/asm/ptrace.h
* Removed the setting ofPSTATE_PANinkernel/process.c
Quoted 2 lines
Hi James,
Looks like it doesn't play nicely with CONFIG_SWP_EMULATION=y. I get segfault while executing swp and PAN is enabled, though I've been playing with one of the older version.
Vladimir
Quoted 29 lines
James Morse (6):
arm64: kernel: Addcpuid_feature_extract_field()for 4bit sign
extension
arm64: kernel: preparatory: Moveconfig_sctlr_el1
arm64: kernel: Add cpufeature 'enable' callback
arm64: kernel: Addmin_register_valueand use '>=' for feature
detection
arm64: kernel: Add optionalCONFIG_parameter toALTERNATIVE()
arm64: kernel: Add support for Privileged Access Neverarch/arm64/Kconfig | 14 +++++++++++++ arch/arm64/include/asm/alternative.h | 28 ++++++++++++++++++++++--- arch/arm64/include/asm/cpufeature.h | 21 ++++++++++++++++--- arch/arm64/include/asm/cputype.h | 3 --- arch/arm64/include/asm/futex.h | 8 ++++++++ arch/arm64/include/asm/processor.h | 2 ++ arch/arm64/include/asm/sysreg.h | 21 +++++++++++++++++++ arch/arm64/include/asm/uaccess.h | 11 ++++++++++ arch/arm64/include/uapi/asm/ptrace.h | 1 + arch/arm64/kernel/armv8_deprecated.c | 11 +--------- arch/arm64/kernel/cpufeature.c | 40 +++++++++++++++++++++++++++++++++--- arch/arm64/lib/clear_user.S | 8 ++++++++ arch/arm64/lib/copy_from_user.S | 8 ++++++++ arch/arm64/lib/copy_in_user.S | 8 ++++++++ arch/arm64/lib/copy_to_user.S | 8 ++++++++ arch/arm64/mm/fault.c | 23 +++++++++++++++++++++ 16 files changed, 193 insertions(+), 22 deletions(-)