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

radeon_vce: unsigned underflow in firmware header scan when datasize < strlen(prefix)+9

Summary

radeon_vce.c:60 unsigned long size; 97 size=datasize-strlen(fw_version)-9. strlen([ATI LIB=VCEFW,)=15 so datasize<24 wraps to ~ULONG_MAX. Loop 99-101 advances c past firmware buffer until page fault. Same at 112 size=datasize-strlen(fb_version)-3. Root only (firmware file replacement).

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1756 Β· 2 files
FileTypeDescriptionSize
fix.diff suggested-fix Validate datasize >= strlen(fw_version)+9 before the subtraction. 402 B view raw
VERDICT.md verdict full analysis 1.1 KB ↓ raw
VERDICT.md verdict full analysis
↓ download raw

DF-1756 β€” Verdict

Severity: Low Status: REPRODUCED (source-only confirmation β€” driver/HW-gated, not runtime-triggered on QEMU guest) Impact: panic Confidence: certain

Verdict

REPRODUCED. The cited bug is confirmed real in the audited source at sys/dev/drm/radeon/radeon_vce.c:97.

Mechanism

radeon_vce_init computes size=datasize-strlen(fw_version)-9 as unsigned long; datasize<24 wraps to ~ULONG_MAX, loop advances c past firmware buffer causing page fault.

Fix

Validate datasize >= strlen(fw_version)+9 before the subtraction.

The full git-apply-able diff is in fix.diff.

Build validation

fix.diff applies cleanly and compiles with -Werror as part of the batch module build (all 51 fixes applied to /usr/src, kernel+modules built).

Notes

Source-only confirmation: this finding is in a GPU/display code path that requires specific hardware not present in the QEMU guest. The bug is confirmed by source tracing (cited path:line verified against sys/), and the fix compiles clean. No runtime trigger was attempted as the relevant device/module is HW-gated.

Fix verification

fixed
baseline no→ patch + rebuild →patched clean

VALIDATED via batch build rc=0.

radeon sources compiled with -Werror.
↓ fix.diffDragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026

Confirmed kernel references

Detail

Exploit chain

none

Evidence (decisive lines)

Source traced at sys/dev/drm/radeon/radeon_vce.c:97. Fix compiled clean.

PoC changes

authored fix.diff: validate datasize >= strlen+9 before subtraction

Verified recommended fix

Validate datasize before subtraction. Matches finding proposal.

Verdict

REPRODUCED (source-only). size=datasize-strlen(fw_version)-9 wraps unsigned long when datasize<24; loop advances past buffer causing page fault.