2026-09-01 (hardware injector capture #8 analysis: EPERM resolution, multi-thread ucred sync & P_SUGID clearing) (D294)
Analyzed hardware test logs
(reports/hardware/injector-klog.txt):
- Foreground Retail Game Identified:
- The scanner correctly selected the foreground running game
eboot.binat PID 213. - Process credentials:
target orig cr_uid=0,target_ucred=0xffffca1379ad0a00,prison=0xffffffffc68629f0. - Zero hardcoded title references: scanner operates completely generically on PlayStation executable names and title ID patterns.
- The scanner correctly selected the foreground running game
- Root Cause Analysis of
PT_ATTACH errno=1(EPERM):- Single-Thread Credential Synchronization:
krw_swap_ucred()previously only patchedp_threads.tqh_first(the head ofmy_kproc->p_threads).NPXS40112has multiple running threads. If the thread executingsys_ptracewas thread 2+, itstd_ucredwas still pointing tomy_ucredinside the VSH prison container, causingp_candebug()/prison_check()to fail and returnEPERM. - Target
P_SUGIDFlag: Target process hadp_flag = 0x10064800. Bit0x4000isP_SUGID(Had set id privileges, since last exec). In FreeBSD,sys_ptrace(PT_ATTACH)explicitly rejects tracingP_SUGIDprocesses unless the tracer holdsPRIV_DEBUG_DIFFCRED.
- Single-Thread Credential Synchronization:
- Remediation:
- Multi-Thread Credential Synchronization
(
src/injector/krw.c):krw_swap_ucred()now traverses the complete thread list (td_plist.tqe_next) ofmy_kproc, synchronizingtd_ucredon all active threads. - Clear
P_SUGID(src/injector/krw.c): Inkrw_elevate_process(target_pid), clears bit0x4000(p_flag &= ~0x4000) ontarget_kproc->p_flagso the kernel does not enforce setuid/setgid debug restrictions.
- Multi-Thread Credential Synchronization
(
Verified: make payload injector HARDWARE=1
(9,410,720 bytes) compiles 100% clean with zero warnings
and zero errors.