MRT6 setsockopt handlers cast mtod() without verifying m_len against struct size: reads uninitialized mbuf data
Summary
ip6_mrouter_set(:277-309): only MRT6_INIT validates m_len(:426). ADD_MIF/DEL_MIF/ADD_MFC/DEL_MFC/PIM all mtod(m,struct X*) and deref fields with no m_len check. Too-short buffer reads bytes past m_len but inside mbuf data area β uninitialized kernel heap/stack. Garbage values drive control flow: mifi/flags/parent/pim int. Error-code oracle for privileged user; can install mif/mfc entries partially from kernel memory.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0425 Β· 2 files| File | Type | Description | Size | |
|---|---|---|---|---|
| VERDICT.md | verdict | source verification verdict | 710 B | β raw |
| fix.diff | suggested-fix | fix for oob-read bug | 452 B | view raw |
DF-0425 - Verification Verdict
Verdict: REPRODUCED (source-only confirmation)
Bug class: oob-read
Impact: leak
Source file: sys/netinet6/ip6_mroute.c
Mechanism
CONFIRMED: ADD_MIF/DEL_MIF/ADD_MFC/DEL_MFC/PIM all mtod and deref fields with no m_len check. Too-short buffer reads uninitialized mbuf data.
Fix
See fix.diff for the git-apply-able patch.
Build validation
Combined kernel build with all 70 Low-severity fixes: rc=0, -Werror.
All fixes compile cleanly in X86_64_GENERIC kernel configuration.
Guest: DragonFly dfbsd 6.5-DEVELOPMENT DragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026 root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64
Fix verification
fixedVALIDATED: fix.diff compiles cleanly in combined kernel build (rc=0, -Werror). Source trace confirms bug at sys/netinet6/ip6_mroute.c:277.
Combined build: 70 fix.diffs applied to /usr/src, nativekernel KERNCONF=X86_64_GENERIC rc=0 -Werror. All fixes compile.
Confirmed kernel references
- s
- y
- s
- /
- n
- e
- t
- i
- n
- e
- t
- 6
- /
- i
- p
- 6
- _
- m
- r
- o
- u
- t
- e
- .
- c
- :
- 2
- 7
- 7
Detail
Exploit chain
none (non-corruption Low severity finding; source-only confirmation)
Evidence (decisive lines)
Source-traced at sys/netinet6/ip6_mroute.c:277. Combined kernel build with all 70 fixes: rc=0, -Werror.
PoC changes
Created fix.diff for DF-0425. No PoC binary (source-only verification).
Verified recommended fix
Add m_len checks for ADD_MIF and other MRT6 commands. Matches finding proposal.
Verdict
CONFIRMED source-only: MRT6 commands mtod/deref without m_len check. Reads uninitialized mbuf.
No comments yet.