WARNING: locking bug in gadget_dev_open

Status: upstream: reported on 2026/07/31 06:47
Subsystems: usb
[Documentation on labels]
Reported-by: syzbot+3dfcbe7ab191ca685ce7@syzkaller.appspotmail.com
First crash: 19d, last: 3d00h
✨ AI Jobs (4)
ID Workflow Result Correct Bug Created Started Finished Revision
56efb85a assessment-security 💥 WARNING: locking bug in gadget_dev_open 2026/08/09 12:19 2026/08/09 12:19 2026/08/09 12:19 5d63f80b
6659e5e5 assessment-security 💥 WARNING: locking bug in gadget_dev_open 2026/08/03 01:12 2026/08/03 01:12 2026/08/03 01:12 e611ffe1
0dd5e611 assessment-security 💥 WARNING: locking bug in gadget_dev_open 2026/07/31 02:17 2026/07/31 02:17 2026/07/31 02:17 aaffb173
08e04fee assessment-security 💥 WARNING: locking bug in gadget_dev_open 2026/07/29 02:21 2026/07/29 02:21 2026/07/29 02:21 7be3c40b
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [usb?] WARNING: locking bug in gadget_dev_open 0 (1) 2026/07/31 06:47

Sample crash report:
------------[ cut here ]------------
DEBUG_LOCKS_WARN_ON(1)
WARNING: kernel/locking/lockdep.c:238 at hlock_class kernel/locking/lockdep.c:238 [inline], CPU#1: syz.4.672/8128
WARNING: kernel/locking/lockdep.c:238 at hlock_class kernel/locking/lockdep.c:227 [inline], CPU#1: syz.4.672/8128
WARNING: kernel/locking/lockdep.c:238 at check_wait_context kernel/locking/lockdep.c:4854 [inline], CPU#1: syz.4.672/8128
WARNING: kernel/locking/lockdep.c:238 at __lock_acquire+0x13df/0x1a40 kernel/locking/lockdep.c:5187, CPU#1: syz.4.672/8128
Modules linked in:
CPU: 1 UID: 0 PID: 8128 Comm: syz.4.672 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:hlock_class kernel/locking/lockdep.c:238 [inline]
RIP: 0010:hlock_class kernel/locking/lockdep.c:227 [inline]
RIP: 0010:check_wait_context kernel/locking/lockdep.c:4854 [inline]
RIP: 0010:__lock_acquire+0x13e6/0x1a40 kernel/locking/lockdep.c:5187
Code: 48 c7 c6 b7 51 19 8e 67 48 0f b9 3a 44 8b 44 24 48 44 0f b6 4c 24 08 e9 d9 fb ff ff 48 8d 3d b1 34 3f 0f 48 c7 c6 b7 51 19 8e <67> 48 0f b9 3a 44 8b 44 24 08 e9 e6 fb ff ff e8 d6 86 34 03 89 c3
RSP: 0018:ffffc900059cf848 EFLAGS: 00010046
RAX: 0000000000000001 RBX: ffff88802b59d620 RCX: ffffc9002f7e7000
RDX: 0000000000080000 RSI: ffffffff8e1951b7 RDI: ffffffff91253280
RBP: ffff88802b59ca80 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 33333333332bff7c
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
FS:  00007f0bd72516c0(0000) GS:ffff8880d5eec000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f8c69e83ff8 CR3: 000000002eaa0000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 lock_acquire kernel/locking/lockdep.c:5868 [inline]
 lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5825
 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:142 [inline]
 _raw_spin_lock_irq+0x36/0x50 kernel/locking/spinlock.c:174
 spin_lock_irq include/linux/spinlock.h:372 [inline]
 gadget_dev_open+0x44/0x1b0 drivers/usb/gadget/legacy/inode.c:1919
 do_dentry_open+0x6ab/0x14d0 fs/open.c:947
 vfs_open+0x82/0x3f0 fs/open.c:1052
 do_open fs/namei.c:4700 [inline]
 path_openat+0x2873/0x4280 fs/namei.c:4863
 do_file_open+0x20e/0x430 fs/namei.c:4892
 do_sys_openat2+0x10f/0x1e0 fs/open.c:1368
 do_sys_open fs/open.c:1374 [inline]
 __do_sys_openat fs/open.c:1390 [inline]
 __se_sys_openat fs/open.c:1385 [inline]
 __x64_sys_openat+0x12d/0x210 fs/open.c:1385
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f0bd639e0d9
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f0bd7251028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f0bd6625fa0 RCX: 00007f0bd639e0d9
RDX: 0000000000000002 RSI: 00002000000001c0 RDI: ffffffffffffff9c
RBP: 00007f0bd6435024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f0bd6626038 R14: 00007f0bd6625fa0 R15: 00007ffc049f3a78
 </TASK>
----------------
Code disassembly (best guess):
   0:	48 c7 c6 b7 51 19 8e 	mov    $0xffffffff8e1951b7,%rsi
   7:	67 48 0f b9 3a       	ud1    (%edx),%rdi
   c:	44 8b 44 24 48       	mov    0x48(%rsp),%r8d
  11:	44 0f b6 4c 24 08    	movzbl 0x8(%rsp),%r9d
  17:	e9 d9 fb ff ff       	jmp    0xfffffbf5
  1c:	48 8d 3d b1 34 3f 0f 	lea    0xf3f34b1(%rip),%rdi        # 0xf3f34d4
  23:	48 c7 c6 b7 51 19 8e 	mov    $0xffffffff8e1951b7,%rsi
* 2a:	67 48 0f b9 3a       	ud1    (%edx),%rdi <-- trapping instruction
  2f:	44 8b 44 24 08       	mov    0x8(%rsp),%r8d
  34:	e9 e6 fb ff ff       	jmp    0xfffffc1f
  39:	e8 d6 86 34 03       	call   0x3348714
  3e:	89 c3                	mov    %eax,%ebx

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/12 22:47 upstream 3d6d817622b0 359b2492 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in gadget_dev_open
2026/08/12 22:36 upstream 3d6d817622b0 359b2492 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in gadget_dev_open
2026/07/27 06:41 upstream 4235cb24ec1e 4a865b71 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: locking bug in gadget_dev_open
* Struck through repros no longer work on HEAD.