From: Greg Kroah-Hartman Date: Sat, 30 Mar 2019 19:47:08 +0000 (+0100) Subject: 3.18-stable patches X-Git-Tag: v3.18.138~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=33d45b454bba46f97ed3cad75a27186b41a9f6d6;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches 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 --- 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 index 00000000000..07e753d7036 --- /dev/null +++ b/queue-3.18/serial-max310x-fix-to-avoid-potential-null-pointer-dereference.patch @@ -0,0 +1,31 @@ +From 3a10e3dd52e80b9a97a3346020024d17b2c272d6 Mon Sep 17 00:00:00 2001 +From: Aditya Pakki +Date: Mon, 18 Mar 2019 18:44:14 -0500 +Subject: serial: max310x: Fix to avoid potential NULL pointer dereference + +From: Aditya Pakki + +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 +Cc: stable +Signed-off-by: Greg Kroah-Hartman + +--- + 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 { diff --git a/queue-3.18/series b/queue-3.18/series index 6b76ca934d0..f3cd7315d7c 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -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 index 00000000000..1298ac8f6e6 --- /dev/null +++ b/queue-3.18/tty-mxs-auart-fix-a-potential-null-pointer-dereference.patch @@ -0,0 +1,34 @@ +From 6734330654dac550f12e932996b868c6d0dcb421 Mon Sep 17 00:00:00 2001 +From: Kangjie Lu +Date: Thu, 14 Mar 2019 02:21:51 -0500 +Subject: tty: mxs-auart: fix a potential NULL pointer dereference + +From: Kangjie Lu + +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 +Cc: stable +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..06877b54d23 --- /dev/null +++ b/queue-3.18/usb-serial-cp210x-add-new-device-id.patch @@ -0,0 +1,33 @@ +From a595ecdd5f60b2d93863cebb07eec7f935839b54 Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Wed, 27 Mar 2019 10:11:14 +0900 +Subject: USB: serial: cp210x: add new device id + +From: Greg Kroah-Hartman + +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 +Signed-off-by: Greg Kroah-Hartman +Cc: stable +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..9aaa59cf35e --- /dev/null +++ b/queue-3.18/usb-serial-ftdi_sio-add-additional-novatech-products.patch @@ -0,0 +1,46 @@ +From 422c2537ba9d42320f8ab6573940269f87095320 Mon Sep 17 00:00:00 2001 +From: George McCollister +Date: Tue, 5 Mar 2019 16:05:03 -0600 +Subject: USB: serial: ftdi_sio: add additional NovaTech products + +From: George McCollister + +commit 422c2537ba9d42320f8ab6573940269f87095320 upstream. + +Add PIDs for the NovaTech OrionLX+ and Orion I/O so they can be +automatically detected. + +Signed-off-by: George McCollister +Cc: stable +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..ba7c4265f58 --- /dev/null +++ b/queue-3.18/usb-serial-mos7720-fix-mos_parport-refcount-imbalance-on-error-path.patch @@ -0,0 +1,47 @@ +From 2908b076f5198d231de62713cb2b633a3a4b95ac Mon Sep 17 00:00:00 2001 +From: Lin Yi +Date: Wed, 20 Mar 2019 19:04:56 +0800 +Subject: USB: serial: mos7720: fix mos_parport refcount imbalance on error path + +From: Lin Yi + +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 +Fixes: b69578df7e98 ("USB: usbserial: mos7720: add support for parallel port on moschip 7715") +Cc: stable # 2.6.35 +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + 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); +