2026-09-01 (PT_DETACH Timing & Signal 5 Elimination: Post-Detach Credential Drop) (D305)
Analyzed hardware test logs
(reports/hardware/injector-klog.txt and .klog
lines 105-116):
- Diagnosis of Game Exit on Signal 5:
registers set, resuming target...PT_DETACH ret=-1, PT_DETACH errno=32# process pid=329, payload.elf calls exit() exit_value=0.<6>pid 327 (eboot.bin), uid 1: exited on signal 5- Telemetry showed
PT_DETACHfailed witherrno=32(EPIPE/ error). - In FreeBSD, when a debugger process terminates without cleanly
detaching from a traced target, the kernel delivers
SIGTRAP(signal 5) to the traced child, causing the retail game to close and return to the home screen.
- Root Cause:
krw_restore_current_process()was executed beforeprocctl_detach(target_pid, 0).- Dropping the injector's elevated capabilities
(
authid=0x4800000000010003and full caps) turned the injector back into an unprivileged WebKit process before detaching, causingproc_can_ptrace()/p_candebug()to reject thePT_DETACHcall. - In addition,
PT_DETACHrequiresaddr = (void *)1per FreeBSDptrace(2)specification rather thanNULL.
- Remediation:
- Post-Detach Credential Restoration
(
src/injector/injector.c):procctl_detach()is now called while the injector remains fully elevated with root/system credentials.krw_restore_current_process()is called only afterPT_DETACHcompletes. - PT_DETACH Argument Conformance
(
src/injector/procctl.c): Updatedprocctl_detach()to pass(void *)1per FreeBSD specification. - Stack Alignment
(
src/injector/injector.c): Aligned hijackedRSPso(RSP % 16) == 8on function entry, satisfying the SysV AMD64 ABI and preventing vector instruction#GPalignment faults.
- Post-Detach Credential Restoration
(
Verified: make payload injector HARDWARE=1
(9,410,856 bytes) compiles 100% clean with zero warnings
and zero errors.