DragonFlyBSD Kernel Audit
← triage · dashboard
DF-2491

Divide-by-zero panic in CHS-mode ata_tf_write from device-controlled geometry

Summary

In CHS sub-path of ata_tf_write cylinder/head/sector math does modulo and division by sectors and sectors*heads. Both values taken straight from device IDENTIFY data with no zero check. ata-disk.c guards with && current_heads && current_sectors but ata_tf_write does NOT. Malicious ATA device forcing CHS mode (invalid version_major or zero lba_size) reporting sectors=0 triggers integer divide-by-zero on first I/O panicking kernel. ATA_D_USE_CHS set when !ad_version(version_major)||!lbasize both device-controlled. CHS path reached via every non-ATAPI command including geom partition-table probe.

Discussion (0)

No comments yet.