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

OOB read in em_rxeof when NIC reports desc_len=0 on error descriptor

Summary

em_rxeof at if_em.c:3692-3715: desc_len=le16toh(current_desc->length) from NIC DMA descriptor. Error branch at :3708 computes last_byte=*(mtod(mp,caddr_t)+desc_len-1) at :3715 with NO check that desc_len>0. desc_len=0 -> reads cluster_start-1, one byte before mbuf cluster allocation in jumbo MTU mode (m_adj skipped when max_frame_size>MCLBYTES-ETHER_ALIGN). Standard MTU: reads cluster[1] within ETHER_ALIGN padding, not a true OOB. 1-byte kernel heap read, no info-leak path demonstrated (value used only in TBI_ACCEPT macro). Requires jumbo MTU + physical-layer receive error with desc_len=0. Fix: if(desc_len==0) goto discard.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1188 Β· 3 files
FileTypeDescriptionSize
VERDICT.md verdict Source-confirmation verdict for DF-1188 617 B ↓ raw
fix.diff suggested-fix Guard desc_len==0 to prevent 1-byte OOB read 426 B view raw
../fix_build.log build-log Batch kernel build log (all fixes, rc=0) 5.6 MB ↓ download
VERDICT.md verdict Source-confirmation verdict for DF-1188
↓ download raw

DF-1188 Verification Verdict

Severity: Low Impact class: oob_read Verification method: Source-only confirmation (HW-gated, not triggerable on QEMU guest)

Verdict: REPRODUCED (source-confirmed)

The bug is confirmed in the audited source at the cited path:line. Triggerable but requires specific driver/config.

Fix: Guard desc_len==0 to prevent 1-byte OOB read

Fix applied and validated in batch kernel build (rc=0, -Werror).

Fix validation

All 41-fix patches batched into single make -j6 nativekernel KERNCONF=X86_64_GENERIC build. Build result: rc=0, 0 errors (full -Werror clean).

Fix verification

fixed
baseline reproduced→ patch + rebuild →patched clean

VALIDATED: fix.diff applies cleanly + batch kernel build rc=0 -Werror; bug HW/module/runtime-gated, no runtime PoC re-test possible on guest.

VALIDATED: fix.diff applies cleanly + batch kernel build rc=0 -Werror; bug HW/module/runtime-gated, no runtime PoC re-test possible on guest.
↓ fix.diffcombined build rc=0

Confirmed kernel references

β€”

Detail

Exploit chain

none

Evidence (decisive lines)

REPRODUCED (source-only): em_rxeof error branch computes last_byte=*(mtod(mp,caddr_t)+desc_len-1) without checking desc_len>0; desc_len=0 from NIC DMA -> byte read at offset -1.

Verified recommended fix

REPRODUCED (source-only): em_rxeof error branch computes last_byte=*(mtod(mp,caddr_t)+desc_len-1) without checking desc_len>0; desc_len=0 from NIC DMA -> byte read at offset -1.

Verdict

REPRODUCED (source-only): em_rxeof error branch computes last_byte=*(mtod(mp,caddr_t)+desc_len-1) without checking desc_len>0; desc_len=0 from NIC DMA -> byte read at offset -1.