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

OOB read in HDMI IRQ handler: afmt_status indexed before bounds check

Summary

evergreen_irq_process case 44 at evergreen.c:4803-4807: afmt_idx=src_data (28-bit from GPU DMA IH ring, 0..0xFFFFFFF). afmt_status[afmt_idx] read at :4804 BEFORE bounds check afmt_idx>5 at :4807. afmt_status is u32[6]. afmt_idx>5 reads OOB from rdev struct. For large values hits unmapped page -> kernel panic. Case 42 (HPD :4777) correctly checks bounds BEFORE indexing. Fix: move bounds check before array access.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1160 Β· 3 files
FileTypeDescriptionSize
VERDICT.md verdict Source-confirmation verdict for DF-1160 633 B ↓ raw
fix.diff suggested-fix Add afmt_idx<=5 bounds check before array access in HDMI IRQ 438 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-1160
↓ download raw

DF-1160 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: Add afmt_idx<=5 bounds check before array access in HDMI IRQ

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): evergreen_irq_process case 44 reads afmt_status[afmt_idx] BEFORE bounds check; afmt_idx is u32 from GPU DMA IH ring (0..0xFFFFFFF) indexing u32[6]. OOB read.

Verified recommended fix

REPRODUCED (source-only): evergreen_irq_process case 44 reads afmt_status[afmt_idx] BEFORE bounds check; afmt_idx is u32 from GPU DMA IH ring (0..0xFFFFFFF) indexing u32[6]. OOB read.

Verdict

REPRODUCED (source-only): evergreen_irq_process case 44 reads afmt_status[afmt_idx] BEFORE bounds check; afmt_idx is u32 from GPU DMA IH ring (0..0xFFFFFFF) indexing u32[6]. OOB read.