From: Camila Alvarez <cam.alvarez.i@gmail.com>
To: syzbot+916742d5d24f6c254761@syzkaller.appspotmail.com
Cc: syzkaller-bugs@googlegroups.com, linux-kernel@vger.kernel.org,
Camila Alvarez <cam.alvarez.i@gmail.com>
Subject: [PATCH] usb: slab-use-after-free Read in hdm_disconnect
Date: Mon, 29 Jul 2024 23:07:58 -0400 [thread overview]
Message-ID: <20240730030757.109700-1-cam.alvarez.i@gmail.com> (raw)
#syz test
All references on the device were lost when deregistering the interface. To make sure the device is not released before freeing all the memory we add get_device to increase the ref count by one.
Reported-by: syzbot+916742d5d24f6c254761@syzkaller.appspotmail.com
Signed-off-by: Camila Alvarez <cam.alvarez.i@gmail.com>
---
drivers/most/most_usb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/most/most_usb.c b/drivers/most/most_usb.c
index 485d5ca39951..e178a5a0d3aa 100644
--- a/drivers/most/most_usb.c
+++ b/drivers/most/most_usb.c
@@ -1120,6 +1120,7 @@ static void hdm_disconnect(struct usb_interface *interface)
if (mdev->dci)
device_unregister(&mdev->dci->dev);
+ get_device(&mdev->dev);
most_deregister_interface(&mdev->iface);
kfree(mdev->busy_urbs);
--
2.34.1
next reply other threads:[~2024-07-30 3:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-30 3:07 Camila Alvarez [this message]
2024-07-30 3:56 ` [syzbot] [usb?] KASAN: " 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=20240730030757.109700-1-cam.alvarez.i@gmail.com \
--to=cam.alvarez.i@gmail.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®