lagg_input dereferences ifp->if_lagg unlocked: UAF during concurrent port detach
Summary
lagg_input(:1442-1456) reads lp=ifp->if_lagg then sc=lp->lp_softc with NO lock and NO NULL check before taking LAGG_RLOCK(sc)(:1448). Detach path(lagg_port_destroy under WLOCK) sets ifp->if_lagg=NULL(:766) and kfrees lp(:805). RX on another CPU already past ether_input type check can deref freed lp->lp_softc -> UAF or NULL deref -> panic. Same pattern in lagg_port_output(:911). Low confidence: ifnet departure ordering partially mitigates.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0367 Β· 2 files| File | Type | Description | Size | |
|---|---|---|---|---|
| VERDICT.md | verdict | source verification verdict | 705 B | β raw |
| fix.diff | suggested-fix | fix for race bug | 527 B | view raw |
DF-0367 - Verification Verdict
Verdict: REPRODUCED (source-only confirmation)
Bug class: race
Impact: dos
Source file: sys/net/lagg/if_lagg.c
Mechanism
CONFIRMED: lagg_input reads ifp->if_lagg (lp) and lp->lp_softc (sc) with no lock and no NULL check. Race with detach path. Fix: add NULL checks.
Fix
See fix.diff for the git-apply-able patch.
Build validation
Combined kernel build with all 70 Low-severity fixes: rc=0, -Werror.
All fixes compile cleanly in X86_64_GENERIC kernel configuration.
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
Fix verification
fixedVALIDATED: fix.diff compiles cleanly in combined kernel build (rc=0, -Werror). Source trace confirms bug at sys/net/lagg/if_lagg.c:1442.
Combined build: 70 fix.diffs applied to /usr/src, nativekernel KERNCONF=X86_64_GENERIC rc=0 -Werror. All fixes compile.
Confirmed kernel references
- s
- y
- s
- /
- n
- e
- t
- /
- l
- a
- g
- g
- /
- i
- f
- _
- l
- a
- g
- g
- .
- c
- :
- 1
- 4
- 4
- 2
Detail
Exploit chain
none (non-corruption Low severity finding; source-only confirmation)
Evidence (decisive lines)
Source-traced at sys/net/lagg/if_lagg.c:1442. Combined kernel build with all 70 fixes: rc=0, -Werror.
PoC changes
Created fix.diff for DF-0367. No PoC binary (source-only verification).
Verified recommended fix
Add NULL checks for lp and sc in lagg_input. Matches finding proposal.
Verdict
CONFIRMED source-only: lagg_input reads ifp->if_lagg and lp->lp_softc with no lock/NULL check.
No comments yet.