linux/tools/testing/selftests/x86
Xin Li (Intel) f287822688 selftests/x86: Add a test to detect infinite SIGTRAP handler loop
When FRED is enabled, if the Trap Flag (TF) is set without an external
debugger attached, it can lead to an infinite loop in the SIGTRAP
handler.  To avoid this, the software event flag in the augmented SS
must be cleared, ensuring that no single-step trap remains pending when
ERETU completes.

This test checks for that specific scenario—verifying whether the kernel
correctly prevents an infinite SIGTRAP loop in this edge case when FRED
is enabled.

The test should _always_ pass with IDT event delivery, thus no need to
disable the test even when FRED is not enabled.

Signed-off-by: Xin Li (Intel) <xin@zytor.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Tested-by: Sohil Mehta <sohil.mehta@intel.com>
Cc:stable@vger.kernel.org
Link: https://lore.kernel.org/all/20250609084054.2083189-3-xin%40zytor.com
2025-06-09 08:52:06 -07:00
..
bugs selftest/x86/bugs: Add selftests for ITS 2025-05-09 13:39:45 -07:00
.gitignore
amx.c selftests/x86/xstate: Consolidate test invocations into a single entry 2025-02-26 13:05:29 +01:00
apx.c selftests/x86/apx: Add APX test 2025-04-16 09:44:14 +02:00
avx.c selftests/x86/avx: Add AVX tests 2025-02-26 13:05:30 +01:00
check_cc.sh
check_initial_reg_state.c
clang_helpers_32.S selftests/x86: build fsgsbase_restore.c with clang 2024-07-11 11:23:55 -06:00
clang_helpers_64.S selftests/x86: build sysret_rip.c with clang 2024-07-11 11:23:55 -06:00
corrupt_xstate_header.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
entry_from_vm86.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
fsgsbase.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
fsgsbase_restore.c selftests/x86: build fsgsbase_restore.c with clang 2024-07-11 11:23:55 -06:00
helpers.h selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
ioperm.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
iopl.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
lam.c selftests/x86/lam: Fix clean up fds in do_uring() and allocate_dsa_pasid() 2025-04-09 21:30:37 +02:00
ldt_gdt.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
Makefile selftests/x86: Add a test to detect infinite SIGTRAP handler loop 2025-06-09 08:52:06 -07:00
mov_ss_trap.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
nx_stack.c
ptrace_syscall.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
raw_syscall_helper_32.S
sigaltstack.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
sigreturn.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
sigtrap_loop.c selftests/x86: Add a test to detect infinite SIGTRAP handler loop 2025-06-09 08:52:06 -07:00
single_step_syscall.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
srso.c Documentation/srso: Document a method for checking safe RET operates properly 2024-08-27 09:16:35 +02:00
syscall_arg_fault.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
syscall_nt.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
syscall_numbering.c selftests/x86/syscall: Fix coccinelle WARNING recommending the use of ARRAY_SIZE() 2025-03-03 12:38:49 +01:00
sysret_rip.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
sysret_ss_attrs.c
test_FCMOV.c
test_FCOMI.c
test_FISTTP.c selftests: x86: test_FISTTP: use fisttps instead of ambiguous fisttp 2024-07-11 11:23:55 -06:00
test_mremap_vdso.c selftests: x86: test_mremap_vdso: skip if vdso is msealed 2025-04-01 15:17:15 -07:00
test_shadow_stack.c
test_syscall_vdso.c
test_vsyscall.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
thunks.S
thunks_32.S
trivial_32bit_program.c
trivial_64bit_program.c
trivial_program.c
unwind_vdso.c selftests/x86: Consolidate redundant signal helper functions 2025-02-26 13:05:28 +01:00
vdso_restorer.c selftests/x86: remove (or use) unused variables and functions 2024-07-11 11:23:55 -06:00
xstate.c selftests/x86/apx: Add APX test 2025-04-16 09:44:14 +02:00
xstate.h selftests/x86/apx: Add APX test 2025-04-16 09:44:14 +02:00