Re: [PATCH] USB: usb-storage: Prevent divide-by-0 error in isd200_ata_command

From: Martin K. Petersen
Date: Thu Feb 29 2024 - 20:12:10 EST



Alan,

> 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.

Looks good to me.

Reviewed-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>

--
Martin K. Petersen Oracle Linux Engineering