mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Add test for atomic uaccess with permission overlay
@ 2026-05-21  9:42 Kevin Brodsky
  2026-05-21  9:42 ` [PATCH 1/2] arm64: mm: Add note about overlays in PIE_EL1 Kevin Brodsky
  2026-05-21  9:42 ` [PATCH 2/2] kselftest/arm64: Add test for atomic futex uaccess with POE Kevin Brodsky
  0 siblings, 2 replies; 8+ messages in thread
From: Kevin Brodsky @ 2026-05-21  9:42 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Kevin Brodsky, Catalin Marinas, Joey Gouly, Mark Brown,
	Shuah Khan, Will Deacon, linux-kernel, linux-kselftest

Permission overlays are not currently applied for memory types
configured in PIR_EL1, meaning that even if POE were enabled at EL1,
memory accesses would not be subject to POE restrictions.

A patch [1] in my series adding page table protection using
pkeys/POE [2] enabled overlays for all memory types in PIR_EL1. It
turns out this is wrong, as reported by Sashiko [3]. User memory
types must not have overlays applied in PIR_EL1, otherwise direct
accesses to user memory with privileged loads/stores (and PAN
disabled) will mistakenly be checked against POR_EL1, instead of the
intended POR_EL0.

To avoid any accident in the future, this series adds a comment
above the PIR_EL1 configuration block, and a kselftest to ensure
that atomic futex uaccess (which uses privileged loads/stores unless
FEAT_LSUI is available) does work on memory mapped with a
non-default pkey. 

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>

[1] https://lore.kernel.org/all/20260505-kpkeys-v7-3-20c0bdd97197@arm.com/
[2] https://lore.kernel.org/all/20260505-kpkeys-v7-0-20c0bdd97197@arm.com/
[3] https://sashiko.dev/#/patchset/20260505-kpkeys-v7-0-20c0bdd97197%40arm.com?part=3

---
To: linux-arm-kernel@lists.infradead.org
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Joey Gouly <joey.gouly@arm.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: linux-kernel@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org

---
Kevin Brodsky (2):
      arm64: mm: Add note about overlays in PIE_EL1
      kselftest/arm64: Add test for atomic futex uaccess with POE

 arch/arm64/include/asm/pgtable-prot.h         |  7 +++
 tools/testing/selftests/arm64/Makefile        |  2 +-
 tools/testing/selftests/arm64/poe/.gitignore  |  2 +
 tools/testing/selftests/arm64/poe/Makefile    |  6 +++
 tools/testing/selftests/arm64/poe/poe_futex.c | 62 +++++++++++++++++++++++++++
 5 files changed, 78 insertions(+), 1 deletion(-)
---
base-commit: 5200f5f493f79f14bbdc349e402a40dfb32f23c8
change-id: 20260520-poe_futex-ecb8c2276894


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-05-22  9:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-21  9:42 [PATCH 0/2] Add test for atomic uaccess with permission overlay Kevin Brodsky
2026-05-21  9:42 ` [PATCH 1/2] arm64: mm: Add note about overlays in PIE_EL1 Kevin Brodsky
2026-05-21  9:48   ` Kevin Brodsky
2026-05-22  9:20   ` Yeoreum Yun
2026-05-21  9:42 ` [PATCH 2/2] kselftest/arm64: Add test for atomic futex uaccess with POE Kevin Brodsky
2026-05-21 11:22   ` Mark Brown
2026-05-21 12:01     ` Kevin Brodsky
2026-05-21 12:06       ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®