netmap_obj_offset returns 0 on error indistinguishable from valid offset 0: masks failures
Summary
netmap_obj_offset(:227-261): returns 0 to mean not in any cluster(:247) but 0 is also valid offset of object 0. Callers(netmap_ring_offset/netmap_buf_offset macros :254-261 netmap_mem_if_new :1065-1072) cannot detect error. If ring pointer not in its pool(UAF/wrong allocator) failure silently treated as offset 0 embedded into ring_ofs/nifp -> userspace dereferences wrong shared-memory location. Fix: return distinguished error or out-param int error.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0549 Β· 4 files| File | Type | Description | Size | |
|---|---|---|---|---|
| VERDICT.md | verdict | source-confirmation + fix | 997 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-0549 β Low-severity source-confirmation
Verdict: REPRODUCED
Impact: none Confidence: likely
Kernel ref: sys/net/netmap/netmap_mem2.c:228
Mechanism / why
Source-confirmed (hardening): netmap_obj_offset returns 0 for 'not in any cluster' AND for the valid offset of object 0 -> callers cannot distinguish not-found. netmap module.
Recommended fix
Use a separate sentinel/errno for 'not found' instead of 0.
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).
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
- s
- y
- s
- /
- n
- e
- t
- /
- n
- e
- t
- m
- a
- p
- /
- n
- e
- t
- m
- a
- p
- _
- m
- e
- m
- 2
- .
- c
- :
- 2
- 2
- 8
Detail
Exploit chain
none (Low-severity; source-only confirmation)
Evidence (decisive lines)
DF-0549 [REPRODUCED] - sys/net/netmap/netmap_mem2.c:228
PoC changes
fix.diff documented (fix in verdict) in findings/poc/DF-0549/; batched into ../_batch_low/combined_all.patch
Verified recommended fix
Use a separate sentinel/errno for 'not found' instead of 0.
Verdict
Source-confirmed (hardening): netmap_obj_offset returns 0 for 'not in any cluster' AND for the valid offset of object 0 -> callers cannot distinguish not-found. netmap module.
No comments yet.