From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:40508 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758864AbdAIKdK (ORCPT ); Mon, 9 Jan 2017 05:33:10 -0500 Subject: Patch "USB: serial: omninet: fix NULL-derefs at open and disconnect" has been added to the 4.9-stable tree To: johan@kernel.org, gregkh@linuxfoundation.org Cc: , From: Date: Mon, 09 Jan 2017 11:32:23 +0100 Message-ID: <148395794347225@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled USB: serial: omninet: fix NULL-derefs at open and disconnect to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: usb-serial-omninet-fix-null-derefs-at-open-and-disconnect.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From a5bc01949e3b19d8a23b5eabc6fc71bb50dc820e Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Tue, 3 Jan 2017 16:39:58 +0100 Subject: USB: serial: omninet: fix NULL-derefs at open and disconnect From: Johan Hovold commit a5bc01949e3b19d8a23b5eabc6fc71bb50dc820e upstream. Fix NULL-pointer dereferences at open() and disconnect() should the device lack the expected bulk-out endpoints: Unable to handle kernel NULL pointer dereference at virtual address 000000b4 ... [c0170ff0>] (__lock_acquire) from [] (lock_acquire+0x108/0x264) [] (lock_acquire) from [] (_raw_spin_lock_irqsave+0x58/0x6c) [] (_raw_spin_lock_irqsave) from [] (tty_port_tty_set+0x28/0xa4) [] (tty_port_tty_set) from [] (omninet_open+0x30/0x40 [omninet]) [] (omninet_open [omninet]) from [] (serial_port_activate+0x68/0x98 [usbserial]) Unable to handle kernel NULL pointer dereference at virtual address 00000234 ... [] (omninet_disconnect [omninet]) from [] (usb_serial_disconnect+0xe4/0x100 [usbserial]) Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/omninet.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/drivers/usb/serial/omninet.c +++ b/drivers/usb/serial/omninet.c @@ -38,6 +38,7 @@ static int omninet_write(struct tty_str const unsigned char *buf, int count); static int omninet_write_room(struct tty_struct *tty); static void omninet_disconnect(struct usb_serial *serial); +static int omninet_attach(struct usb_serial *serial); static int omninet_port_probe(struct usb_serial_port *port); static int omninet_port_remove(struct usb_serial_port *port); @@ -56,6 +57,7 @@ static struct usb_serial_driver zyxel_om .description = "ZyXEL - omni.net lcd plus usb", .id_table = id_table, .num_ports = 1, + .attach = omninet_attach, .port_probe = omninet_port_probe, .port_remove = omninet_port_remove, .open = omninet_open, @@ -104,6 +106,17 @@ struct omninet_data { __u8 od_outseq; /* Sequence number for bulk_out URBs */ }; +static int omninet_attach(struct usb_serial *serial) +{ + /* The second bulk-out endpoint is used for writing. */ + if (serial->num_bulk_out < 2) { + dev_err(&serial->interface->dev, "missing endpoints\n"); + return -ENODEV; + } + + return 0; +} + static int omninet_port_probe(struct usb_serial_port *port) { struct omninet_data *od; Patches currently in stable-queue which might be from johan@kernel.org are queue-4.9/usb-serial-io_ti-fix-i-o-after-disconnect.patch queue-4.9/usb-serial-ti_usb_3410_5052-fix-null-deref-at-open.patch queue-4.9/usb-serial-kobil_sct-fix-null-deref-in-write.patch queue-4.9/usb-serial-spcp8x5-fix-null-deref-at-open.patch queue-4.9/usb-serial-mos7720-fix-parallel-probe.patch queue-4.9/usb-serial-cyberjack-fix-null-deref-at-open.patch queue-4.9/usb-serial-mos7720-fix-null-deref-at-open.patch queue-4.9/usb-serial-garmin_gps-fix-memory-leak-on-failed-urb-submit.patch queue-4.9/usb-serial-io_ti-fix-null-deref-at-open.patch queue-4.9/usb-serial-pl2303-fix-null-deref-at-open.patch queue-4.9/usb-serial-quatech2-fix-sleep-while-atomic-in-close.patch queue-4.9/usb-serial-iuu_phoenix-fix-null-deref-at-open.patch queue-4.9/usb-serial-oti6858-fix-null-deref-at-open.patch queue-4.9/usb-serial-io_edgeport-fix-null-deref-at-open.patch queue-4.9/usb-serial-mos7720-fix-parport-use-after-free-on-probe-errors.patch queue-4.9/usb-serial-mos7720-fix-use-after-free-on-probe-errors.patch queue-4.9/usb-serial-mos7840-fix-null-deref-at-open.patch queue-4.9/usb-serial-omninet-fix-null-derefs-at-open-and-disconnect.patch queue-4.9/usb-serial-keyspan_pda-verify-endpoints-at-probe.patch queue-4.9/usb-serial-io_ti-fix-another-null-deref-at-open.patch