Commit b323f6de authored by Oliver Neukum's avatar Oliver Neukum Committed by Ben Hutchings

USB: mct_u232: add sanity checking in probe

commit 4e9a0b05 upstream.

An attack using the lack of sanity checking in probe is known. This
patch checks for the existence of a second port.

CVE-2016-3136
Signed-off-by: default avatarOliver Neukum <ONeukum@suse.com>
[johan: add error message ]
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2: put the check in mct_u232_startup(), which already
 has a 'serial' variable]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 7836b6be
......@@ -443,6 +443,12 @@ static int mct_u232_startup(struct usb_serial *serial)
struct mct_u232_private *priv;
struct usb_serial_port *port, *rport;
/* check first to simplify error handling */
if (!serial->port[1] || !serial->port[1]->interrupt_in_urb) {
dev_err(&port->dev, "expected endpoint missing\n");
return -ENODEV;
}
priv = kzalloc(sizeof(struct mct_u232_private), GFP_KERNEL);
if (!priv)
return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment