Skip to contentSkip to conversation

patch "USB: serial: whiteheat: fix potential slab corruption" added to usb-linus

PATCH [email protected] 1 participant 1 message Oct 30, 2019

Subsystems (3)
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

USB: serial: whiteheat: fix potential slab corruption

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 1251dab9e0a2c4d0d2d48370ba5baa095a5e8774 Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Tue, 29 Oct 2019 11:23:53 +0100
Subject: USB: serial: whiteheat: fix potential slab corruption

Fix a user-controlled slab buffer overflow due to a missing sanity check on the bulk-out transfer buffer used for control requests.

---
 drivers/usb/serial/whiteheat.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/serial/whiteheat.c +4 -0
index 79314d8c94a4..76cabcb30d21 100644
@@ -559,6 +559,10 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command,
 
 	command_port = port->serial->port[COMMAND_PORT];
 	command_info = usb_get_serial_port_data(command_port);
+
+	if (command_port->bulk_out_size < datasize + 1)
+		return -EIO;
+
 	mutex_lock(&command_info->mutex);
 	command_info->command_finished = false;
 
Signature · 1 line
2.23.0