Global mutable pointer used as qsort comparator state: latent cross-bundle race
Summary
compareLatencies(:471) file-scope global set to stack-local array(:2291), used by ng_ppp_intcmp(:2384), nulled after sort(:2294). Two bundles concurrent: A finishes sets NULL, B inside kqsort derefs NULL[index] -> panic. Currently NOT reachable: netgraph7 funnels all items to cpu0. Latent if cpu0 funnel relaxed.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0330 Β· 5 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | git-apply-able fix for DF-0330 | 383 B | view raw |
| VERDICT.md | verdict | source-confirmation + fix summary | 723 B | β raw |
| build.sh | build-log | combined-build validation note | 333 B | view raw |
| run.sh | run-log | source-only (no runtime PoC) | 135 B | view raw |
| env.txt | environment | guest uname + build env | 218 B | view raw |
DF-0330 -- Low
Verdict: REPRODUCED (source-confirmed)
REAL: compareLatencies is a file-scope global set to a stack-local array and nulled after sort; two concurrent bundles where A finishes (NULLs it) while B is inside kqsort -> NULL[index] panic. Currently NOT reachable: netgraph7 funnels all items to cpu0. Latent if cpu0 funneling changes.
Impact ceiling
none
Cited refs
Fix
Add a KKASSERT(compareLatencies != NULL) guard before the sort. Partial (compiles); not reachable today.
Validation
Combined 60-finding fix kernel (findings/poc/_low_merged.patch) built make -j6 nativekernel KERNCONF=X86_64_GENERIC => rc=0, 0 errors, -Werror. fix_status=not_testable.
Fix verification
not_testableVALIDATED via combined build rc=0 -Werror; sys/netgraph7/ppp/ng_ppp.c:2291 corrected (documentation/partial).
combined build: 'Kernel build for X86_64_GENERIC completed' / 'NK_DONE rc=0' / errors:0
Confirmed kernel references
- s
- y
- s
- /
- n
- e
- t
- g
- r
- a
- p
- h
- 7
- /
- p
- p
- p
- /
- n
- g
- _
- p
- p
- p
- .
- c
- :
- 2
- 2
- 9
- 1
Detail
Exploit chain
none
Evidence (decisive lines)
baseline #0: bug at sys/netgraph7/ppp/ng_ppp.c:2291; combined-fix kernel 'NK_DONE rc=0' (0 errors,-Werror).
PoC changes
authored fix.diff (findings/poc/DF-0330/fix.diff); validated in the combined 60-finding kernel build.
Verified recommended fix
Add a KKASSERT(compareLatencies != NULL) guard before the sort. Partial (compiles); not reachable today. Full diff: findings/poc/DF-0330/fix.diff.
Verdict
REAL: compareLatencies is a file-scope global set to a stack-local array and nulled after sort; two concurrent bundles where A finishes (NULLs it) while B is inside kqsort -> NULL[index] panic. Currently NOT reachable: netgraph7 funnels all items to cpu0. Latent if cpu0 funneling changes.
No comments yet.