From: Camila Alvarez <cam.alvarez.i@gmail.com>
To: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>,
Christian Gromm <christian.gromm@microchip.com>
Cc: syzkaller-bugs@googlegroups.com, linux-kernel@vger.kernel.org,
Camila Alvarez <cam.alvarez.i@gmail.com>,
syzbot+916742d5d24f6c254761@syzkaller.appspotmail.com
Subject: [PATCH] usb: fix slab-use-after-free Read in hdm_disconnect
Date: Mon, 29 Jul 2024 23:57:46 -0400 [thread overview]
Message-ID: <20240730035745.110637-1-cam.alvarez.i@gmail.com> (raw)
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
Closes: https://syzkaller.appspot.com/bug?extid=916742d5d24f6c254761
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
reply other threads:[~2024-07-30 3:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20240730035745.110637-1-cam.alvarez.i@gmail.com \
--to=cam.alvarez.i@gmail.com \
--cc=christian.gromm@microchip.com \
--cc=linux-kernel@vger.kernel.org \
--cc=parthiban.veerasooran@microchip.com \
--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®