linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ieee802154: atusb: fix use-after-free at disconnect
@ 2019-09-19 12:12 Johan Hovold
  2019-09-19 12:32 ` KASAN: use-after-free Read in atusb_disconnect syzbot
  2019-09-19 14:56 ` [PATCH] ieee802154: atusb: fix use-after-free at disconnect Stefan Schmidt
  0 siblings, 2 replies; 3+ messages in thread
From: Johan Hovold @ 2019-09-19 12:12 UTC (permalink / raw)
  To: Stefan Schmidt
  Cc: Alexander Aring, David S. Miller, linux-wpan, netdev,
	linux-kernel, andreyknvl, syzkaller-bugs, Johan Hovold, stable,
	syzbot+f4509a9138a1472e7e80

The disconnect callback was accessing the hardware-descriptor private
data after having having freed it.

Fixes: 7490b008d123 ("ieee802154: add support for atusb transceiver")
Cc: stable <stable@vger.kernel.org>     # 4.2
Cc: Alexander Aring <alex.aring@gmail.com>
Reported-by: syzbot+f4509a9138a1472e7e80@syzkaller.appspotmail.com
Signed-off-by: Johan Hovold <johan@kernel.org>
---

#syz test: https://github.com/google/kasan.git f0df5c1b

 drivers/net/ieee802154/atusb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
index ceddb424f887..0dd0ba915ab9 100644
--- a/drivers/net/ieee802154/atusb.c
+++ b/drivers/net/ieee802154/atusb.c
@@ -1137,10 +1137,11 @@ static void atusb_disconnect(struct usb_interface *interface)
 
 	ieee802154_unregister_hw(atusb->hw);
 
+	usb_put_dev(atusb->usb_dev);
+
 	ieee802154_free_hw(atusb->hw);
 
 	usb_set_intfdata(interface, NULL);
-	usb_put_dev(atusb->usb_dev);
 
 	pr_debug("%s done\n", __func__);
 }
-- 
2.23.0


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

end of thread, other threads:[~2019-09-19 14:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-19 12:12 [PATCH] ieee802154: atusb: fix use-after-free at disconnect Johan Hovold
2019-09-19 12:32 ` KASAN: use-after-free Read in atusb_disconnect syzbot
2019-09-19 14:56 ` [PATCH] ieee802154: atusb: fix use-after-free at disconnect Stefan Schmidt

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).