[PATCH v4 0/6]

From: Bill Roberts

Date: Tue Sep 15 2026 - 15:40:42 EST


This is a continuation of:
- https://lore.kernel.org/all/20260818225428.1983328-1-bill.roberts@xxxxxxx/

FWIW X86 Maintaners and Rick, I structured this so you can just pull the bug fixes only
(up to but not including commit "x86/shstk: support via prctl") if you have concerns
on the other patches for me to address, this will allow you to take the bug fixes
and additional test now if desired.

History:
- v1: Initial Patches
- v2: Nacked by author
- Refactors the test suite
- v3:
- Fixes an existing fork bug pointed out by Shashiko
- Fixes a state rollback issue in the patch itself
- Fixes Makefile dependencies
- Add's a test for shadow stack state locking
- Refactors the arch_prctl and prctl tests into two different files using
a shared testing suite file
- v4:
- fix rollback state logic


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 | 83 ++
tools/testing/selftests/x86/Makefile | 13 +-
tools/testing/selftests/x86/shadow_stack.c | 1287 +++++++++++++++++
tools/testing/selftests/x86/shadow_stack.h | 14 +
.../testing/selftests/x86/test_shadow_stack.c | 1168 +--------------
.../selftests/x86/test_shadow_stack_prctl.c | 12 +
6 files changed, 1411 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