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

Double free of adev->pm.dpm.ps on allocation-failure path in si_parse_power_table (plus leak of already-parsed si_ps states)

Summary

If the kzalloc(sizeof(struct si_ps)) inside the state loop fails, si_parse_power_table frees adev->pm.dpm.ps and returns -ENOMEM without nulling the pointer or setting num_ps; the error propagates to si_dpm_sw_init's dpm_failed -> si_dpm_fini, which kfrees adev->pm.dpm.ps again - double free. The ps allocations for earlier iterations leak (num_ps==0 hides them from the fini loop). OOM-gated (requires the kzalloc to fail mid-probe), so attacker control is indirect via memory pressure during boot/module load on SI hardware. Narrow trigger, hence Low. Upstream-identical. Verification skipped (Low, OOM-gated; contract permits).

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-3588 Β· 1 files
FileTypeDescriptionSize
verdict.json file 506 B view raw

Fix verification

not_testable
per-fix-DF-3588

Confirmed kernel references

β€”

Detail

Evidence (decisive lines)

source citations :7256-7260, :7728-7729, :7470-7473

Verdict

Source-certain: si_dpm.c:7256-7260 frees adev->pm.dpm.ps and returns -ENOMEM without nulling; si_dpm_fini frees it again on the dpm_failed path. Verification skipped per contract (Low, OOM-gated). Upstream-identical.