From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qg0-f53.google.com ([209.85.192.53]:34855 "EHLO mail-qg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933471AbcCPOdo (ORCPT ); Wed, 16 Mar 2016 10:33:44 -0400 Date: Wed, 16 Mar 2016 10:34:28 -0400 From: Johan Hovold To: Oliver Neukum Cc: linux-usb@vger.kernel.org, johan@kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] mct_u232: sanity checking in probe Message-ID: <20160316143428.GA2546@localhost> References: <1458134613-22159-1-git-send-email-oneukum@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458134613-22159-1-git-send-email-oneukum@suse.com> Sender: stable-owner@vger.kernel.org List-ID: On Wed, Mar 16, 2016 at 02:23:33PM +0100, Oliver Neukum wrote: > 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 > > Signed-off-by: Oliver Neukum > CC: stable@vger.kernel.org > --- > drivers/usb/serial/mct_u232.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c > index fd707d6..d6a36b1 100644 > --- a/drivers/usb/serial/mct_u232.c > +++ b/drivers/usb/serial/mct_u232.c > @@ -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. > priv = kzalloc(sizeof(*priv), GFP_KERNEL); > if (!priv) > return -ENOMEM; Thanks, Johan