[PATCH 0/4] POE sigreturn fix and extra tests

Kevin Brodsky kevin.brodsky at arm.com
Tue Apr 21 07:42:48 PDT 2026


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 at arm.com>
Cc: Joey Gouly <joey.gouly at arm.com>
Cc: Mark Brown <broonie at kernel.org>
Cc: Shuah Khan <shuah at kernel.org>
Cc: Will Deacon <will at kernel.org>
Cc: linux-kselftest at 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




More information about the linux-arm-kernel mailing list