aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorAlan Stern <[email protected]>2024-02-29 14:30:06 -0500
committerGreg Kroah-Hartman <[email protected]>2024-03-02 20:32:03 +0100
commit014bcf41d946b36a8f0b8e9b5d9529efbb822f49 (patch)
treef3a44e632cc99ce66358fcb04522a99eaa813b9f /tools/perf/scripts/python/export-to-postgresql.py
parent3c4a311c2c15ef0fa07c225ee02197a316e10e00 (diff)
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). Signed-off-by: Alan Stern <[email protected]> Reported-and-tested-by: [email protected] Link: https://lore.kernel.org/linux-usb/[email protected]/ Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: [email protected] Reviewed-by: PrasannaKumar Muralidharan <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions