mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+916742d5d24f6c254761@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [usb?] KASAN: slab-use-after-free Read in hdm_disconnect
Date: Tue, 30 Jul 2024 13:40:09 +0800	[thread overview]
Message-ID: <tencent_EAF7DD8919014F8F8DD6259B0DA8123DDD07@qq.com> (raw)
In-Reply-To: <000000000000043dc4061e61370a@google.com>

move the relase dev to the end

#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git 933069701c1b

diff --git a/drivers/most/most_usb.c b/drivers/most/most_usb.c
index 485d5ca39951..ed3fcba00cae 100644
--- a/drivers/most/most_usb.c
+++ b/drivers/most/most_usb.c
@@ -1118,15 +1118,14 @@ static void hdm_disconnect(struct usb_interface *interface)
 	del_timer_sync(&mdev->link_stat_timer);
 	cancel_work_sync(&mdev->poll_work_obj);
 
-	if (mdev->dci)
-		device_unregister(&mdev->dci->dev);
 	most_deregister_interface(&mdev->iface);
 
 	kfree(mdev->busy_urbs);
 	kfree(mdev->cap);
 	kfree(mdev->conf);
 	kfree(mdev->ep_address);
-	put_device(&mdev->dci->dev);
+	if (mdev->dci)
+		device_unregister(&mdev->dci->dev);
 	put_device(&mdev->dev);
 }
 


  reply	other threads:[~2024-07-30  5:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29 11:32 syzbot
2024-07-30  5:40 ` Edward Adam Davis [this message]
2024-07-30  5:54   ` syzbot
2024-07-30  5:58 ` Edward Adam Davis
2024-07-30  6:09   ` syzbot
2024-07-30  6:29 ` Edward Adam Davis
2024-07-30  6:55   ` syzbot
2025-06-16 16:03 ` [syzbot] #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e04c78d86a9699d136910cfc0bdcf01087e3267e syzbot
2024-07-30  3:07 [PATCH] usb: slab-use-after-free Read in hdm_disconnect Camila Alvarez
2024-07-30  3:56 ` [syzbot] [usb?] KASAN: " syzbot
     [not found] <a454ce9b-807c-4f22-98fa-80a7da98e2a9@yandex.ru>
2025-06-16 16:41 ` syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_EAF7DD8919014F8F8DD6259B0DA8123DDD07@qq.com \
    --to=eadavis@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+916742d5d24f6c254761@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®