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

X_ipip_input reads viftable/last_encap_vif without mroute_token: race with vif teardown

Summary

X_ipip_input(:1709) remote IPIP packets: iterates viftable, mutates last_encap_vif cache, derefs v_ifp with NO token. del_vif/MRT_DONE bzero+reset under token. Race: remote IPIP during vif teardown -> NULL ifp deref or stale vif access. Requires active multicast routing.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

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

DF-0308 -- Low

Verdict: REPRODUCED (source-confirmed)

REAL: X_ipip_input iterates viftable/mutates last_encap_vif/derefs v_ifp with no token while del_vif/MRT_DONE bzero+reset under token; remote IPIP during vif teardown -> NULL/stale ifp deref. Requires active multicast routing.

Impact ceiling

none

Cited refs

Fix

Defensive: also reject when last_encap_vif->v_ifp == NULL (full fix needs the mrouter token around the lookup).

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/ip_mroute/ip_mroute.c:1748 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/ip_mroute/ip_mroute.c:1748; combined-fix kernel 'NK_DONE rc=0' (0 errors,-Werror).

PoC changes

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

Verified recommended fix

Defensive: also reject when last_encap_vif->v_ifp == NULL (full fix needs the mrouter token around the lookup). Full diff: findings/poc/DF-0308/fix.diff.

Verdict

REAL: X_ipip_input iterates viftable/mutates last_encap_vif/derefs v_ifp with no token while del_vif/MRT_DONE bzero+reset under token; remote IPIP during vif teardown -> NULL/stale ifp deref. Requires active multicast routing.