mct_u232: sanity checking in probe
Subsystems (3)
PATCH 1/1 mct_u232: sanity checking in probe
An attack using the lack of sanity checking in probe is known. This patch checks for the existance of a second port.
CVE-2016-3136
--- drivers/usb/serial/mct_u232.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/serial/mct_u232.c +4 -0
@@ -378,6 +378,10 @@ static int mct_u232_port_probe(struct usb_serial_port *port) {struct mct_u232_private *priv; +/* check first to simplify error handling */ +if (!port->serial->port[1 ]) +return -ENODEV ; + priv =kzalloc (sizeof (*priv),GFP_KERNEL );if (!priv)return -ENOMEM ;
Signature · 1 line
2.1.4
Johan Hovold
maintainerQuoted 16 lines · Oliver Neukum
An attack using the lack of sanity checking in probe is known. This patch checks for the existance of a second port.
CVE-2016-3136Signed-off-by Oliver Neukum <[email protected]>--- drivers/usb/serial/mct_u232.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/usb/serial/mct_u232.c +0
-0
drivers/usb/serial/mct_u232.c static int mct_u232_port_probe(struct usb_serial_port *port) · line 384
Quoted 7 lines
drivers/usb/serial/mct_u232.c +4
-0@@ -378,6 +378,10 @@ static int mct_u232_port_probe(struct usb_serial_port *port) {struct mct_u232_private *priv; +/* check first to simplify error handling */ +if (!port->serial->port[1 ]) +return -ENODEV ; +
This check is not sufficient as the second port's interrupt-in urb is also unconditionally dereferenced below. Care to fix that up?
Ideally the existence of a second interrupt-in urb should have been verified already at interface probe. But we can clean that up later.
drivers/usb/serial/mct_u232.c static int mct_u232_port_probe(struct usb_serial_port *port) · line 387
Quoted 3 lines
drivers/usb/serial/mct_u232.c +0
-0priv =kzalloc (sizeof (*priv),GFP_KERNEL );if (!priv)return -ENOMEM ;
Thanks,
Johan