Per-node ~1.5 MB kernel-memory amplification via fixed NG_NETFLOW_MAXIFACES array
Summary
LATENT: module cannot link (DF-0647). NG_NETFLOW_MAXIFACES=USHRT_MAX=65535 (ng_netflow.h:37). struct netflow embeds ifaces[65535] directly (:253) each ~28 bytes. Constructor kmalloc(sizeof(*priv),M_WAITOK|M_NULLOK|M_ZERO) :172 = single ~1.8MB allocation + full zeroing pass. No upper bound on netflow nodes -> privileged user (ngctl mkpeer) grows kernel heap without limit -> VM exhaustion/OOM/livelock. Would become live if netflow.c ported. Fix: lower NG_NETFLOW_MAXIFACES to realistic 64/256 or convert to dynamic sparse table.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0649 Β· 4 files| File | Type | Description | Size | |
|---|---|---|---|---|
| VERDICT.md | verdict | source-confirmation + fix | 992 B | β raw |
| ../_batch_low/fix_build.log | build-log | combined 80-fix kernel build (rc=0, -Werror) | 5.6 MB | β download |
| ../_batch_low/combined_all.patch | suggested-fix | all 80 fixes batched | 20.0 KB | view raw |
| ../_batch_low/env.txt | environment | guest uname + kern.version | 247 B | view raw |
DF-0649 β Low-severity source-confirmation
Verdict: INCONCLUSIVE
Impact: dos Confidence: likely
Kernel ref: netgraph7/netflow/ng_netflow.c:253
Mechanism / why
LATENT: module cannot link; struct netflow embeds ifaces[NG_NETFLOW_MAXIFTES=65535] directly -> multi-MB allocation. Source-confirmed in a non-linking module.
Recommended fix
Dynamically allocate/size ifaces instead of embedding 65535 entries.
Phase 8 (combined build)
All 80 Low-severity fixes were batched into one patch (../_batch_low/combined_all.patch) and applied to the in-guest /usr/src. A single make -j6 nativekernel KERNCONF=X86_64_GENERIC completed rc=0 with 0 errors under -Werror (../_batch_low/fix_build.log). The GENERIC-compiled fixes (net/radix, netinet, netinet6, wlan, wlan_ccmp, wlan_wep, altq, if_mib) are build-validated; module-only/netgraph/ipfw3/netsmb/vlan/sl/disc fixes apply cleanly to source (those subsystems are optional, not compiled into GENERIC).
Confirmed kernel references
- n
- e
- t
- g
- r
- a
- p
- h
- 7
- /
- n
- e
- t
- f
- l
- o
- w
- /
- n
- g
- _
- n
- e
- t
- f
- l
- o
- w
- .
- c
- :
- 2
- 5
- 3
Detail
Exploit chain
none (latent; source-confirmed)
Evidence (decisive lines)
DF-0649 [INCONCLUSIVE] - netgraph7/netflow/ng_netflow.c:253
PoC changes
fix.diff documented (fix in verdict) in findings/poc/DF-0649/; batched into ../_batch_low/combined_all.patch
Verified recommended fix
Dynamically allocate/size ifaces instead of embedding 65535 entries.
Verdict
LATENT: module cannot link; struct netflow embeds ifaces[NG_NETFLOW_MAXIFTES=65535] directly -> multi-MB allocation. Source-confirmed in a non-linking module.
No comments yet.