All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] USB: serial: io_edgeport: handle unbound ports on URB" failed to apply to 4.14-stable tree
@ 2020-01-19 13:40 gregkh
  2020-01-19 15:42 ` Sasha Levin
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2020-01-19 13:40 UTC (permalink / raw)
  To: johan, gregkh, stable; +Cc: stable


The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From e37d1aeda737a20b1846a91a3da3f8b0f00cf690 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@kernel.org>
Date: Fri, 17 Jan 2020 10:50:23 +0100
Subject: [PATCH] USB: serial: io_edgeport: handle unbound ports on URB
 completion

Check for NULL port data in the shared interrupt and bulk completion
callbacks to avoid dereferencing a NULL pointer in case a device sends
data for a port device which isn't bound to a driver (e.g. due to a
malicious device having unexpected endpoints or after an allocation
failure on port probe).

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>

diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index 9690a5f4b9d6..0582d78bdb1d 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -716,7 +716,7 @@ static void edge_interrupt_callback(struct urb *urb)
 			if (txCredits) {
 				port = edge_serial->serial->port[portNumber];
 				edge_port = usb_get_serial_port_data(port);
-				if (edge_port->open) {
+				if (edge_port && edge_port->open) {
 					spin_lock_irqsave(&edge_port->ep_lock,
 							  flags);
 					edge_port->txCredits += txCredits;
@@ -1825,7 +1825,7 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial,
 				port = edge_serial->serial->port[
 							edge_serial->rxPort];
 				edge_port = usb_get_serial_port_data(port);
-				if (edge_port->open) {
+				if (edge_port && edge_port->open) {
 					dev_dbg(dev, "%s - Sending %d bytes to TTY for port %d\n",
 						__func__, rxLen,
 						edge_serial->rxPort);


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] USB: serial: io_edgeport: handle unbound ports on URB" failed to apply to 4.14-stable tree
  2020-01-19 13:40 FAILED: patch "[PATCH] USB: serial: io_edgeport: handle unbound ports on URB" failed to apply to 4.14-stable tree gregkh
@ 2020-01-19 15:42 ` Sasha Levin
  2020-01-19 15:53   ` Johan Hovold
  0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2020-01-19 15:42 UTC (permalink / raw)
  To: gregkh; +Cc: johan, stable

On Sun, Jan 19, 2020 at 02:40:29PM +0100, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 4.14-stable tree.
>If someone wants it applied there, or to any other stable or longterm
>tree, then please email the backport, including the original git commit
>id to <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From e37d1aeda737a20b1846a91a3da3f8b0f00cf690 Mon Sep 17 00:00:00 2001
>From: Johan Hovold <johan@kernel.org>
>Date: Fri, 17 Jan 2020 10:50:23 +0100
>Subject: [PATCH] USB: serial: io_edgeport: handle unbound ports on URB
> completion
>
>Check for NULL port data in the shared interrupt and bulk completion
>callbacks to avoid dereferencing a NULL pointer in case a device sends
>data for a port device which isn't bound to a driver (e.g. due to a
>malicious device having unexpected endpoints or after an allocation
>failure on port probe).
>
>Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
>Cc: stable <stable@vger.kernel.org>
>Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>Signed-off-by: Johan Hovold <johan@kernel.org>

I also took dd1fae527612 ("USB: serial: io_edgeport: use irqsave() in
USB's complete callback") as a fix on it's own, and queued both for
4.14-4.4.

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] USB: serial: io_edgeport: handle unbound ports on URB" failed to apply to 4.14-stable tree
  2020-01-19 15:42 ` Sasha Levin
@ 2020-01-19 15:53   ` Johan Hovold
  0 siblings, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2020-01-19 15:53 UTC (permalink / raw)
  To: Sasha Levin; +Cc: gregkh, johan, stable

On Sun, Jan 19, 2020 at 10:42:25AM -0500, Sasha Levin wrote:
> On Sun, Jan 19, 2020 at 02:40:29PM +0100, gregkh@linuxfoundation.org wrote:
> >
> >The patch below does not apply to the 4.14-stable tree.
> >If someone wants it applied there, or to any other stable or longterm
> >tree, then please email the backport, including the original git commit
> >id to <stable@vger.kernel.org>.
> >
> >thanks,
> >
> >greg k-h
> >
> >------------------ original commit in Linus's tree ------------------
> >
> >From e37d1aeda737a20b1846a91a3da3f8b0f00cf690 Mon Sep 17 00:00:00 2001
> >From: Johan Hovold <johan@kernel.org>
> >Date: Fri, 17 Jan 2020 10:50:23 +0100
> >Subject: [PATCH] USB: serial: io_edgeport: handle unbound ports on URB
> > completion
> >
> >Check for NULL port data in the shared interrupt and bulk completion
> >callbacks to avoid dereferencing a NULL pointer in case a device sends
> >data for a port device which isn't bound to a driver (e.g. due to a
> >malicious device having unexpected endpoints or after an allocation
> >failure on port probe).
> >
> >Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> >Cc: stable <stable@vger.kernel.org>
> >Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >Signed-off-by: Johan Hovold <johan@kernel.org>
> 
> I also took dd1fae527612 ("USB: serial: io_edgeport: use irqsave() in
> USB's complete callback") as a fix on it's own,

That commit is not a fix; it was a preparatory change done to be able to
call completion handlers with interrupts enabled.

> and queued both for 4.14-4.4.

That said, it should be fine to backport, thanks.

Johan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-19 15:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-19 13:40 FAILED: patch "[PATCH] USB: serial: io_edgeport: handle unbound ports on URB" failed to apply to 4.14-stable tree gregkh
2020-01-19 15:42 ` Sasha Levin
2020-01-19 15:53   ` Johan Hovold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.