[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191105163215.30194-4-mkl@pengutronix.de>
Date: Tue, 5 Nov 2019 17:31:45 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, linux-can@...r.kernel.org,
kernel@...gutronix.de, Johan Hovold <johan@...nel.org>,
stable <stable@...r.kernel.org>,
Remigiusz Kołłątaj
<remigiusz.kollataj@...ica.com>,
syzbot+e29b17e5042bbc56fae9@...kaller.appspotmail.com,
Marc Kleine-Budde <mkl@...gutronix.de>
Subject: [PATCH 03/33] can: mcba_usb: fix use-after-free on disconnect
From: Johan Hovold <johan@...nel.org>
The driver was accessing its driver data after having freed it.
Fixes: 51f3baad7de9 ("can: mcba_usb: Add support for Microchip CAN BUS Analyzer")
Cc: stable <stable@...r.kernel.org> # 4.12
Cc: Remigiusz Kołłątaj <remigiusz.kollataj@...ica.com>
Reported-by: syzbot+e29b17e5042bbc56fae9@...kaller.appspotmail.com
Signed-off-by: Johan Hovold <johan@...nel.org>
Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
---
drivers/net/can/usb/mcba_usb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/can/usb/mcba_usb.c b/drivers/net/can/usb/mcba_usb.c
index 19a702ac49e4..21faa2ec4632 100644
--- a/drivers/net/can/usb/mcba_usb.c
+++ b/drivers/net/can/usb/mcba_usb.c
@@ -876,9 +876,8 @@ static void mcba_usb_disconnect(struct usb_interface *intf)
netdev_info(priv->netdev, "device disconnected\n");
unregister_candev(priv->netdev);
- free_candev(priv->netdev);
-
mcba_urb_unlink(priv);
+ free_candev(priv->netdev);
}
static struct usb_driver mcba_usb_driver = {
--
2.24.0.rc1
Powered by blists - more mailing lists