linux/tools
Matthew Schwartz 96443a53bc selftests/x86: Check signal state for rejected software interrupts
Add a test of the signal ABI for INT instructions in both 32-bit and
64-bit processes. Check the signal number, trap number, error code,
si_code, si_addr, instruction pointer and RF/TF state against legacy
IDT behavior. Include a 15-byte prefixed INT to check that IP uses the
hardware instruction length. Exercise both INT3 encodings, INT4, UD2
and HLT to cover the unchanged trap and fault paths.

Run each instruction with TF clear and set. Resume at a known NOP after
handling the signal and check that single-stepping traps after the NOP.

Also drive INT 0x2d under ptrace, which resumes through the fault frame
rather than sigreturn and so exposes a stale FRED software event flag.
Start from an INT3 stop, whose FRED frame has no software event flag,
instead of the syscall frame of raise(SIGSTOP). Single-step into the INT
and check that the fault reports its address. Then suppress SIGSEGV and
resume at the NOP, once with PTRACE_SINGLESTEP and once with PTRACE_CONT
and TF set. Section 6.2.3 of the Intel FRED specification [1] specifies
the immediate single-step trap caused by returning with both that flag
and TF set. Check that each trap occurs after the NOP, rather than at
its address.

Report whether the CPU supports FRED, since a pass looks the same on
either entry path. INT 0x80 with IA32 emulation disabled and a 64-bit
tracer of a 32-bit tracee are not covered.

Both variants pass all 29 checks on a non-FRED AMD host and on Panther
Lake with FRED enabled and the fix applied. With the same binaries on
unpatched Panther Lake, 16 signal-context checks fail and the first
ptrace check reports the IP after the INT. The two dependent ptrace
resume checks are not reached.

[1] Intel Flexible Return and Event Delivery (FRED) Specification,
revision 9.0 (346446-009US), section 6.2.3.

Signed-off-by: Matthew Schwartz <matthew.schwartz@linux.dev>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://cdrdv2.intel.com/v1/dl/getContent/678938 # [1]
Link: https://patch.msgid.link/20260917230907.2080792-3-matthew.schwartz@linux.dev
2026-09-18 12:33:18 +02:00
..
accounting tools/accounting: fix macro typos in getdelays 2026-08-03 21:10:17 -07:00
arch - Remove the smp_locks alternatives machinery which was used to patch out lock 2026-08-18 18:11:25 -07:00
bootconfig Bootconfig updates for v7.3: 2026-08-25 08:59:09 -07:00
bpf perf tools updates for v7.3 2026-08-22 08:47:50 -07:00
build perf build: Remove leftover feature tests for removed cxx and clang support 2026-08-12 06:17:49 -07:00
certs
cgroup tools/cgroup: iocost_monitor: parse help before importing drgn 2026-06-24 08:59:01 -10:00
counter
crypto
debugging
dma
docs doc tools: fix 'path' typos 2026-08-11 10:43:16 -06:00
firewire
firmware
gpio
hv
iio iio: types: add IIO_VOLUMEFLOW channel type 2026-08-05 00:02:55 +01:00
include Including fixes from Bluetooth, IPSec and Netfilter. 2026-08-27 13:53:43 -07:00
kvm/kvm_stat
laptop
leds
lib More thermal control updates for 7.3-rc1 2026-08-26 14:21:30 -07:00
memory-model
mm mm.git review status for master..mm-nonmm-stable 2026-08-23 08:07:11 -07:00
net Including fixes from Bluetooth, IPSec and Netfilter. 2026-08-27 13:53:43 -07:00
objtool Rust fixes for v7.3 2026-08-30 09:47:39 -07:00
pcmcia
perf perf tools updates for v7.3 2026-08-22 08:47:50 -07:00
platform/x86/amd platform/x86/amd/pmf: Introduce AMD PMF testing tool for driver metrics and features 2026-07-10 15:15:51 +03:00
power linux-cpupower-7.3-rc1 2026-08-05 13:53:51 +02:00
rcu
sched
sched_ext sched_ext: Merge branch 'for-7.3-arena-args' into for-7.3 2026-08-17 11:20:34 -10:00
scripts perf tools updates for v7.3 2026-08-22 08:47:50 -07:00
sound
spi
testing selftests/x86: Check signal state for rejected software interrupts 2026-09-18 12:33:18 +02:00
thermal tools/thermal/thermometer: close fd on realloc() failure 2026-07-22 17:43:55 +02:00
time
tracing rtla/cli: Unify and improve handling of invalid option arguments 2026-08-05 10:14:40 +02:00
unittests docs: kernel-doc: python: strip __counted_by_ptr macro 2026-05-15 08:11:36 -06:00
usb usbip: tools: support SuperSpeedPlus devices 2026-07-08 13:29:13 +02:00
verification verification/rvgen: Use .old instead of .bak for kunit backup files 2026-08-25 13:56:53 +02:00
virtio tools/virtio: Fix control typo in trace agent comment 2026-08-19 06:38:48 -04:00
wmi
workqueue workqueue: allocate attrs for all workqueues 2026-08-10 11:47:20 -10:00
writeback
Makefile