From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:33908 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751282AbdBWU6I (ORCPT ); Thu, 23 Feb 2017 15:58:08 -0500 Subject: Patch "USB: serial: ftdi_sio: fix modem-status error handling" has been added to the 4.4-stable tree To: johan@kernel.org, gregkh@linuxfoundation.org Cc: , From: Date: Thu, 23 Feb 2017 21:56:44 +0100 Message-ID: <14878834046664@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: ftdi_sio: fix modem-status error handling to the 4.4-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-ftdi_sio-fix-modem-status-error-handling.patch and it can be found in the queue-4.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 427c3a95e3e29e65f59d99aaf320d7506f3eed57 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Thu, 12 Jan 2017 14:56:11 +0100 Subject: USB: serial: ftdi_sio: fix modem-status error handling From: Johan Hovold commit 427c3a95e3e29e65f59d99aaf320d7506f3eed57 upstream. Make sure to detect short responses when fetching the modem status in order to avoid parsing uninitialised buffer data and having bits of it leak to user space. Note that we still allow for short 1-byte responses. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -2433,8 +2433,12 @@ static int ftdi_get_modem_status(struct FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, 0, priv->interface, buf, len, WDR_TIMEOUT); - if (ret < 0) { + + /* NOTE: We allow short responses and handle that below. */ + if (ret < 1) { dev_err(&port->dev, "failed to get modem status: %d\n", ret); + if (ret >= 0) + ret = -EIO; ret = usb_translate_errors(ret); goto out; } Patches currently in stable-queue which might be from johan@kernel.org are queue-4.4/usb-serial-ftdi_sio-fix-modem-status-error-handling.patch queue-4.4/usb-serial-cp210x-add-new-ids-for-ge-bx50v3-boards.patch queue-4.4/usb-serial-ark3116-fix-register-accessor-error-handling.patch queue-4.4/usb-serial-digi_acceleport-fix-oob-data-sanity-check.patch queue-4.4/usb-serial-ftdi_sio-fix-line-status-over-reporting.patch queue-4.4/usb-serial-ftdi_sio-fix-extreme-low-latency-setting.patch queue-4.4/usb-serial-spcp8x5-fix-modem-status-handling.patch queue-4.4/usb-serial-opticon-fix-cts-retrieval-at-open.patch queue-4.4/usb-serial-mos7840-fix-another-null-deref-at-open.patch