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

ips_ioctl_cmd ENOMEM error path feeds a failed bus_dmamem_alloc result into bus_dmamem_free β€” contigfree(NULL)/kfree(NULL) corrupts kernel_map or panics

Summary

The goto-exit on alloc failure unconditionally frees an allocation that never happened: map==NULL -> kfree(NULL) panic; map==(void*)-1 -> contigfree(NULL,4096) -> kmem_free(kernel_map,0,4096) resource-map corruption. Root-only device + needs a 4KB contigmalloc failure. Return-directly-after-tag-destroy fix. Same pattern at ips_commands.c:307/326 (routed).

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-5168 Β· 1 files
FileTypeDescriptionSize
verdict.json file 1.1 KB view raw

Fix verification

not_testable
baseline no→ patch + rebuild →patched clean
per-fix-DF-5168

Confirmed kernel references

Detail

Evidence (decisive lines)

static proof: busdma_machdep.c:481-539/553-565 + vm_contig.c:588-603 + kern_slaballoc.c:1406

Verified recommended fix

return ENOMEM directly after bus_dma_tag_destroy instead of goto exit

Verdict

untested (no ServeRAID IPS HBA on audit guest; Low + alloc-failure precondition)