public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/4] POE sigreturn fix and extra tests
@ 2026-04-21 14:42 Kevin Brodsky
  2026-04-21 14:42 ` [PATCH 1/4] arm64: signal: Preserve POR_EL0 if poe_context is missing Kevin Brodsky
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Kevin Brodsky @ 2026-04-21 14:42 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, Kevin Brodsky, Catalin Marinas, Joey Gouly,
	Mark Brown, Shuah Khan, Will Deacon, linux-kselftest

Commit 2e8a1acea859 ("arm64: signal: Improve POR_EL0 handling to
avoid uaccess failures") introduced special handling for EL0 registers
that impact uaccess. This did not however handle the case where a signal
handler removes the relevant record (poe_context for POE) from the
signal frame; this is clearly not typical behaviour but it is legal.
That commit resulted in arbitrary data from the kernel stack being
written to POR_EL0 in that case.

Patch 1 fixes this by tracking which fields in struct user_access_state
are actually valid. This restores the original behaviour, where POR_EL0
is left untouched if poe_context is removed.

The remaining patches add new tests to the arm64 signal kselftests to
check that POR_EL0 is reset and restored (or preserved) as expected.
---
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-kselftest@vger.kernel.org
---
Kevin Brodsky (4):
  arm64: signal: Preserve POR_EL0 if poe_context is missing
  kselftest/arm64: Add POE as a feature in the signal tests
  kselftest/arm64: Add POE helpers to test_signals_utils.h
  kselftest/arm64: Add tests for POR_EL0 save/reset/restore

 arch/arm64/kernel/signal.c                    | 19 +++--
 .../selftests/arm64/signal/test_signals.h     |  2 +
 .../arm64/signal/test_signals_utils.c         |  3 +
 .../arm64/signal/test_signals_utils.h         | 16 ++++
 .../testcases/poe_missing_poe_context.c       | 73 +++++++++++++++++++
 .../arm64/signal/testcases/poe_restore.c      | 64 ++++++++++++++++
 .../arm64/signal/testcases/poe_siginfo.c      | 15 ----
 7 files changed, 172 insertions(+), 20 deletions(-)
 create mode 100644 tools/testing/selftests/arm64/signal/testcases/poe_missing_poe_context.c
 create mode 100644 tools/testing/selftests/arm64/signal/testcases/poe_restore.c


base-commit: 028ef9c96e96197026887c0f092424679298aae8
-- 
2.51.2



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

end of thread, other threads:[~2026-04-24  9:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-21 14:42 [PATCH 0/4] POE sigreturn fix and extra tests Kevin Brodsky
2026-04-21 14:42 ` [PATCH 1/4] arm64: signal: Preserve POR_EL0 if poe_context is missing Kevin Brodsky
2026-04-22 12:19   ` Will Deacon
2026-04-22 14:55     ` Kevin Brodsky
2026-04-23 12:41       ` Will Deacon
2026-04-24  9:24         ` Kevin Brodsky
2026-04-21 14:42 ` [PATCH 2/4] kselftest/arm64: Add POE as a feature in the signal tests Kevin Brodsky
2026-04-21 14:58   ` Mark Brown
2026-04-21 14:42 ` [PATCH 3/4] kselftest/arm64: Add POE helpers to test_signals_utils.h Kevin Brodsky
2026-04-21 15:00   ` Mark Brown
2026-04-21 14:42 ` [PATCH 4/4] kselftest/arm64: Add tests for POR_EL0 save/reset/restore Kevin Brodsky

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