SET_FILTER ENOMEM path leaks the inbound ng_mesg (return bypasses epilogue)
Summary
ng_etf_rcvmsg SET_FILTER (:327-331): fil=kmalloc(sizeof(*fil),M_NETGRAPH_ETF,M_NOWAIT|M_ZERO) if(fil==NULL){return(ENOMEM);} bare return bypasses epilogue :351-354 NG_RESPOND_MSG+NG_FREE_MSG(msg). Every other error branch uses error=...;break; pattern. Caller (CALL_MSG_HANDLER ng_base.c:2062) does NOT free msg on non-zero return per handler contract ("Always free the message"). M_NOWAIT reachable under memory pressure. Each failed SET_FILTER leaks sizeof(ng_mesg)+sizeof(ng_etffilter) ~80+B M_NETGRAPH. Attacker: ng_socket access drive memory pressure then stream SET_FILTER messages. Deterministic kernel mem exhaustion DoS. Fix: error=ENOMEM;break;.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0697 Β· 5 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | Use 'goto out'/ERROUT instead of a bare return. | 499 B | view raw |
| VERDICT.md | verdict | source-confirmation + fix | 1012 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-0697 β Low-severity source-confirmation
Verdict: REPRODUCED
Impact: dos Confidence: likely
Kernel ref: netgraph7/etf/ng_etf.c:327
Mechanism / why
Source-confirmed: ng_etf_rcvmsg SET_FILTER on kmalloc failure does a bare return(ENOMEM) bypassing the epilogue -> lock not released. ng_etf module.
Recommended fix
Use 'goto out'/ERROUT instead of a bare return.
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
- :
- 3
- 2
- 7
Detail
Exploit chain
none (Low-severity dos; source-only confirmation)
Evidence (decisive lines)
DF-0697 [REPRODUCED] - netgraph7/etf/ng_etf.c:327
PoC changes
fix.diff present in findings/poc/DF-0697/; batched into ../_batch_low/combined_all.patch
Verified recommended fix
Use 'goto out'/ERROUT instead of a bare return.
Verdict
Source-confirmed: ng_etf_rcvmsg SET_FILTER on kmalloc failure does a bare return(ENOMEM) bypassing the epilogue -> lock not released. ng_etf module.
No comments yet.