]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Mar 2019 19:47:08 +0000 (20:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Mar 2019 19:47:08 +0000 (20:47 +0100)
added patches:
serial-max310x-fix-to-avoid-potential-null-pointer-dereference.patch
tty-mxs-auart-fix-a-potential-null-pointer-dereference.patch
usb-serial-cp210x-add-new-device-id.patch
usb-serial-ftdi_sio-add-additional-novatech-products.patch
usb-serial-mos7720-fix-mos_parport-refcount-imbalance-on-error-path.patch

queue-3.18/serial-max310x-fix-to-avoid-potential-null-pointer-dereference.patch [new file with mode: 0644]
queue-3.18/series
queue-3.18/tty-mxs-auart-fix-a-potential-null-pointer-dereference.patch [new file with mode: 0644]
queue-3.18/usb-serial-cp210x-add-new-device-id.patch [new file with mode: 0644]
queue-3.18/usb-serial-ftdi_sio-add-additional-novatech-products.patch [new file with mode: 0644]
queue-3.18/usb-serial-mos7720-fix-mos_parport-refcount-imbalance-on-error-path.patch [new file with mode: 0644]

diff --git a/queue-3.18/serial-max310x-fix-to-avoid-potential-null-pointer-dereference.patch b/queue-3.18/serial-max310x-fix-to-avoid-potential-null-pointer-dereference.patch
new file mode 100644 (file)
index 0000000..07e753d
--- /dev/null
@@ -0,0 +1,31 @@
+From 3a10e3dd52e80b9a97a3346020024d17b2c272d6 Mon Sep 17 00:00:00 2001
+From: Aditya Pakki <pakki001@umn.edu>
+Date: Mon, 18 Mar 2019 18:44:14 -0500
+Subject: serial: max310x: Fix to avoid potential NULL pointer dereference
+
+From: Aditya Pakki <pakki001@umn.edu>
+
+commit 3a10e3dd52e80b9a97a3346020024d17b2c272d6 upstream.
+
+of_match_device can return a NULL pointer when matching device is not
+found. This patch avoids a scenario causing NULL pointer derefernce.
+
+Signed-off-by: Aditya Pakki <pakki001@umn.edu>
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/max310x.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/tty/serial/max310x.c
++++ b/drivers/tty/serial/max310x.c
+@@ -1321,6 +1321,8 @@ static int max310x_spi_probe(struct spi_
+       if (spi->dev.of_node) {
+               const struct of_device_id *of_id =
+                       of_match_device(max310x_dt_ids, &spi->dev);
++              if (!of_id)
++                      return -ENODEV;
+               devtype = (struct max310x_devtype *)of_id->data;
+       } else {
index 6b76ca934d065bc0479dd8fea5b361ca40b87de9..f3cd7315d7cf724b55194a52c024903362f96540 100644 (file)
@@ -37,3 +37,8 @@ mac8390-fix-mmio-access-size-probe.patch
 alsa-pcm-fix-possible-oob-access-in-pcm-oss-plugins.patch
 alsa-pcm-don-t-suspend-stream-in-unrecoverable-pcm-state.patch
 scsi-zfcp-fix-scsi_eh-host-reset-with-port_forced-erp-for-non-npiv-fcp-devices.patch
+tty-mxs-auart-fix-a-potential-null-pointer-dereference.patch
+serial-max310x-fix-to-avoid-potential-null-pointer-dereference.patch
+usb-serial-cp210x-add-new-device-id.patch
+usb-serial-ftdi_sio-add-additional-novatech-products.patch
+usb-serial-mos7720-fix-mos_parport-refcount-imbalance-on-error-path.patch
diff --git a/queue-3.18/tty-mxs-auart-fix-a-potential-null-pointer-dereference.patch b/queue-3.18/tty-mxs-auart-fix-a-potential-null-pointer-dereference.patch
new file mode 100644 (file)
index 0000000..1298ac8
--- /dev/null
@@ -0,0 +1,34 @@
+From 6734330654dac550f12e932996b868c6d0dcb421 Mon Sep 17 00:00:00 2001
+From: Kangjie Lu <kjlu@umn.edu>
+Date: Thu, 14 Mar 2019 02:21:51 -0500
+Subject: tty: mxs-auart: fix a potential NULL pointer dereference
+
+From: Kangjie Lu <kjlu@umn.edu>
+
+commit 6734330654dac550f12e932996b868c6d0dcb421 upstream.
+
+In case ioremap fails, the fix returns -ENOMEM to avoid NULL
+pointer dereferences.
+Multiple places use port.membase.
+
+Signed-off-by: Kangjie Lu <kjlu@umn.edu>
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/mxs-auart.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/tty/serial/mxs-auart.c
++++ b/drivers/tty/serial/mxs-auart.c
+@@ -1060,6 +1060,10 @@ static int mxs_auart_probe(struct platfo
+       s->port.mapbase = r->start;
+       s->port.membase = ioremap(r->start, resource_size(r));
++      if (!s->port.membase) {
++              ret = -ENOMEM;
++              goto out_disable_clks;
++      }
+       s->port.ops = &mxs_auart_ops;
+       s->port.iotype = UPIO_MEM;
+       s->port.fifosize = MXS_AUART_FIFO_SIZE;
diff --git a/queue-3.18/usb-serial-cp210x-add-new-device-id.patch b/queue-3.18/usb-serial-cp210x-add-new-device-id.patch
new file mode 100644 (file)
index 0000000..06877b5
--- /dev/null
@@ -0,0 +1,33 @@
+From a595ecdd5f60b2d93863cebb07eec7f935839b54 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Wed, 27 Mar 2019 10:11:14 +0900
+Subject: USB: serial: cp210x: add new device id
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit a595ecdd5f60b2d93863cebb07eec7f935839b54 upstream.
+
+Lorenz Messtechnik has a device that is controlled by the cp210x driver,
+so add the device id to the driver.  The device id was provided by
+Silicon-Labs for the devices from this vendor.
+
+Reported-by: Uli <t9cpu@web.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/cp210x.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -76,6 +76,7 @@ static const struct usb_device_id id_tab
+       { USB_DEVICE(0x10C4, 0x804E) }, /* Software Bisque Paramount ME build-in converter */
+       { USB_DEVICE(0x10C4, 0x8053) }, /* Enfora EDG1228 */
+       { USB_DEVICE(0x10C4, 0x8054) }, /* Enfora GSM2228 */
++      { USB_DEVICE(0x10C4, 0x8056) }, /* Lorenz Messtechnik devices */
+       { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */
+       { USB_DEVICE(0x10C4, 0x806F) }, /* IMS USB to RS422 Converter Cable */
+       { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */
diff --git a/queue-3.18/usb-serial-ftdi_sio-add-additional-novatech-products.patch b/queue-3.18/usb-serial-ftdi_sio-add-additional-novatech-products.patch
new file mode 100644 (file)
index 0000000..9aaa59c
--- /dev/null
@@ -0,0 +1,46 @@
+From 422c2537ba9d42320f8ab6573940269f87095320 Mon Sep 17 00:00:00 2001
+From: George McCollister <george.mccollister@gmail.com>
+Date: Tue, 5 Mar 2019 16:05:03 -0600
+Subject: USB: serial: ftdi_sio: add additional NovaTech products
+
+From: George McCollister <george.mccollister@gmail.com>
+
+commit 422c2537ba9d42320f8ab6573940269f87095320 upstream.
+
+Add PIDs for the NovaTech OrionLX+ and Orion I/O so they can be
+automatically detected.
+
+Signed-off-by: George McCollister <george.mccollister@gmail.com>
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/ftdi_sio.c     |    2 ++
+ drivers/usb/serial/ftdi_sio_ids.h |    4 +++-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/serial/ftdi_sio.c
++++ b/drivers/usb/serial/ftdi_sio.c
+@@ -604,6 +604,8 @@ static const struct usb_device_id id_tab
+               .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+       { USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLXM_PID),
+               .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
++      { USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLX_PLUS_PID) },
++      { USB_DEVICE(FTDI_VID, FTDI_NT_ORION_IO_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_SYNAPSE_SS200_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX2_PID) },
+--- a/drivers/usb/serial/ftdi_sio_ids.h
++++ b/drivers/usb/serial/ftdi_sio_ids.h
+@@ -566,7 +566,9 @@
+ /*
+  * NovaTech product ids (FTDI_VID)
+  */
+-#define FTDI_NT_ORIONLXM_PID  0x7c90  /* OrionLXm Substation Automation Platform */
++#define FTDI_NT_ORIONLXM_PID          0x7c90  /* OrionLXm Substation Automation Platform */
++#define FTDI_NT_ORIONLX_PLUS_PID      0x7c91  /* OrionLX+ Substation Automation Platform */
++#define FTDI_NT_ORION_IO_PID          0x7c92  /* Orion I/O */
+ /*
+  * Synapse Wireless product ids (FTDI_VID)
diff --git a/queue-3.18/usb-serial-mos7720-fix-mos_parport-refcount-imbalance-on-error-path.patch b/queue-3.18/usb-serial-mos7720-fix-mos_parport-refcount-imbalance-on-error-path.patch
new file mode 100644 (file)
index 0000000..ba7c426
--- /dev/null
@@ -0,0 +1,47 @@
+From 2908b076f5198d231de62713cb2b633a3a4b95ac Mon Sep 17 00:00:00 2001
+From: Lin Yi <teroincn@163.com>
+Date: Wed, 20 Mar 2019 19:04:56 +0800
+Subject: USB: serial: mos7720: fix mos_parport refcount imbalance on error path
+
+From: Lin Yi <teroincn@163.com>
+
+commit 2908b076f5198d231de62713cb2b633a3a4b95ac upstream.
+
+The write_parport_reg_nonblock() helper takes a reference to the struct
+mos_parport, but failed to release it in a couple of error paths after
+allocation failures, leading to a memory leak.
+
+Johan said that move the kref_get() and mos_parport assignment to the
+end of urbtrack initialisation is a better way, so move it. and
+mos_parport do not used until urbtrack initialisation.
+
+Signed-off-by: Lin Yi <teroincn@163.com>
+Fixes: b69578df7e98 ("USB: usbserial: mos7720: add support for parallel port on moschip 7715")
+Cc: stable <stable@vger.kernel.org>     # 2.6.35
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/mos7720.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/serial/mos7720.c
++++ b/drivers/usb/serial/mos7720.c
+@@ -369,8 +369,6 @@ static int write_parport_reg_nonblock(st
+       if (!urbtrack)
+               return -ENOMEM;
+-      kref_get(&mos_parport->ref_count);
+-      urbtrack->mos_parport = mos_parport;
+       urbtrack->urb = usb_alloc_urb(0, GFP_ATOMIC);
+       if (!urbtrack->urb) {
+               kfree(urbtrack);
+@@ -391,6 +389,8 @@ static int write_parport_reg_nonblock(st
+                            usb_sndctrlpipe(usbdev, 0),
+                            (unsigned char *)urbtrack->setup,
+                            NULL, 0, async_complete, urbtrack);
++      kref_get(&mos_parport->ref_count);
++      urbtrack->mos_parport = mos_parport;
+       kref_init(&urbtrack->ref_count);
+       INIT_LIST_HEAD(&urbtrack->urblist_entry);