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

parse_sdvo_panel_data: unchecked BDB_SDVO_LVDS_OPTIONS panel_type (u8, 0-255) indexes BDB_SDVO_PANEL_DTDS -> OOB read up to ~4.6 KB past the block

Summary

index taken verbatim from sdvo_lvds_options->panel_type with no >0xf check - unlike the sibling parse_lfp_panel_data which got exactly that check - then fill_detail_timing_data reads 18 bytes at dvo_timing+index; find_section only guarantees the block fits in bdb, so index 255 reads +4590..4608 past the block and past the exact-size kmemdup'd firmware-VBT heap buffer or across the opregion/ROM mapping. HARNESS-REPRODUCED on the guest (verbatim parse code, guard-page SIGSEGV at exactly +4590, stable 3/3; -p fix run exits 0). Mirror-the-guard fix.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-4121 Β· 12 files
FileTypeDescriptionSize
README.md β€” 1.5 KB ↓ raw
VERDICT.md β€” 3.2 KB ↓ raw
build.log β€” 1.7 KB view raw
build.sh β€” 94 B view raw
env.txt β€” 390 B view raw
fix.diff β€” 690 B view raw
fix_run.log β€” 448 B view raw
run.2.log β€” 633 B view raw
run.3.log β€” 633 B view raw
run.log β€” 633 B view raw
run.sh β€” 127 B view raw
vbt_oob_harness.c β€” 19.6 KB view raw

DF-4121 β€” parse_sdvo_panel_data: unchecked VBT SDVO panel_type (0-255) indexes BDB_SDVO_PANEL_DTDS -> OOB read up to ~4.6 KB past the block

  • File: sys/dev/drm/i915/intel_bios.c
  • Lines: 363-381 Severity: Medium Confidence: certain
  • Status: reproduced (impact: leak) β€” hardware-gated crafted-VBIOS/firmware threat model; harness-reproduced on the DragonFly guest.

Summary

intel_bios.c:363-381: parse_sdvo_panel_data() takes index from BDB_SDVO_LVDS_OPTIONS->panel_type (u8, 0..255) β€” or from the root-only module param β€” with NO bounds check, unlike its sibling parse_lfp_panel_data() (intel_bios.c:229 rejects panel_type > 0xf). fill_detail_timing_data() then reads sizeof(struct lvds_dvo_timing)=18 bytes at dvo_timing + index (intel_bios.c:381): offset 25518=4590..4608 past the BDB_SDVO_PANEL_DTDS data pointer. find_section() only guarantees the block* fits inside bdb_size; the DTDS block may legally be 1 DTD (18 bytes) or even 0 bytes, so the read runs up to ~4.6 KB past the end of the bdb β€” i.e. past the end of the kmemdup'd i915_vbt_firmware heap buffer, or across the opregion/PCI-ROM mapping. The parsed values become dev_priv->vbt.sdvo_lvds_vbt_mode (a display mode later merged into connector mode lists / debugfs).

Reproduce (harness)

./build.sh && ./run.sh β€” exit 77 = OOB/div0 confirmed by verbatim kernel code; -p run = proposed fix, exit 0.

Guest: DragonFly dfbsd 6.5-DEVELOPMENT DragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026 root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64

VERDICT.md
↓ download raw

DF-4121 verdict β€” parse_sdvo_panel_data: unchecked VBT SDVO panel_type (0-255) indexes BDB_SDVO_PANEL_DTDS -> OOB read up to ~4.6 KB past the block

Reproduced? β€” reproduced (leak)

Harness-reproduced on the DragonFly guest: a 97-byte crafted VBT that passes intel_bios_is_valid_vbt() verbatim, with BDB_SDVO_LVDS_OPTIONS.panel_type=255 and an 18-byte BDB_SDVO_PANEL_DTDS as the last block, drives the verbatim parse_sdvo_panel_data indexing into a PROT_NONE guard page β€” SIGSEGV at dvo_timing+4590 (run.log: offset +4673 from buffer base, exit 77, stable across 3 runs). Hardware-gated on real i915 (VBT comes from firmware/opROM/ROM per the crafted-VBIOS threat model); the primitive is an out-of-bounds read whose values are stored as the SDVO panel mode.

Root cause (path:line)

intel_bios.c:363-381: parse_sdvo_panel_data() takes index from BDB_SDVO_LVDS_OPTIONS->panel_type (u8, 0..255) β€” or from the root-only module param β€” with NO bounds check, unlike its sibling parse_lfp_panel_data() (intel_bios.c:229 rejects panel_type > 0xf). fill_detail_timing_data() then reads sizeof(struct lvds_dvo_timing)=18 bytes at dvo_timing + index (intel_bios.c:381): offset 25518=4590..4608 past the BDB_SDVO_PANEL_DTDS data pointer. find_section() only guarantees the block* fits inside bdb_size; the DTDS block may legally be 1 DTD (18 bytes) or even 0 bytes, so the read runs up to ~4.6 KB past the end of the bdb β€” i.e. past the end of the kmemdup'd i915_vbt_firmware heap buffer, or across the opregion/PCI-ROM mapping. The parsed values become dev_priv->vbt.sdvo_lvds_vbt_mode (a display mode later merged into connector mode lists / debugfs).

Chain

crafted VBT (opregion RVDA / mailbox-4 / PCI ROM / i915_vbt_firmware) -> intel_bios_init -> parse_sdvo_panel_data -> fill_detail_timing_data(dvo_timing+255) -> OOB read up to +4608 past block

Kernel refs

Fix

Guard added after acquiring index from either source (VBT or module param), mirroring parse_lfp_panel_data:229. Harness -p mode implements exactly this check and rejects panel_type 255 without any DTD read (fix_run.log).

fix.diff applies cleanly against the read-only sys/ tree (2-file for DF-4125; note the radeon_pm.c hunk also needs dpm_failed_unlock: mutex_unlock(&rdev->pm.mutex); added to the existing dpm_failed label path β€” spelled out here since the label does not exist in the unfixed tree). Kernel-level fix validation is not possible on this guest (no i915/RV6xx devices; the drivers never attach in QEMU); harness-level fix validation IS included: the -p runs exercise the patched parse logic against the identical crafted input and exit 0 (fix_run.log).

Fix status (batch validation)

Applied with the 36 sibling fix.diffs of this batch in findings/poc/_batch41/all_fixes.patch; single in-guest make -j6 nativekernel KERNCONF=X86_64_GENERIC completed RC=0 with zero errors under -Werror (full log: findings/poc/_batch41/fix_build8.log). Behavior A/B intentionally skipped for this Info-tier item.

Fix verification

inconclusive
baseline reproduced→ patch + rebuild →patched clean

harness-level: the -p runs apply the proposed guard to the same verbatim code and the crafted input is rejected without OOB/div0 (fix_run.log exit 0 vs run.log exit 77); kernel-level build/boot validation impossible on this guest (no i915/RV6xx hardware)

fix_run.log + fix.diff
↓ fix.diffDragonFly dfbsd 6.5-DEVELOPMENT DragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026 root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64

Confirmed kernel references

Detail

Exploit chain

crafted VBT (opregion RVDA / mailbox-4 / PCI ROM / i915_vbt_firmware) -> intel_bios_init -> parse_sdvo_panel_data -> fill_detail_timing_data(dvo_timing+255) -> OOB read up to +4608 past block

Evidence (decisive lines)

run.log (SIGSEGV at +4590 past DTDS data, exit 77), run.2.log/run.3.log (stable), fix_run.log (patched: panel_type>0xf rejected, exit 0), vbt_oob_harness.c (verbatim kernel code)

PoC changes

Source-faithful userland harness (verbatim kernel parse code); guard-page buffers stand in for the kernel heap/mappings; volatile inputs defeat constant folding of the division (gcc folds literal 0/0).

Verified recommended fix

Guard added after acquiring index from either source (VBT or module param), mirroring parse_lfp_panel_data:229.

Verdict

Harness-reproduced on the DragonFly guest: a 97-byte crafted VBT that passes intel_bios_is_valid_vbt() verbatim, with BDB_SDVO_LVDS_OPTIONS.panel_type=255 and an 18-byte BDB_SDVO_PANEL_DTDS as the last block, drives the verbatim parse_sdvo_panel_data indexing into a PROT_NONE guard page β€” SIGSEGV at dvo_timing+4590 (run.log: offset +4673 from buffer base, exit 77, stable across 3 runs). Hardware-gated on real i915 (VBT comes from firmware/opROM/ROM per the crafted-VBIOS threat model); the primitive is an out-of-bounds read whose values are stored as the SDVO panel mode.