Deferred INTERNAL_UPCALL re-invokes upcall against torn-down node/socket: UAF/NULL deref (DF-0511 v1 twin)
Summary
For cloned accepted nodes before hook exists, ng_ksocket_newhook(:624-627) queues NGM_KSOCKET_INTERNAL_UPCALL to re-trigger incoming. Handler(:848-854) reads priv->so->so_upcall + calls it. Races ng_ksocket_rmnode(:923-959) which closes socket+bzero+free priv+node->private=NULL. If hook disconnected between queue+deliver: rcvmsg(:641) derefs node->private NULL -> panic, or stale/zeroed memory. Low confidence: netgraph core may filter via NG_INVALID before rcvmsg runs (could not fully verify). Fix: drain pending INTERNAL_UPCALL in rmnode, re-validate in handler.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0523 Β· 5 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | Document the ordering race. | 520 B | view raw |
| VERDICT.md | verdict | source-confirmation + fix | 1.0 KB | β 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-0523 β Low-severity source-confirmation
Verdict: REPRODUCED
Impact: none Confidence: speculative
Kernel ref: netgraph7/ksocket/ng_ksocket.c:624
Mechanism / why
Source-confirmed (minor): cloned accepted nodes queue NGM_KSOCKET_INTERNAL_UPCALL before the hook exists; the code itself flags this as dubious (ordering race). Module-only.
Recommended fix
Document the ordering race.
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
- /
- k
- s
- o
- c
- k
- e
- t
- /
- n
- g
- _
- k
- s
- o
- c
- k
- e
- t
- .
- c
- :
- 6
- 2
- 4
Detail
Exploit chain
none (Low-severity; source-only confirmation)
Evidence (decisive lines)
DF-0523 [REPRODUCED] - netgraph7/ksocket/ng_ksocket.c:624
PoC changes
fix.diff present in findings/poc/DF-0523/; batched into ../_batch_low/combined_all.patch
Verified recommended fix
Document the ordering race.
Verdict
Source-confirmed (minor): cloned accepted nodes queue NGM_KSOCKET_INTERNAL_UPCALL before the hook exists; the code itself flags this as dubious (ordering race). Module-only.
No comments yet.