VT_PROCESS scp->proc stored without refcount; signal_vt_rel/acq PHOLD can hit freed/reused proc struct (UAF / pid-recycling)
Summary
VT_SETMODE at syscons.c:1251: scp->proc=curproc with NO PHOLD. vt_proc_alive (:2994-3008) checks liveness via pfindn(scp->pid) which returns UN-referenced proc pointer. Between vt_proc_alive check and signal_vt_rel/acq PHOLD at :3021/:3044: proc can exit+reap+free, PHOLD writes p_lock in freed memory. Also pfindn can match recycled pid for different proc -> ksignal to unrelated victim. Requires SYSCAP_RESTRICTEDROOT (devices 0600 root:wheel). Fix: PHOLD at VT_SETMODE, PRELE at VT_AUTO/scclose/vt_proc_alive-clear.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-1201 Β· 3 files| File | Type | Description | Size | |
|---|---|---|---|---|
| VERDICT.md | verdict | Source-confirmation verdict for DF-1201 | 622 B | β raw |
| fix.diff | suggested-fix | PHOLD curproc when storing in scp->proc for VT_PROCESS | 450 B | view raw |
| ../fix_build.log | build-log | Batch kernel build log (all fixes, rc=0) | 5.6 MB | β download |
DF-1201 Verification Verdict
Severity: Low Impact class: uaf Verification method: Source-only confirmation (HW-gated, not triggerable on QEMU guest)
Verdict: REPRODUCED (source-confirmed)
The bug is confirmed in the audited source at the cited path:line. Triggerable but requires specific driver/config.
Fix: PHOLD curproc when storing in scp->proc for VT_PROCESS
Fix applied and validated in batch kernel build (rc=0, -Werror).
Fix validation
All 41-fix patches batched into single make -j6 nativekernel KERNCONF=X86_64_GENERIC build.
Build result: rc=0, 0 errors (full -Werror clean).
Fix verification
fixedVALIDATED: fix.diff applies cleanly + batch kernel build rc=0 -Werror; bug HW/module/runtime-gated, no runtime PoC re-test possible on guest.
VALIDATED: fix.diff applies cleanly + batch kernel build rc=0 -Werror; bug HW/module/runtime-gated, no runtime PoC re-test possible on guest.
Confirmed kernel references
β
Detail
Exploit chain
none
Evidence (decisive lines)
REPRODUCED (source-only): VT_SETMODE stores scp->proc=curproc with NO PHOLD; vt_proc_alive uses pfindn returning UN-referenced pointer; TOCTOU race vs proc exit.
Verified recommended fix
REPRODUCED (source-only): VT_SETMODE stores scp->proc=curproc with NO PHOLD; vt_proc_alive uses pfindn returning UN-referenced pointer; TOCTOU race vs proc exit.
Verdict
REPRODUCED (source-only): VT_SETMODE stores scp->proc=curproc with NO PHOLD; vt_proc_alive uses pfindn returning UN-referenced pointer; TOCTOU race vs proc exit.
No comments yet.