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

Missing goto out after ME/RLC firmware size checks allows malformed firmware use and kernel heap OOB read

Summary

r600_init_microcode at :2559-2563: ME firmware size mismatch sets err=-EINVAL but NO goto out. Subsequent RLC request_firmware overwrites err to 0. Same for RLC check :2569-2573 (SMC overwrites). Function returns 0 with truncated ME/RLC firmware attached. r600_cp_load_microcode/r600_rlc_resume iterate fixed compile-time loop count over too-small firmware buffer -> OOB heap read. PFP check at :2552 correctly has goto out; ME/RLC are copy-paste errors. Fix: add goto out after err=-EINVAL in ME and RLC checks.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1195 Β· 3 files
FileTypeDescriptionSize
VERDICT.md verdict Source-confirmation verdict for DF-1195 628 B ↓ raw
fix.diff suggested-fix Add goto out after ME/RLC firmware size mismatch checks 1.0 KB 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-1195
↓ download raw

DF-1195 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 goto out after ME/RLC firmware size mismatch checks

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): r600_init_microcode firmware-size mismatch sets err=-EINVAL but NO goto out; subsequent request_firmware overwrites err to 0; function returns 0 with mismatched firmware.

Verified recommended fix

REPRODUCED (source-only): r600_init_microcode firmware-size mismatch sets err=-EINVAL but NO goto out; subsequent request_firmware overwrites err to 0; function returns 0 with mismatched firmware.

Verdict

REPRODUCED (source-only): r600_init_microcode firmware-size mismatch sets err=-EINVAL but NO goto out; subsequent request_firmware overwrites err to 0; function returns 0 with mismatched firmware.