This series reconstructs the #GP signal context for rejected INT
instructions with FRED enabled. The incorrect error code and saved IP
break Wine's handling of INT 0x2d, causing Elden Ring to fail with a
spurious access violation on Panther Lake.

The software event flag handling follows the same reasoning as the
existing sigreturn fix in prevent_single_step_upon_eretu(). The second
patch adds 32-bit and 64-bit signal-context and ptrace resume coverage.

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

Separate continuation testing with the fix matched an IDT baseline on
another system in both bitnesses: unchanged IP retries the INT whether
RF is set or clear, and advancing IP resumes at the next instruction.

One observed ptrace divergence remains separate: after rewriting IP at
the stop from raise(SIGSTOP), PTRACE_SINGLESTEP traps before the target
instruction on FRED, whereas IDT executes it. The selftest starts from
an INT3 stop to isolate rejected-INT behavior. The syscall-stop case is
a follow-up investigation outside this series.

Matthew Schwartz (2):
  x86/fred: Reconstruct the #GP context for rejected INT instructions
  selftests/x86: Check signal state for rejected software interrupts

 arch/x86/entry/entry_fred.c              |  11 +-
 tools/testing/selftests/x86/Makefile     |   2 +-
 tools/testing/selftests/x86/int_signal.c | 311 +++++++++++++++++++++++
 3 files changed, 322 insertions(+), 2 deletions(-)
 create mode 100644 tools/testing/selftests/x86/int_signal.c


base-commit: b5a051f6b840d48f159166ef073d3021989bfb50
-- 
2.55.0


Reply via email to