2026-09-01 (hardware injector capture #10 analysis: credential decoupling & p_flag2 P2_NOTRACE/P2_PTRACEREQ clearing) (D297)
Analyzed hardware test logs
(reports/hardware/injector-klog.txt lines 367-385):
- P_TRACED Clearing Verified:
cleared target p_flag bits, new p_flag=0x10000000target p_flag=0x10000000(P_INMEM) confirmedP_TRACEDwas completely stripped fromp_flag.
- Root Cause Analysis of Persistent
errno=37(EALREADY):- Credential Identity Collision:
krw_swap_ucred()was previously settingmy_kproc->p_ucredandtd->td_ucredtotarget_ucred. Whensys_ptrace(PT_ATTACH)executed, the calling thread and the target process possessed the exact samestruct ucredpointer in kernel memory. The kernel/ACMGR interprets this as the target attempting to attach to itself or an already-active session, returningEALREADY(37). p_flag2Flags (struct proc + 0xB4): Directly followingp_flagat offset0xB4isp_flag2. On FreeBSD/Prospero:P2_NOTRACE(0x00000002): Explicitly forbidsptrace(2)attachment and coredumps.P2_NOTRACE_EXEC(0x00000004): Keeps no-trace across execve.P2_PTRACEREQ(0x00004000): Active ptrace request lock in progress.
- Credential Identity Collision:
- Remediation:
- Decouple Tracer and Target Credentials
(
src/injector/krw.c):krw_swap_ucred()no longer overwritesmy_kproc->p_ucredortd_ucredwithtarget_ucred. The injector retains its own elevated credentials (SYSTEM_AUTHID, all caps at0x60, root UID) while synchronizingcr_prisonif container IDs differ. - Clear
p_flag2Security Bits (src/injector/krw.c,src/injector/procctl.c): Mask0x00004006(P2_NOTRACE | P2_NOTRACE_EXEC | P2_PTRACEREQ) is now cleared onkproc + 0xB4for both the injector process and the target process, with telemetry and retry recovery.
- Decouple Tracer and Target Credentials
(
Verified: make payload injector HARDWARE=1
(9,410,720 bytes) compiles 100% clean with zero warnings
and zero errors.