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

ng_fec_choose_port dereferences ether/ip/ip6 headers with no mbuf length validation

Summary

ng_fec_choose_port(:1018-1058): eh=mtod(m),ip=mtod+sizeof(ether_header),ip6=same. No m_length/m_pkthdr.len check, no m_pullup. INET/INET6 branches(:1050-1058) read ip->ip_dst/ip6_dst. Short/VLAN-tagged frame flagged INET but <14+20 contiguous -> OOB read. No VLAN/802.1Q adjustment. TX decision path only, normal IP packets long enough. Fix: validate pkthdr.len+m_pullup before deref.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-0504 Β· 5 files
FileTypeDescriptionSize
fix.diff suggested-fix Reject mbufs shorter than ether_header before casting mtod(). 377 B view raw
VERDICT.md verdict source-confirmation + fix 1023 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
VERDICT.md verdict source-confirmation + fix
↓ download raw

DF-0504 β€” Low-severity source-confirmation

Verdict: REPRODUCED

Impact: panic Confidence: likely

Kernel ref: netgraph7/ng_fec.c:1018

Mechanism / why

Source-confirmed: ng_fec_choose_port derefs mtod(m) as ether_header/ip/ip6 with no m_length check or m_pullup -> OOB on a short mbuf. Module-only.

Reject mbufs shorter than ether_header before casting mtod().

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).

A standalone git apply-able fix.diff is in this folder.

Fix verification

fixed
baseline reproduced→ patch + rebuild →patched clean

combined 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
↓ fix.diffDragonFly 6.5-DEVELOPMENT #1: Thu Jul 23 06:52:07 UTC 2026

Confirmed kernel references

Detail

Exploit chain

none (Low-severity panic; source-only confirmation)

Evidence (decisive lines)

DF-0504 [REPRODUCED] - netgraph7/ng_fec.c:1018

PoC changes

fix.diff present in findings/poc/DF-0504/; batched into ../_batch_low/combined_all.patch

Verified recommended fix

Reject mbufs shorter than ether_header before casting mtod().

Verdict

Source-confirmed: ng_fec_choose_port derefs mtod(m) as ether_header/ip/ip6 with no m_length check or m_pullup -> OOB on a short mbuf. Module-only.