stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] USB: serial: keyspan: handle unbound ports" failed to apply to 4.9-stable tree
@ 2020-01-19 13:41 gregkh
  2020-01-19 15:47 ` Sasha Levin
  0 siblings, 1 reply; 6+ messages in thread
From: gregkh @ 2020-01-19 13:41 UTC (permalink / raw)
  To: johan, gregkh, stable; +Cc: stable


The patch below does not apply to the 4.9-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 3018dd3fa114b13261e9599ddb5656ef97a1fa17 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@kernel.org>
Date: Fri, 17 Jan 2020 10:50:25 +0100
Subject: [PATCH] USB: serial: keyspan: handle unbound ports

Check for NULL port data in the control URB completion handlers to avoid
dereferencing a NULL pointer in the unlikely case where a port device
isn't bound to a driver (e.g. after an allocation failure on port
probe()).

Fixes: 0ca1268e109a ("USB Serial Keyspan: add support for USA-49WG & USA-28XG")
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/keyspan.c b/drivers/usb/serial/keyspan.c
index e66a59ef43a1..aa3dbce22cfb 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -1058,6 +1058,8 @@ static void	usa49_glocont_callback(struct urb *urb)
 	for (i = 0; i < serial->num_ports; ++i) {
 		port = serial->port[i];
 		p_priv = usb_get_serial_port_data(port);
+		if (!p_priv)
+			continue;
 
 		if (p_priv->resend_cont) {
 			dev_dbg(&port->dev, "%s - sending setup\n", __func__);
@@ -1459,6 +1461,8 @@ static void usa67_glocont_callback(struct urb *urb)
 	for (i = 0; i < serial->num_ports; ++i) {
 		port = serial->port[i];
 		p_priv = usb_get_serial_port_data(port);
+		if (!p_priv)
+			continue;
 
 		if (p_priv->resend_cont) {
 			dev_dbg(&port->dev, "%s - sending setup\n", __func__);


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

* Re: FAILED: patch "[PATCH] USB: serial: keyspan: handle unbound ports" failed to apply to 4.9-stable tree
  2020-01-19 13:41 FAILED: patch "[PATCH] USB: serial: keyspan: handle unbound ports" failed to apply to 4.9-stable tree gregkh
@ 2020-01-19 15:47 ` Sasha Levin
  2020-01-19 15:51   ` Greg KH
  2020-01-19 16:01   ` Johan Hovold
  0 siblings, 2 replies; 6+ messages in thread
From: Sasha Levin @ 2020-01-19 15:47 UTC (permalink / raw)
  To: gregkh; +Cc: johan, stable

On Sun, Jan 19, 2020 at 02:41:16PM +0100, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 4.9-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 3018dd3fa114b13261e9599ddb5656ef97a1fa17 Mon Sep 17 00:00:00 2001
>From: Johan Hovold <johan@kernel.org>
>Date: Fri, 17 Jan 2020 10:50:25 +0100
>Subject: [PATCH] USB: serial: keyspan: handle unbound ports
>
>Check for NULL port data in the control URB completion handlers to avoid
>dereferencing a NULL pointer in the unlikely case where a port device
>isn't bound to a driver (e.g. after an allocation failure on port
>probe()).
>
>Fixes: 0ca1268e109a ("USB Serial Keyspan: add support for USA-49WG & USA-28XG")
>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>

Grabbing the prerequisite for the other USB patch also resolved the
conflict here, now queued for 4.9 and 4.4.

-- 
Thanks,
Sasha

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

* Re: FAILED: patch "[PATCH] USB: serial: keyspan: handle unbound ports" failed to apply to 4.9-stable tree
  2020-01-19 15:47 ` Sasha Levin
@ 2020-01-19 15:51   ` Greg KH
  2020-01-19 16:01   ` Johan Hovold
  1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2020-01-19 15:51 UTC (permalink / raw)
  To: Sasha Levin; +Cc: johan, stable

On Sun, Jan 19, 2020 at 10:47:33AM -0500, Sasha Levin wrote:
> On Sun, Jan 19, 2020 at 02:41:16PM +0100, gregkh@linuxfoundation.org wrote:
> > 
> > The patch below does not apply to the 4.9-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 3018dd3fa114b13261e9599ddb5656ef97a1fa17 Mon Sep 17 00:00:00 2001
> > From: Johan Hovold <johan@kernel.org>
> > Date: Fri, 17 Jan 2020 10:50:25 +0100
> > Subject: [PATCH] USB: serial: keyspan: handle unbound ports
> > 
> > Check for NULL port data in the control URB completion handlers to avoid
> > dereferencing a NULL pointer in the unlikely case where a port device
> > isn't bound to a driver (e.g. after an allocation failure on port
> > probe()).
> > 
> > Fixes: 0ca1268e109a ("USB Serial Keyspan: add support for USA-49WG & USA-28XG")
> > 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>
> 
> Grabbing the prerequisite for the other USB patch also resolved the
> conflict here, now queued for 4.9 and 4.4.

Thanks for this and the other fixups you're doing here, much
appreciated.

greg k-h

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

* Re: FAILED: patch "[PATCH] USB: serial: keyspan: handle unbound ports" failed to apply to 4.9-stable tree
  2020-01-19 15:47 ` Sasha Levin
  2020-01-19 15:51   ` Greg KH
@ 2020-01-19 16:01   ` Johan Hovold
  2020-01-19 18:53     ` Sasha Levin
  1 sibling, 1 reply; 6+ messages in thread
From: Johan Hovold @ 2020-01-19 16:01 UTC (permalink / raw)
  To: Sasha Levin; +Cc: gregkh, johan, stable

On Sun, Jan 19, 2020 at 10:47:33AM -0500, Sasha Levin wrote:
> On Sun, Jan 19, 2020 at 02:41:16PM +0100, gregkh@linuxfoundation.org wrote:
> >
> >The patch below does not apply to the 4.9-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 3018dd3fa114b13261e9599ddb5656ef97a1fa17 Mon Sep 17 00:00:00 2001
> >From: Johan Hovold <johan@kernel.org>
> >Date: Fri, 17 Jan 2020 10:50:25 +0100
> >Subject: [PATCH] USB: serial: keyspan: handle unbound ports
> >
> >Check for NULL port data in the control URB completion handlers to avoid
> >dereferencing a NULL pointer in the unlikely case where a port device
> >isn't bound to a driver (e.g. after an allocation failure on port
> >probe()).
> >
> >Fixes: 0ca1268e109a ("USB Serial Keyspan: add support for USA-49WG & USA-28XG")
> >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>
> 
> Grabbing the prerequisite for the other USB patch also resolved the
> conflict here, now queued for 4.9 and 4.4.

Just curious; which prerequisite are referring to here? I can't seem to
understand why this one failed to apply to 4.9 in the first place as
there hasn't really been any changes to that code in the keyspan driver.
 
Johan

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

* Re: FAILED: patch "[PATCH] USB: serial: keyspan: handle unbound ports" failed to apply to 4.9-stable tree
  2020-01-19 16:01   ` Johan Hovold
@ 2020-01-19 18:53     ` Sasha Levin
  2020-01-20  8:08       ` Johan Hovold
  0 siblings, 1 reply; 6+ messages in thread
From: Sasha Levin @ 2020-01-19 18:53 UTC (permalink / raw)
  To: Johan Hovold; +Cc: gregkh, stable

On Sun, Jan 19, 2020 at 05:01:36PM +0100, Johan Hovold wrote:
>On Sun, Jan 19, 2020 at 10:47:33AM -0500, Sasha Levin wrote:
>> On Sun, Jan 19, 2020 at 02:41:16PM +0100, gregkh@linuxfoundation.org wrote:
>> >
>> >The patch below does not apply to the 4.9-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 3018dd3fa114b13261e9599ddb5656ef97a1fa17 Mon Sep 17 00:00:00 2001
>> >From: Johan Hovold <johan@kernel.org>
>> >Date: Fri, 17 Jan 2020 10:50:25 +0100
>> >Subject: [PATCH] USB: serial: keyspan: handle unbound ports
>> >
>> >Check for NULL port data in the control URB completion handlers to avoid
>> >dereferencing a NULL pointer in the unlikely case where a port device
>> >isn't bound to a driver (e.g. after an allocation failure on port
>> >probe()).
>> >
>> >Fixes: 0ca1268e109a ("USB Serial Keyspan: add support for USA-49WG & USA-28XG")
>> >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>
>>
>> Grabbing the prerequisite for the other USB patch also resolved the
>> conflict here, now queued for 4.9 and 4.4.
>
>Just curious; which prerequisite are referring to here? I can't seem to
>understand why this one failed to apply to 4.9 in the first place as
>there hasn't really been any changes to that code in the keyspan driver.

I thought that it was either dd1fae527612 ("USB: serial: io_edgeport:
use irqsave() in USB's complete callback") or the stable commit that was
applied on top, but you're right -  it doesn't seem to be either of
those.

-- 
Thanks,
Sasha

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

* Re: FAILED: patch "[PATCH] USB: serial: keyspan: handle unbound ports" failed to apply to 4.9-stable tree
  2020-01-19 18:53     ` Sasha Levin
@ 2020-01-20  8:08       ` Johan Hovold
  0 siblings, 0 replies; 6+ messages in thread
From: Johan Hovold @ 2020-01-20  8:08 UTC (permalink / raw)
  To: Sasha Levin; +Cc: Johan Hovold, gregkh, stable

On Sun, Jan 19, 2020 at 01:53:26PM -0500, Sasha Levin wrote:
> On Sun, Jan 19, 2020 at 05:01:36PM +0100, Johan Hovold wrote:
> >On Sun, Jan 19, 2020 at 10:47:33AM -0500, Sasha Levin wrote:
> >> On Sun, Jan 19, 2020 at 02:41:16PM +0100, gregkh@linuxfoundation.org wrote:
> >> >
> >> >The patch below does not apply to the 4.9-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 3018dd3fa114b13261e9599ddb5656ef97a1fa17 Mon Sep 17 00:00:00 2001
> >> >From: Johan Hovold <johan@kernel.org>
> >> >Date: Fri, 17 Jan 2020 10:50:25 +0100
> >> >Subject: [PATCH] USB: serial: keyspan: handle unbound ports
> >> >
> >> >Check for NULL port data in the control URB completion handlers to avoid
> >> >dereferencing a NULL pointer in the unlikely case where a port device
> >> >isn't bound to a driver (e.g. after an allocation failure on port
> >> >probe()).
> >> >
> >> >Fixes: 0ca1268e109a ("USB Serial Keyspan: add support for USA-49WG & USA-28XG")
> >> >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>
> >>
> >> Grabbing the prerequisite for the other USB patch also resolved the
> >> conflict here, now queued for 4.9 and 4.4.
> >
> >Just curious; which prerequisite are referring to here? I can't seem to
> >understand why this one failed to apply to 4.9 in the first place as
> >there hasn't really been any changes to that code in the keyspan driver.
> 
> I thought that it was either dd1fae527612 ("USB: serial: io_edgeport:
> use irqsave() in USB's complete callback") or the stable commit that was
> applied on top, but you're right -  it doesn't seem to be either of
> those.

Thanks for confirming, and for doing the backports.

Johan

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

end of thread, other threads:[~2020-01-20  8:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-19 13:41 FAILED: patch "[PATCH] USB: serial: keyspan: handle unbound ports" failed to apply to 4.9-stable tree gregkh
2020-01-19 15:47 ` Sasha Levin
2020-01-19 15:51   ` Greg KH
2020-01-19 16:01   ` Johan Hovold
2020-01-19 18:53     ` Sasha Levin
2020-01-20  8:08       ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).