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

Divide-by-zero in si_thermal_setup_fan_table from unvalidated BIOS fan-table temperatures

Summary

si_thermal_setup_fan_table at si_dpm.c:6489-6496: t_diff1=t_med-t_min and t_diff2=t_high-t_med from BIOS fan table used as divisors in slope1/slope2 with no zero guard. If t_med==t_min or t_high==t_med: integer divide-by-zero -> kernel #DE trap -> panic during DPM enable. Same class at si_calculate_sclk_params:5290 (/reference_divider*ss.rate) and si_populate_mclk_value:5390 (/ss.rate). Requires VBIOS with equal thermal breakpoints via VFIO romfile. Fix: guard divisors and degrade gracefully.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1129 Β· 3 files
FileTypeDescriptionSize
VERDICT.md verdict Source-confirmation verdict for DF-1129 619 B ↓ raw
fix.diff suggested-fix Guard zero divisors in si_thermal_setup_fan_table 485 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-1129
↓ download raw

DF-1129 Verification Verdict

Severity: Low Impact class: panic 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 zero divisors in si_thermal_setup_fan_table

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): si_thermal_setup_fan_table uses t_diff1=t_med-t_min and t_diff2=t_high-t_med as divisors in slope1/slope2 with no zero guard; if BIOS table has equal values -> #DE panic.

Verified recommended fix

REPRODUCED (source-only): si_thermal_setup_fan_table uses t_diff1=t_med-t_min and t_diff2=t_high-t_med as divisors in slope1/slope2 with no zero guard; if BIOS table has equal values -> #DE panic.

Verdict

REPRODUCED (source-only): si_thermal_setup_fan_table uses t_diff1=t_med-t_min and t_diff2=t_high-t_med as divisors in slope1/slope2 with no zero guard; if BIOS table has equal values -> #DE panic.