Patch "USB: serial: ark3116: fix register-accessor error handling" has been added to the 4.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    USB: serial: ark3116: fix register-accessor error handling

to the 4.10-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-ark3116-fix-register-accessor-error-handling.patch
and it can be found in the queue-4.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 9fef37d7cf170522fb354d6d0ea6de09b9b16678 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@xxxxxxxxxx>
Date: Thu, 12 Jan 2017 14:56:09 +0100
Subject: USB: serial: ark3116: fix register-accessor error handling

From: Johan Hovold <johan@xxxxxxxxxx>

commit 9fef37d7cf170522fb354d6d0ea6de09b9b16678 upstream.

The current implementation failed to detect short transfers, something
which could lead to bits of the uninitialised heap transfer buffer
leaking to user space.

Fixes: 149fc791a452 ("USB: ark3116: Setup some basic infrastructure for new ark3116 driver.")
Fixes: f4c1e8d597d1 ("USB: ark3116: Make existing functions 16450-aware and add close and release functions.")
Reviewed-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/usb/serial/ark3116.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -99,10 +99,17 @@ static int ark3116_read_reg(struct usb_s
 				 usb_rcvctrlpipe(serial->dev, 0),
 				 0xfe, 0xc0, 0, reg,
 				 buf, 1, ARK_TIMEOUT);
-	if (result < 0)
+	if (result < 1) {
+		dev_err(&serial->interface->dev,
+				"failed to read register %u: %d\n",
+				reg, result);
+		if (result >= 0)
+			result = -EIO;
+
 		return result;
-	else
-		return buf[0];
+	}
+
+	return buf[0];
 }
 
 static inline int calc_divisor(int bps)


Patches currently in stable-queue which might be from johan@xxxxxxxxxx are

queue-4.10/usb-serial-ftdi_sio-fix-modem-status-error-handling.patch
queue-4.10/usb-serial-cp210x-add-new-ids-for-ge-bx50v3-boards.patch
queue-4.10/usb-serial-ark3116-fix-register-accessor-error-handling.patch
queue-4.10/usb-serial-digi_acceleport-fix-oob-data-sanity-check.patch
queue-4.10/usb-serial-ftdi_sio-fix-line-status-over-reporting.patch
queue-4.10/usb-serial-ftdi_sio-fix-extreme-low-latency-setting.patch
queue-4.10/usb-serial-spcp8x5-fix-modem-status-handling.patch
queue-4.10/usb-serial-opticon-fix-cts-retrieval-at-open.patch
queue-4.10/usb-serial-mos7840-fix-another-null-deref-at-open.patch
queue-4.10/usb-serial-console-fix-uninitialised-spinlock.patch



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]