mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
usbtmc: more sanity checking for packet size
A malicious device can make the driver divide ny zero with a nonsense maximum packet size. Signed-off-by: Oliver Neukum <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
1 parent
3afa758cfb
commit
de7b9aa633
1 file changed
+3
@@ -2362,8 +2362,11 @@ static int usbtmc_probe(struct usb_interface *intf,
|
||||
goto err_put;
|
||||
}
|
||||
|
||||
retcode = -EINVAL;
|
||||
data->bulk_in = bulk_in->bEndpointAddress;
|
||||
data->wMaxPacketSize = usb_endpoint_maxp(bulk_in);
|
||||
if (!data->wMaxPacketSize)
|
||||
goto err_put;
|
||||
dev_dbg(&intf->dev, "Found bulk in endpoint at %u\n", data->bulk_in);
|
||||
|
||||
data->bulk_out = bulk_out->bEndpointAddress;
|
||||
|
||||
Reference in new issue
Block a user