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

fiji VCE/ACP/UVD level population NULL-derefs when the PowerPlay table omits usMMDependencyTableOffset

Summary

The parser leaves mm_dep_table NULL when usMMDependencyTableOffset==0 (parse continues); fiji_populate_smc_vce/acp/uvd_level then dereference mm_table->count at attach/resume -> page fault panic. DF-1419/1550/1610 family. NULL-check fix.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-4006 Β· 8 files
FileTypeDescriptionSize
README.md β€” 1.5 KB ↓ raw
VERDICT.md β€” 1.3 KB ↓ raw
build.sh β€” 65 B view raw
run.sh β€” 89 B view raw
run.log β€” 3.8 KB view raw
env.txt β€” 493 B view raw
fix.diff β€” 7.7 KB view raw
trigger_analysis.c β€” 17.3 KB view raw

DF-4006 β€” fiji VCE/ACP/UVD level population NULL-derefs when the PowerPlay table omits usMMDependencyTableOffset

File: sys/dev/drm/amd/powerplay/smumgr/fiji_smumgr.c:1433 (VCE), :1472 (ACP), :1569 (UVD), :2374/:2407 (update paths) Class: NULL pointer dereference β†’ kernel panic (DoS) β€” DF-1419/1575 family Severity: Low Β· Confidence: certain (source) Β· runtime hardware-gated

Build / Run / Expected

Same demonstrator as DF-4001 (./build.sh && ./run.sh, section === DF-4006 ===):

child took signal 11 on mm_table->count β€” in-kernel equivalent: page fault on NULL+offset during fiji_init_smc_table (driver attach / resume) => panic

Source chain

process_pptables_v1_0.c:796 leaves pp_table_information->mm_dep_table = NULL when the VBIOS PowerPlay table has usMMDependencyTableOffset == 0 β€” the parser keeps result == 0 and continues (:800-801 gates only the Powertune table on result). Nothing between the parser and fiji_init_smc_table consumes or checks mm_dep_table (smu7 only uses sclk/mclk/pcie). Then fiji_populate_smc_vce_level:1433 does table->VceLevelCount = (uint8_t)(mm_table->count); on NULL β†’ page fault during pp_hwmgr init (device attach / resume) β€” a crafted-vBIOS boot-time/attach panic, same context class as DF-1419/DF-1550/DF-1610.

Fix

fix.diff (shared): NULL-check + clamp in all three populate functions (and the update paths keep the existing count>0 shape). Compile-validated via nativekernel rebuild (fix_build.log).

VERDICT.md
↓ download raw

VERDICT β€” DF-4006

Status: inconclusive at runtime (hardware-gated); source-certain.

Demonstrated (run.log, section DF-4006): a NULL mm_dep_table deref faults (child took signal 11 on mm_table->count). Source chain: process_pptables_v1_0.c:794-802 initializes pp_table_information->mm_dep_table = NULL and populates it only if (powerplay_table->usMMDependencyTableOffset != 0) without failing the parse; smu7_hwmgr never touches mm_dep_table, so the NULL survives to fiji_init_smc_table β†’ fiji_populate_smc_vce_level:1433 (table->VceLevelCount = (uint8_t)(mm_table->count)), and equivalently :1472 (ACP) / :1569 (UVD) / :2374 / :2407 (update paths). Result: page fault during pp_hwmgr init (attach/resume) from a crafted vBIOS with a zero MMDependencyTable offset β€” kernel panic; DF-1419/DF-1550/DF-1610 family. Privileged/physical context β†’ Low.

Fix: fix.diff adds NULL checks (+ the DF-4002 clamps) in the three populate functions; nativekernel rebuild OK (fix_build.log), reverted.

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

fixed
baseline no→ patch + rebuild →patched clean

fixed (compile-validated): both diffs applied to clean guest /usr/src (fiji_smumgr.c md5 800babd0..->d50bdc81.., i915_gem_execbuffer.c 334c7bd9..->dc882976..), make nativekernel KERNCONF=X86_64_GENERIC completed with error_count=0 under -Werror (fix_build.log); behavior additionally model-verified for DF-4007 (PATCHED run balanced). Runtime re-test impossible on this guest (no AMD/Intel GPU). Patch reverted after validation.

findings/poc/DF-4006/fix.diff; findings/poc/DF-4001/fix_build.log; findings/poc/DF-4007/run.log (PATCHED model run for DF-4007)
↓ fix.diffDragonFly dfbsd 6.5-DEVELOPMENT (nativekernel X86_64_GENERIC, patched, -Werror; see fix_build.log)

Confirmed kernel references

Detail

Exploit chain

crafted vBIOS with usMMDependencyTableOffset==0 -> attach/resume -> fiji_init_smc_table -> mm_table->count NULL deref -> kernel panic

Evidence (decisive lines)

run.log (DF-4006 section: child faults signal 11 on mm_table->count); VERDICT.md; fix_build.log; env.txt

PoC changes

Pass-2 reviewer authored demonstrator compiling the kernel's own smu73.h/smu73_discrete.h (packed) so sizeof/offsets are the kernel's; fix.diff generated mechanically against the pristine file and compile-validated via full nativekernel rebuild on the guest (shared build with DF-4001..DF-4007).

Verified recommended fix

NULL-check table_info->mm_dep_table before dereferencing in fiji_populate_smc_{vce,acp,uvd}_level (fix.diff)

Verdict

Source-certain NULL-deref: process_pptables_v1_0.c:794-802 leaves mm_dep_table NULL when usMMDependencyTableOffset==0 (parse continues, result stays 0; nothing else consumes it), and fiji_populate_smc_vce/acp/uvd_level dereference mm_table->count (fiji_smumgr.c:1433/1472/1569; also :2374/:2407) -> page fault during pp_hwmgr init (attach/resume) from a crafted vBIOS: kernel panic. Demonstrator: child process faults on the deref (signal 11). DF-1419/1550/1610 family; privileged/physical context -> Low. Hardware-gated: inconclusive at runtime, source-certain.