[PATCH v3 0/5] x86: Support shstk via prctl

Bill Roberts posted 5 patches 1 month, 1 week ago
arch/x86/kernel/shstk.c                       |   56 +
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 | 1168 +--------------
.../selftests/x86/test_shadow_stack_prctl.c   |   12 +
6 files changed, 1384 insertions(+), 1165 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
[PATCH v3 0/5] x86: Support shstk via prctl
Posted by Bill Roberts 1 month, 1 week ago
This is a continuation of adding prctl support for x86:
  - https://patchew.org/linux/20260714154740.140431-1-bill.roberts@arm.com/

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

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.

Bill Roberts (5):
  selftests/x86: fix Makefile dependencies
  selftests/x86: fix fork bug
  selftests/x86: add shadow stack lock test
  x86/shstk: support via prctl
  selftests/x86: add generic prctl shadow stack test

 arch/x86/kernel/shstk.c                       |   56 +
 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 | 1168 +--------------
 .../selftests/x86/test_shadow_stack_prctl.c   |   12 +
 6 files changed, 1384 insertions(+), 1165 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
Re: [PATCH v3 0/5] x86: Support shstk via prctl
Posted by Bill Roberts 1 month, 1 week ago
> 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.

Nack'ing again, Shashiko has valid concerns and some minor nits in the 
commits.
Sorry for the spam, just realized I can get this bot running locally I 
believe via
https://github.com/sashiko-dev/sashiko

Maybe that will help someone as we battle the era of bots.

Thanks