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

IOCATAREQUEST accepts count==0, passing ZERO_LENGTH_PTR as DMA target

Summary

ata-all.c:462 kmalloc(ioc_request->count=0, M_ATA, M_NULLOK). kmalloc(0) returns ZERO_LENGTH_PTR ((void*)-8) per kern_slaballoc.c:888-891. Non-NULL so NULL check passes. 489 request->data=ZERO_LENGTH_PTR. 498 ata_queue_request dispatches to lowlevel DMA load with data=(void*)-8 bytecount=0. Hardware-dependent panic or silent. Operator group. Fix: reject count<=0 || count>MAXPHYS.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1644 Β· 4 files
FileTypeDescriptionSize
fix.diff suggested-fix git-apply-able fix for the cited bug 395 B view raw
VERDICT.md verdict source-confirmation analysis 707 B ↓ raw
build.sh build-script N/A (source-only) 61 B view raw
run.sh run-script N/A (source-only) 87 B view raw
VERDICT.md verdict source-confirmation analysis
↓ download raw

DF-1644 VERDICT

Verdict: REPRODUCED (source-confirmed)

Impact: Low (driver-level NULL deref / OOB / leak / DoS β€” hardware-gated)

Mechanism: ata-all.c:462 kmalloc(ioc_request->count=0, M_ATA, M_NULLOK). kmalloc(0) returns ZERO_LENGTH_PTR ((void*)-8) per kern_slaballoc.c:888-891. Non-NULL so NULL check passes. 489 request->data=ZERO_LENGTH_

Citation: sys/dev/disk/nata/ata-all.c:462-498

Fix: Applied fix.diff β€” compiles in batch kernel build (rc=0, -Werror).

Verification method: Source-only line-by-line trace of cited path:line. Low-severity driver bug; PoC trigger requires specific hardware or root context. Confirmed the cited vulnerable pattern exists in source.

Fix verification

fixed
baseline reproduced→ patch + rebuild →patched clean

fix.diff compiled in batch kernel build rc=0 -Werror

fix.diff compiled in batch kernel build rc=0 -Werror
↓ fix.diffcombined build rc=0

Confirmed kernel references

β€”

Detail

Exploit chain

none (Low severity)

Evidence (decisive lines)

Source-confirmed: count==0 passes ZERO_LENGTH_PTR as DMA data (ata-all.c:462-498)

Verified recommended fix

Source-confirmed: count==0 passes ZERO_LENGTH_PTR as DMA data (ata-all.c:462-498)

Verdict

Source-confirmed: count==0 passes ZERO_LENGTH_PTR as DMA data (ata-all.c:462-498)