Skip to content

x86/shstk: ban ia32 sigreturn

Richard Patel linux-kselftest lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3x86/shstk: ban ia32 sigreturn when shadow stack is enabledarch/x86/kernel/signal_32.c+4 -08 replies
2/3selftests/x86: test shadow stack sigreturn protectiontools/testing/selftests/x86/test_shadow_stack.c+110 -00 replies
3/3selftests/x86: skip shstk tests where perf_event_open() failstools/testing/selftests/x86/test_shadow_stack.c+8 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] x86/shstk: ban ia32 sigreturn

User shadow stacks protect only the x64 and x32 rt_sigreturn syscalls. Calling ia32 rt_sigreturn, which lacks return address validation, is still possible via int $0x80. The bypass also requires the executable is mapped into low 32-bit address space. (This scenario is basically impossible to occur in the wild, but it's probably worth fixing nonetheless.)

Since user shadow stacks explicitly only support 64-bit mode, the simplest fix is to fault attempts to do 32-bit rt_sigreturn.

Richard Patel (3):
x86/shstk: ban ia32 sigreturn when shadow stack is enabled selftests/x86: test shadow stack sigreturn protection selftests/x86: skip shstk tests where perf_event_open() fails

 arch/x86/kernel/signal_32.c                   |   4 +
 .../testing/selftests/x86/test_shadow_stack.c | 120 +++++++++++++++++-
 2 files changed, 122 insertions(+), 2 deletions(-)

--
2.52.0