public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+9eebf5f6544c5e873858@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [input?] [usb?] KASAN: slab-use-after-free Read in hidraw_report_event
Date: Tue, 28 Apr 2026 19:33:58 +0800	[thread overview]
Message-ID: <20260428113359.2216-1-hdanton@sina.com> (raw)
In-Reply-To: <69eed7e0.a00a0220.7773.0026.GAE@google.com>

> Date: Sun, 26 Apr 2026 20:28:32 -0700
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    7080e32d3f09 Add linux-next specific files for 20260424
> git tree:       linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=13d8b2d2580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=d941ac7f11ceb230
> dashboard link: https://syzkaller.appspot.com/bug?extid=9eebf5f6544c5e873858
> compiler:       Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14d309ba580000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=13a082ce580000

#syz test

--- x/drivers/hid/hid-core.c
+++ y/drivers/hid/hid-core.c
@@ -2404,8 +2404,8 @@ EXPORT_SYMBOL_GPL(hid_hw_start);
  */
 void hid_hw_stop(struct hid_device *hdev)
 {
-	hid_disconnect(hdev);
 	hdev->ll_driver->stop(hdev);
+	hid_disconnect(hdev);
 }
 EXPORT_SYMBOL_GPL(hid_hw_stop);
 
--- x/drivers/hid/usbhid/hid-core.c
+++ y/drivers/hid/usbhid/hid-core.c
@@ -279,6 +279,8 @@ static void hid_irq_in(struct urb *urb)
 	switch (urb->status) {
 	case 0:			/* success */
 		usbhid->retry_delay = 0;
+		if (test_bit(HID_DISCONNECTED, &usbhid->iofl))
+			return;
 		if (!test_bit(HID_OPENED, &usbhid->iofl))
 			break;
 		usbhid_mark_busy(usbhid);
@@ -1278,6 +1280,11 @@ static int usbhid_power(struct hid_devic
 	struct usbhid_device *usbhid = hid->driver_data;
 	int r = 0;
 
+	if (test_bit(HID_DISCONNECTED, &usbhid->iofl))
+		return -ENODEV;
+	if (!test_bit(HID_STARTED, &usbhid->iofl))
+		return -ENODEV;
+
 	switch (lvl) {
 	case PM_HINT_FULLON:
 		r = usb_autopm_get_interface(usbhid->intf);
--

  parent reply	other threads:[~2026-04-28 11:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27  3:28 [syzbot] [input?] [usb?] KASAN: slab-use-after-free Read in hidraw_report_event syzbot
2026-04-27  5:05 ` Edward Adam Davis
2026-04-27  6:03   ` syzbot
2026-04-27  9:18 ` Edward Adam Davis
2026-04-27 12:49   ` syzbot
2026-04-27 13:11 ` Edward Adam Davis
2026-04-27 14:09   ` syzbot
2026-04-27 23:21 ` Hillf Danton
2026-04-27 23:57   ` syzbot
2026-04-28  1:04 ` Edward Adam Davis
2026-04-28  4:05   ` syzbot
2026-04-28  3:51 ` Hillf Danton
2026-04-28  4:37   ` syzbot
2026-04-28  4:12 ` [PATCH] hwmon: prevent packets from going to driver for probe Edward Adam Davis
2026-04-28  8:00 ` [syzbot] [input?] [usb?] KASAN: slab-use-after-free Read in hidraw_report_event Hillf Danton
2026-04-28  8:51   ` syzbot
2026-04-28 11:33 ` Hillf Danton [this message]
2026-04-28 12:03   ` syzbot
2026-04-28 20:27 ` Hillf Danton
2026-04-28 21:19   ` 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=20260428113359.2216-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+9eebf5f6544c5e873858@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