Skip to contentSkip to conversation

patch "usbtmc: more sanity checking for packet size" added to usb-linus

PATCH [email protected] 1 participant 1 message Aug 21, 2019

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

usbtmc: more sanity checking for packet size

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From de7b9aa633b693e77942e12f1769506efae6917b Mon Sep 17 00:00:00 2001
From: Oliver Neukum <[email protected]>
Date: Tue, 20 Aug 2019 11:28:25 +0200
Subject: usbtmc: more sanity checking for packet size

A malicious device can make the driver divide ny zero with a nonsense maximum packet size.

---
 drivers/usb/class/usbtmc.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/class/usbtmc.c +3 -0
index 4942122b2346..36858ddd8d9b 100644
@@ -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;
Signature · 1 line
2.23.0