[PATCH v5 0/6] x86: Support shstk via prctl
From: Bill Roberts
Date: Mon Nov 09 2026 - 13:42:34 EST
This is a continuation of:
https://lore.kernel.org/lkml/20260916095224.1533971-1-bill.roberts@xxxxxxx/
FWIW, x86 maintainers and Rick, I structured this series so that the
initial bug fixes and additional test (patches 1-3) can be taken
independently of the prctl() enablement. If there are concerns with
the remaining patches that require further work, this allows the
fixes and additional test to be merged without waiting for the
rest of the series.
History:
- v1: Initial patches
- v2: NAKed by author
- Refactor the test suite
- v3:
- Fix an existing fork bug pointed out by Sashiko
- Fix a state rollback issue
- Fix Makefile dependencies
- Add a test for shadow stack state locking
- Refactor the arch_prctl and prctl tests into separate entry
points using a shared test implementation
- v4:
- Fix rollback state logic
- v5:
- Expand commit messages to explain behavior and implementation
rationale
- Move unsigned long status to the beginning of the function
- Shorten the comment in arch_set_shadow_stack_status()
- Rewrite the WRSS comment in imperative mood
- Remove an unrelated whitespace change in test_shadow_stack.c
Bill Roberts (6):
selftests/x86: fix Makefile dependencies
selftests/x86: fix fork bug
selftests/x86: add shadow stack lock test
x86/shstk: support via prctl
selftests/x86: support header files in extra-files
selftests/x86: add generic prctl shadow stack test
arch/x86/kernel/shstk.c | 80 +
tools/testing/selftests/x86/Makefile | 12 +-
tools/testing/selftests/x86/shadow_stack.c | 1287 +++++++++++++++++
tools/testing/selftests/x86/shadow_stack.h | 14 +
.../testing/selftests/x86/test_shadow_stack.c | 1167 +--------------
.../selftests/x86/test_shadow_stack_prctl.c | 12 +
6 files changed, 1406 insertions(+), 1166 deletions(-)
create mode 100644 tools/testing/selftests/x86/shadow_stack.c
create mode 100644 tools/testing/selftests/x86/shadow_stack.h
create mode 100644 tools/testing/selftests/x86/test_shadow_stack_prctl.c
--
2.55.0