Divide-by-zero in ad_attach/ad_describe via crafted IDENTIFY geometry (heads=0 or sectors=0)
Summary
ad_get_geometry L469-480: if(atavalid&ATA_FLAG_54_58 && current_heads && current_sectors) use current values; else branch L477-478 copies atadev->param.heads/sectors directly into adp->heads/sectors with no non-zero check. Malicious IDENTIFY with atavalid&ATA_FLAG_54_58==0 or current_heads/current_sectors==0 and heads==0 or sectors==0 -> adp->heads*adp->sectors==0. L147 info.d_ncylinders=adp->total_secs/(adp->heads*adp->sectors) -> integer divide-by-zero #DE -> kernel panic during device attach. Also L540 ad_describe bootverbose. Malicious SATA/IDE peripheral/emulated controller/USB-ATA bridge. Trigger: attach boot/hot-plug. Impact: unconditional panic DoS machine halts on every attempt to attach device. No info leak/code-exec/priv-esc. Fix: guard divisor if(heads&§ors) before L147 division.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-1883 Β· 4 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | git-apply-able fix for the cited bug | 530 B | view raw |
| VERDICT.md | verdict | source-confirmation analysis | 708 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 |
DF-1883 VERDICT
Verdict: REPRODUCED (source-confirmed)
Impact: Low (driver-level NULL deref / OOB / leak / DoS β hardware-gated)
Mechanism: ad_get_geometry L469-480: if(atavalid&ATA_FLAG_54_58 && current_heads && current_sectors) use current values; else branch L477-478 copies atadev->param.heads/sectors directly into adp->heads/sectors w
Citation: sys/dev/disk/nata/ata-disk.c:147-479
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
fixedfix.diff compiled in batch kernel build rc=0 -Werror
fix.diff compiled in batch kernel build rc=0 -Werror
Confirmed kernel references
β
Detail
Exploit chain
none (Low severity)
Evidence (decisive lines)
Source-confirmed: total_secs/(heads*sectors) div-by-zero via crafted IDENTIFY (ata-disk.c:147,477)
Verified recommended fix
Source-confirmed: total_secs/(heads*sectors) div-by-zero via crafted IDENTIFY (ata-disk.c:147,477)
Verdict
Source-confirmed: total_secs/(heads*sectors) div-by-zero via crafted IDENTIFY (ata-disk.c:147,477)
No comments yet.