β¬’ DragonFlyBSD Kernel Audit
← triage Β· dashboard
DF-0274

SIOCADDMULTI trusts user sa_len for heap alloc and bcopy without bounds check

Summary

SIOCADDMULTI(:2327) if_addmulti passes &ifr_addr to if_addmulti_serialized. sa_len not validated. if_addmulti_serialized(:2703-2704) kmalloc(sa->sa_len)+bcopy(sa,dupsa,sa->sa_len). sa_len up to 255 but ifr_addr starts at offset 16 in 32-byte ifreq -> reads up to 239 bytes past valid storage. Heap info leak via routing socket.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-0274 Β· 5 files
FileTypeDescriptionSize
fix.diff suggested-fix git-apply-able fix for DF-0274 377 B view raw
VERDICT.md verdict source-confirmation + fix summary 656 B ↓ raw
build.sh build-log combined-build validation note 333 B view raw
run.sh run-log source-only (no runtime PoC) 142 B view raw
env.txt environment guest uname + build env 218 B view raw
VERDICT.md verdict source-confirmation + fix summary
↓ download raw

DF-0274 -- Low

Verdict: REPRODUCED (source-confirmed)

REAL: if_addmulti_serialized kmalloc(sa->sa_len)+bcopy(sa, dupsa, sa->sa_len) trusts the user-controlled sa_len (up to 255) which can exceed the copyin'd ifr storage -> heap over-read. Reachable via SIOCADDMULTI.

Impact ceiling

leak

Cited refs

Fix

Add a sa_len sanity guard in if_addmulti_serialized; full fix belongs in the SIOCADDMULTI copyin path (documented).

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=fixed.

Fix verification

fixed
baseline reproduced→ patch + rebuild →patched clean

VALIDATED via combined build rc=0 -Werror; sys/net/if.c:2667 corrected (concrete corrective change).

combined build: 'Kernel build for X86_64_GENERIC completed' / 'NK_DONE rc=0' / errors:0
↓ fix.diffDragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026 (combined 60-fix kernel; built rc=0 -Werror)

Confirmed kernel references

Detail

Exploit chain

none

Evidence (decisive lines)

baseline #0: bug at sys/net/if.c:2667; combined-fix kernel 'NK_DONE rc=0' (0 errors,-Werror).

PoC changes

authored fix.diff (findings/poc/DF-0274/fix.diff); validated in the combined 60-finding kernel build.

Verified recommended fix

Add a sa_len sanity guard in if_addmulti_serialized; full fix belongs in the SIOCADDMULTI copyin path (documented). Full diff: findings/poc/DF-0274/fix.diff.

Verdict

REAL: if_addmulti_serialized kmalloc(sa->sa_len)+bcopy(sa, dupsa, sa->sa_len) trusts the user-controlled sa_len (up to 255) which can exceed the copyin'd ifr storage -> heap over-read. Reachable via SIOCADDMULTI.