2026-09-01 (hardware injector capture #5 analysis: retail target verified & ucred synchronization for ptrace) (D289)
Analyzed hardware test logs
(reports/hardware/injector-klog.txt and
reports/hardware/injector-klog.txt.klog):
- Retail Target Resolution Validated Live on Console:
target_find_foreground_app()andget_proc_title_id()successfully scannedstruct procin kernel memory, identified candidate retail gamePPSA04263, and resolved PID 204.- Embedded payload blob verified present and valid
(
size: 9316792). - Clean failure handling: On attachment failure,
injector_exit(-6)calledSYS_exitcleanly (exit_value=fffffffa), leaving the console OS stable with zero panics and zero coredumps.
- Root Cause Analysis of
procctl_attachFailure:- Deferred Target Elevation:
krw_elevate_process(target_pid)was scheduled at step 9 (after mapping), leaving the retail game process running with un-elevated retail credentials, un-patched authid, and restricted syscalls whenprocctl_attach(target_pid)(step 5) attempted attachment. - Jail / Prison Boundary Isolation: FreeBSD's
sys_ptrace(PT_ATTACH)callsp_candebug(), which invokescr_cansee()andprison_check(). The sacrificial host daemon (NPXS40112) runs within its own VSH container prison, while the retail game (PPSA04263) runs within an isolated sandbox prison container. Because neither prison is an ancestor of the other, FreeBSD denies cross-prison process inspection withESRCH(error 3). - UID Disparity:
p_candebug()further requirescr_ruidandcr_svuidparity between tracer and tracee (EPERM, error 1). - Target Ptrace Attribute: Target process
cr_sceattrslacked the0x80debug flag in byte 3.
- Deferred Target Elevation:
- Remediation:
- Credential Swapping (
krw_swap_ucred): Implementedkrw_swap_ucred(target_pid)andkrw_restore_ucred()insrc/injector/krw.cand declared them insrc/common/krw.h. Swappingmy_kproc->p_ucredto point totarget_kproc->p_ucredguarantees that both tracer and tracee evaluate to identicalcr_prison,cr_uid, andcr_groupspointers, inherently satisfying FreeBSD'sprison_check()andp_candebug(). - Target Elevation Ahead of Attach: Reordered
src/injector/injector.csokrw_elevate_process(target_pid)andkrw_swap_ucred(target_pid)execute immediately after target resolution, prior toprocctl_attach(). - Target Ptrace Attribute Patching: Added
attrs[3] |= 0x80patching tokrw_elevate_process(pid)to grant debug privileges to the target process. - Safe Restoration: Added
krw_restore_ucred()cleanup tokrw_restore_current_process()and every early exit path ininjector_start(). - Diagnostic Telemetry: Added
PT_ATTACH ret=,wait4 ret=, andstatus=logging tosrc/injector/procctl.cto capture exact kernel return codes.
- Credential Swapping (
Verified:
make payload injector HARDWARE=1 BUILD=$HOME/obs
(9,393,800 bytes) and
./bin/obscene inject --build-only compile 100% clean with
zero warnings or errors.