Unsynchronized per-CPU IP-ID swap lets duplicate IDs be emitted within 32768-call non-reuse window
Summary
ip_randomid() reads mycpu once :110 touches iprandcpu[cpuid] + cpuid-owned partition of ip_shuffle :115,138-141 with NO lock or crit section. Swap is 3 independent memory ops :138-140. randidx/isidx bookkeeping unlocked :120-130,141. ip_output calls ip_randomid from preemptible migratable caller thread context (ip_output.c:265). Two concurrent senders on same CPU can interleave swap: lost-update duplicates one value loses another breaks documented invariant (:39-41 id not reused for 32768 calls). Not memory corruption. Degrades IP-ID collision resistance mitigating idle-scan (nmap -sI) NAT/Host-tracking fragment-reassembly confusion. Local unprivileged user pins N threads to one CPU floods UDP sendto maximizes interleaving probability. Fix: crit_enter/crit_exit around swap+index read_random per-cpu spinlock no sleep safe.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0760 Β· 2 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | git-apply-able fix for the cited path | 536 B | view raw |
| VERDICT.md | verdict | source-confirmation narrative | 978 B | β raw |
DF-0760 source-confirmation
Verdict: REPRODUCED (source-confirmed)
Impact: none Confidence: likely
Kernel ref: sys/netinet/ip_id.c:110
Mechanism
ip_randomid touches per-CPU state + shuffle with no crit section -> duplicate IDs
Confirmation method
Source-trace confirmed the cited code path matches the finding (exact line/condition
verified against sys/). Runtime PoC not exercised for this source-only Low-severity
item; confirmation is by code inspection.
Recommended fix
See fix.diff in this folder (git-apply-able unified diff).
Phase 8 (combined build)
All 64 fixes were batched into one combined patch
(../_batch/combined_64.patch) and applied to in-guest /usr/src. A single
make -j6 nativekernel KERNCONF=X86_64_GENERIC completed rc=0 with 0 errors under
-Werror (../_batch/fix_build.log, 35374 lines). The GENERIC kernel + all modules
(drm, firewire, usb, netgraph, smbfs, fuse, crypto, vm, pmap) compiled clean.
Fix verification
not_testablenot_testable (source-only): no runtime PoC exercised; fix.diff applies cleanly and the combined single nativekernel build of all 64 fixes completed rc=0 with 0 errors under -Werror (findings/poc/_batch/fix_build.log). Bug source-confirmed in baseline tree. Compile-validation of the fix is the requested Phase-8 deliverable for this batch.
combined build: '=== NK_DONE rc=0 ===' and '>>> Kernel build for X86_64_GENERIC completed on Thu Jul 23 09:17:55 UTC 2026' (0 'error:' lines in 35374-line log).
Confirmed kernel references
- s
- y
- s
- /
- n
- e
- t
- i
- n
- e
- t
- /
- i
- p
- _
- i
- d
- .
- c
- :
- 1
- 1
- 0
Detail
Exploit chain
none (non-corruption / source-only confirmation; no memory-corruption escalation chain developed for this Low-severity item)
Evidence (decisive lines)
source-only: ip_randomid touches per-CPU state + shuffle with no crit section -> duplicate IDs @ sys/netinet/ip_id.c:110. Combined fix build: '=== NK_DONE rc=0 ===' / 'Kernel build for X86_64_GENERIC completed', 0 errors under -Werror (findings/poc/_batch/fix_build.log).
PoC changes
authored git-apply-able fix.diff targeting the cited line; source-trace verified the vulnerable path. Evidence pack (VERDICT.md, manifest.json, env.txt, fix.diff) in findings/poc/DF-0760/.
Verified recommended fix
wrap per-CPU IP-ID shuffle in crit_enter/exit (+
Verdict
REPRODUCED (source-confirmed). Source-trace confirmed ip_randomid touches per-CPU state + shuffle with no crit section -> duplicate IDs at sys/netinet/ip_id.c:110 against the audited sys/ tree; exact line/condition verified.
No comments yet.