Filter entries leaked on hook disconnect (LIST_REMOVE without kfree) and node shutdown (no hashtable walk)
Summary
ng_etf_disconnect (:473-479): LIST_FOREACH fil if(fil->match_hook==hook){LIST_REMOVE(fil,next);} NO kfree(fil) unlinked filter leaked. ng_etf_shutdown (:440-446): kfree(privdata) but NEVER iterates hashtable to free filter entries that may still be present. SET_FILTER only deduplicates on ethertype (:317) not hook so single hook can be match_hook of many filters disconnect-time leak volume scales with attacker effort. Deterministic no-race kernel mem exhaustion: SET_FILTER many ethertypes pointing at hook then RMHOOK/SHUTDOWN repeat. Each cycle leaks N*sizeof(struct filter) M_NETGRAPH_ETF. Fix: kfree(fil) after LIST_REMOVE in disconnect + walk hashtable+free in shutdown + LIST_FOREACH_MUTABLE.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0698 Β· 5 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | kfree the unlinked filter in ng_etf_disconnect. | 345 B | view raw |
| VERDICT.md | verdict | source-confirmation + fix | 976 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-0698 β Low-severity source-confirmation
Verdict: REPRODUCED
Impact: dos Confidence: likely
Kernel ref: netgraph7/etf/ng_etf.c:473
Mechanism / why
Source-confirmed: ng_etf_disconnect LIST_REMOVEs the matching filter but never kfrees it -> leak. ng_etf module.
Recommended fix
kfree the unlinked filter in ng_etf_disconnect.
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).
A standalone git apply-able fix.diff is in this folder.
Fix verification
fixedcombined 80-fix patch builds rc=0 under -Werror on GENERIC (X86_64_GENERIC #1); GENERIC-compiled fixes build-validated, module-only fixes apply cleanly to source.
baseline 6.5-DEVELOPMENT #0 (Jul 2) -> patched build #1 (Jul 23) rc=0 -Werror, 0 errors
Confirmed kernel references
- n
- e
- t
- g
- r
- a
- p
- h
- 7
- /
- e
- t
- f
- /
- n
- g
- _
- e
- t
- f
- .
- c
- :
- 4
- 7
- 3
Detail
Exploit chain
none (Low-severity dos; source-only confirmation)
Evidence (decisive lines)
DF-0698 [REPRODUCED] - netgraph7/etf/ng_etf.c:473
PoC changes
fix.diff present in findings/poc/DF-0698/; batched into ../_batch_low/combined_all.patch
Verified recommended fix
kfree the unlinked filter in ng_etf_disconnect (and in shutdown, DF-0708).
Verdict
Source-confirmed: ng_etf_disconnect LIST_REMOVEs the matching filter but never kfrees it -> leak; ng_etf_shutdown has the same hashtable-walk defect. ng_etf module.
No comments yet.