* FAILED: patch "[PATCH] usb: typec: fix use after free in typec_register_port()" failed to apply to 4.19-stable tree
@ 2019-12-15 11:06 gregkh
2019-12-15 18:40 ` Sasha Levin
0 siblings, 1 reply; 2+ messages in thread
From: gregkh @ 2019-12-15 11:06 UTC (permalink / raw)
To: wenyang, gregkh, heikki.krogerus, stable; +Cc: stable
The patch below does not apply to the 4.19-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 5c388abefda0d92355714010c0199055c57ab6c7 Mon Sep 17 00:00:00 2001
From: Wen Yang <wenyang@linux.alibaba.com>
Date: Tue, 26 Nov 2019 22:04:52 +0800
Subject: [PATCH] usb: typec: fix use after free in typec_register_port()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We can't use "port->sw" and/or "port->mux" after it has been freed.
Fixes: 23481121c81d ("usb: typec: class: Don't use port parent for getting mux handles")
Signed-off-by: Wen Yang <wenyang@linux.alibaba.com>
Cc: stable <stable@vger.kernel.org>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20191126140452.14048-1-wenyang@linux.alibaba.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index 7ece6ca6e690..91d62276b56f 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -1612,14 +1612,16 @@ struct typec_port *typec_register_port(struct device *parent,
port->sw = typec_switch_get(&port->dev);
if (IS_ERR(port->sw)) {
+ ret = PTR_ERR(port->sw);
put_device(&port->dev);
- return ERR_CAST(port->sw);
+ return ERR_PTR(ret);
}
port->mux = typec_mux_get(&port->dev, NULL);
if (IS_ERR(port->mux)) {
+ ret = PTR_ERR(port->mux);
put_device(&port->dev);
- return ERR_CAST(port->mux);
+ return ERR_PTR(ret);
}
ret = device_add(&port->dev);
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: FAILED: patch "[PATCH] usb: typec: fix use after free in typec_register_port()" failed to apply to 4.19-stable tree
2019-12-15 11:06 FAILED: patch "[PATCH] usb: typec: fix use after free in typec_register_port()" failed to apply to 4.19-stable tree gregkh
@ 2019-12-15 18:40 ` Sasha Levin
0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2019-12-15 18:40 UTC (permalink / raw)
To: gregkh; +Cc: wenyang, heikki.krogerus, stable
On Sun, Dec 15, 2019 at 12:06:01PM +0100, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 4.19-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 5c388abefda0d92355714010c0199055c57ab6c7 Mon Sep 17 00:00:00 2001
>From: Wen Yang <wenyang@linux.alibaba.com>
>Date: Tue, 26 Nov 2019 22:04:52 +0800
>Subject: [PATCH] usb: typec: fix use after free in typec_register_port()
>MIME-Version: 1.0
>Content-Type: text/plain; charset=UTF-8
>Content-Transfer-Encoding: 8bit
>
>We can't use "port->sw" and/or "port->mux" after it has been freed.
>
>Fixes: 23481121c81d ("usb: typec: class: Don't use port parent for getting mux handles")
>Signed-off-by: Wen Yang <wenyang@linux.alibaba.com>
>Cc: stable <stable@vger.kernel.org>
>Cc: linux-usb@vger.kernel.org
>Cc: linux-kernel@vger.kernel.org
>Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>Link: https://lore.kernel.org/r/20191126140452.14048-1-wenyang@linux.alibaba.com
>Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixed up context and queued up for 4.19.
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-12-15 18:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-15 11:06 FAILED: patch "[PATCH] usb: typec: fix use after free in typec_register_port()" failed to apply to 4.19-stable tree gregkh
2019-12-15 18:40 ` Sasha Levin
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.