kern_ptrace permission checks dereference tracer (and pre-token target) ucred pointers with no crhold and no token β freed-cred read racing cratom_proc (DF-2868 analog in sys_process.c)
| Field | Value |
|---|---|
| ID | DF-2885 |
| Status | new |
| Severity | Low |
| CVSS 3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L |
| CWE | CWE-367 / CWE-416 (read) |
| File | sys/kern/sys_process.c |
| Lines | 153, 202-205 (siblings procfs_mem.c:190, procfs_regs.c:60) |
| Area | kern |
| Confidence | likely |
| Discovered | 2026-09-02 |
| Pass | 2 (GLM 5.3 second pass) |
| Bucket | memcorrupt |
| Reported | pending |
| Known CVE | none |
| CVE match | novel |
Summary
kern_ptrace() gates PT_ATTACH (and every op re-gated via CHECKIO/ p_trespass in procfs_domem/doregs/dofpregs/dodbregs) by reading bare p_ucred pointers with no reference taken. The tracer-side curp->p_ucred is never protected at all, and the target-side pointer is unprotected at the pre-token PRISON_CHECK. A sibling thread of the tracer executing any set*uid path replaces p_ucred under p_spin and immediately crfree()s the old credential, so the racing kern_ptrace thread dereferences freed M_CRED memory inside a privilege decision. Honest ceiling: the churner can only materialize creds carrying its own ruid, so a fully-unauthorized attach of a foreign-uid target is not constructible even when the race is won β the defect is the UAF read itself (garbage compares/panic risk) plus stale-cred TOCTOU. Same class as DF-2868 (ktrcanset) β this is the ptrace-path instance. Fix: crhold both creds around the whole permission switch (and the procfs siblings).
Timeline
- 2026-09-02 Discovered during pass-2 audit of sys_process.c (GLM 5.3).
No comments yet.