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

smu_helper: phm_get_lowest_enabled_level infinite-loops when mask==0

Summary

phm_get_lowest_enabled_level 520-527: uint32_t level=0; while(0==(mask&(1<<level))) level++; NO upper bound on level NO mask==0 check. level>=32 UB shift. Current callers smu7_hwmgr.c:2695/2705/2715 pre-check mask!=0. Latent if future caller omits check. Fix: if(mask==0) return 0.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1800 Β· 2 files
FileTypeDescriptionSize
fix.diff suggested-fix Add mask==0 early return. 335 B view raw
VERDICT.md verdict full analysis 1.1 KB ↓ raw
VERDICT.md verdict full analysis
↓ download raw

DF-1800 β€” 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/amd/powerplay/hwmgr/smu_helper.c:520-527.

Mechanism

phm_get_lowest_enabled_level while(mask&(1<=32 is UB shift. Callers pre-check but latent if future caller omits.

Fix

Add mask==0 early return.

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.

powerplay 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/amd/powerplay/hwmgr/smu_helper.c:520-527. Fix compiled clean.

PoC changes

authored fix.diff: add mask==0 early return

Verified recommended fix

Add mask==0 early return. Matches finding proposal.

Verdict

REPRODUCED (source-only). while(mask&(1<=32 UB shift. Callers pre-check but latent.