Skip to contentSkip to conversation

patch "USB: serial: mos7840: fix status-register error handling" added to usb-linus

PATCH [email protected] 1 participant 1 message Jul 6, 2018

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: mos7840: fix status-register error handling

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.

Quoted 1 line

From 794744abfffef8b1f3c0c8a4896177d6d13d653d Mon Sep 17 00:00:00 2001

From: Johan Hovold <[email protected]>
Date: Wed, 4 Jul 2018 17:02:17 +0200
Subject: USB: serial: mos7840: fix status-register error handling

Add missing transfer-length sanity check to the status-register completion handler to avoid leaking bits of uninitialised slab data to user space.

Fixes 3f5429746d91 ("USB: Moschip 7840 USB-Serial Driver")
Cc stable <[email protected]> # 2.6.19
---
 drivers/usb/serial/mos7840.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/serial/mos7840.c +3 -0
index fdceb46d9fc6..b580b4c7fa48 100644
@@ -468,6 +468,9 @@ static void mos7840_control_callback(struct urb *urb)
 	}
 
 	dev_dbg(dev, "%s urb buffer size is %d\n", __func__, urb->actual_length);
+	if (urb->actual_length < 1)
+		goto out;
+
 	dev_dbg(dev, "%s mos7840_port->MsrLsr is %d port %d\n", __func__,
 		mos7840_port->MsrLsr, mos7840_port->port_num);
 	data = urb->transfer_buffer;
Signature · 1 line
2.18.0