USB: usb-storage: Prevent divide-by-0 error in isd200_ata_command
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · < 871fd7b10b56d280990b7e754f43d888382ca325| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
USB: usb-storage: Prevent divide-by-0 error in isd200_ata_command
The isd200 sub-driver in usb-storage uses the HEADS and SECTORS values in the ATA ID information to calculate cylinder and head values when creating a CDB for READ or WRITE commands. The calculation involves division and modulus operations, which will cause a crash if either of these values is 0. While this never happens with a genuine device, it could happen with a flawed or subversive emulation, as reported by the syzbot fuzzer.
Protect against this possibility by refusing to bind to the device if either the ATA_ID_HEADS or ATA_ID_SECTORS value in the device's ID information is 0. This requires isd200_Initialization() to return a negative error code when initialization fails; currently it always returns 0 (even when there is an error).
From the CVE record · Linux
The Linux kernel’s usb-storage isd200 sub-driver can divide by zero when an emulated USB device reports zero HEADS or SECTORS values in its ATA ID information. This can crash the kernel when the device is used for a READ or WRITE command. The input does not specify authentication requirements or whether user interaction is needed.
Engineers running Linux kernels with the usb-storage isd200 sub-driver should check their versions; affected versions are not specified.