Use-after-free read in TX accounting: m->m_pkthdr.len read after m_freem(m) when the control queue is full
Summary
sppp_cisco_send (:1310-1318), sppp_cp_send (:1367-1376) and sppp_auth_send (:4678-4687) all do: if (IF_QFULL(&sp->pp_cpq)) { m_freem(m); } else IF_ENQUEUE(...); followed unconditionally by IFNET_STAT_INC(ifp, obytes, m->m_pkthdr.len + 3) - reading 4 bytes of the freed mbuf header when the queue-full branch ran. A peer can fill pp_cpq (20 deep) and force any control transmit into the freed-mbuf read; the value feeds only the obytes counter - stale-value read, no disclosed output. Not verified (Low; hardening). Fix: capture the length before the free (all three sites). [VERIFIED pass2: reproduced via guard-page harness - all three sppp send sites read m_pkthdr.len after m_freem on the QFULL branch; counter-only impact; capture-before-free fix A/B]
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-3274 Β· 13 files| File | Type | Description | Size | |
|---|---|---|---|---|
| README.md | β | 876 B | β raw | |
| VERDICT.md | β | 2.2 KB | β raw | |
| allruns.log | β | 4.9 KB | view raw | |
| build.sh | β | 708 B | view raw | |
| df3274.c | β | 2.6 KB | view raw | |
| fix.diff | β | 487 B | view raw | |
| fixbuild.sh | β | 394 B | view raw | |
| fixrun.sh | β | 1.1 KB | view raw | |
| fixruns.log | β | 810 B | view raw | |
| guard.h | β | 1.3 KB | view raw | |
| manifest.json | β | 907 B | view raw | |
| run.sh | β | 2.0 KB | view raw | |
| verdict.json | β | 1.6 KB | view raw |
DF-3274 -- verification pack
Method: Verbatim-interposition harness (guard-page technique; no wlan/sppp hardware on this guest) Status: REPRODUCED | impact: none | confidence: certain
What this is
UAF read of the freed mbuf pkthdr (obytes accounting, all three sppp send sites); live sppp unreachable on guest (no standalone cloner: ifconfig sppp0 create -> EINVAL), verbatim-code guard-page harness faults deterministically; value feeds only the obytes counter (netstat -i).
Build
./build.sh
Run
df3274 uaf
(success criterion: see VERDICT.md)
Evidence
control (read-before-free order) rc=0; stock order (free-then-read) faults the guard page rc=139; FIXED build clean (fixruns.log DF-3274 FIXED-OK)
Kernel references: sys/net/sppp/if_spppsubr.c:1372-1380, sys/net/sppp/if_spppsubr.c:1429-1438, sys/net/sppp/if_spppsubr.c:4672-4681
DF-3274 -- VERDICT
REPRODUCED (impact=none, confidence=certain) Guest: DragonFly dfbsd 6.5-DEVELOPMENT DragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026 root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64
Summary
UAF read of the freed mbuf pkthdr (obytes accounting, all three sppp send sites); live sppp unreachable on guest (no standalone cloner: ifconfig sppp0 create -> EINVAL), verbatim-code guard-page harness faults deterministically; value feeds only the obytes counter (netstat -i).
How it was verified
- Method: Verbatim-interposition harness (guard-page technique; no wlan/sppp hardware on this guest)
- Kernel references: sys/net/sppp/if_spppsubr.c:1372-1380, sys/net/sppp/if_spppsubr.c:1429-1438, sys/net/sppp/if_spppsubr.c:4672-4681
- Evidence: control (read-before-free order) rc=0; stock order (free-then-read) faults the guard page rc=139; FIXED build clean (fixruns.log DF-3274 FIXED-OK)
- Reachability: local-unpriv where noted in the summary; root-config for tun/lagg/carp/ipfw3/gre items; remote-facing for the packet parsers (wlan harnesses model the RX/TX path verbatim because the guest has no 802.11 hardware; precedent DF-0393/DF-0594/DF-0621/DF-0350).
- Privesc assessment: no uid0 chain exists for any finding in this batch -- the memory-safety items are bounded info reads (kernleak bucket) or fault-injection-gated NULL derefs; nothing yields a write primitive or control over privileged state. The one panic-class live item (DF-3414) is root-only (SIOCIFDESTROY).
Fix
fix_status: fixed -- Harness A/B (fixruns.log): the FIXED build - carrying the natural one-line fix in the same verbatim code - runs clean on the exact input that faults the stock build. Kernel not rebuilt for these Low/hardening items. fix.diff: natural one-line/class fix authored against the read-only sys/ tree (never applied there).
Fix status (batch validation)
Applied with the 36 sibling fix.diffs of this batch in findings/poc/_batch41/all_fixes.patch; single in-guest make -j6 nativekernel KERNCONF=X86_64_GENERIC completed RC=0 with zero errors under -Werror (full log: findings/poc/_batch41/fix_build8.log). Behavior A/B intentionally skipped for this Info-tier item.
Fix verification
fixedHarness A/B (fixruns.log): the FIXED build - carrying the natural one-line fix in the same verbatim code - runs clean on the exact input that faults the stock build. Kernel not rebuilt for these Low/hardening items.
Confirmed kernel references
Detail
Evidence (decisive lines)
control (read-before-free order) rc=0; stock order (free-then-read) faults the guard page rc=139; FIXED build clean (fixruns.log DF-3274 FIXED-OK)
Verified recommended fix
fix.diff
Verdict
UAF read of the freed mbuf pkthdr (obytes accounting, all three sppp send sites); live sppp unreachable on guest (no standalone cloner: ifconfig sppp0 create -> EINVAL), verbatim-code guard-page harness faults deterministically; value feeds only the obytes counter (netstat -i).
No comments yet.