public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Ivan Pravdin <ipravdin.official@gmail.com>
To: syzbot+1e3edf922962b5ea40a4@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [usb?] KASAN: slab-use-after-free Read in raw_event_queue_add
Date: Fri, 6 Jun 2025 01:16:15 -0400	[thread overview]
Message-ID: <4a7f4d21-8b1c-4616-82bb-210395215035@gmail.com> (raw)
In-Reply-To: <683ed7e6.a00a0220.d8eae.006b.GAE@google.com>

#syz test

diff --git a/drivers/usb/gadget/legacy/raw_gadget.c b/drivers/usb/gadget/legacy/raw_gadget.c
index 20165e1582d9..d7fca01afbf1 100644
--- a/drivers/usb/gadget/legacy/raw_gadget.c
+++ b/drivers/usb/gadget/legacy/raw_gadget.c
@@ -120,9 +120,13 @@ static struct usb_raw_event *raw_event_queue_fetch(
 static void raw_event_queue_destroy(struct raw_event_queue *queue)
 {
        int i;
+       unsigned long flags;
 
+       spin_lock_irqsave(&queue->lock, flags);
        for (i = 0; i < queue->size; i++)
                kfree(queue->events[i]);
+       spin_unlock_irqrestore(&queue->lock, flags);
+
        queue->size = 0;
 }

Ivan Pravdin


  reply	other threads:[~2025-06-06  5:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-03 11:09 [syzbot] [usb?] KASAN: slab-use-after-free Read in raw_event_queue_add syzbot
2025-06-06  5:16 ` Ivan Pravdin [this message]
2025-06-06  5:16   ` 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=4a7f4d21-8b1c-4616-82bb-210395215035@gmail.com \
    --to=ipravdin.official@gmail.com \
    --cc=683ed7e6.a00a0220.d8eae.006b.GAE@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=syzbot+1e3edf922962b5ea40a4@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