BUG: spinlock bad magic in gadget_dev_open

Status: moderation: reported on 2026/07/31 05:52
Subsystems: usb
[Documentation on labels]
Reported-by: syzbot+78c46fcd3a95e16c3a24@syzkaller.appspotmail.com
First crash: 6d23h, last: 6d23h
✨ AI Jobs (3)
ID Workflow Result Correct Bug Created Started Finished Revision Error
295d994c assessment-security 💥 BUG: spinlock bad magic in gadget_dev_open 2026/08/02 00:53 2026/08/02 00:53 2026/08/02 00:53 e611ffe1
dashboard requested TargetOS "linux" TargetArch "386", but agent does not support it
3db23fc7 assessment-security 💥 BUG: spinlock bad magic in gadget_dev_open 2026/07/31 00:48 2026/07/31 00:48 2026/07/31 00:48 aaffb173
dashboard requested TargetOS "linux" TargetArch "386", but agent does not support it
f31db00e assessment-security 💥 BUG: spinlock bad magic in gadget_dev_open 2026/07/29 00:55 2026/07/29 00:55 2026/07/29 00:55 7be3c40b
dashboard requested TargetOS "linux" TargetArch "386", but agent does not support it

Sample crash report:
BUG: spinlock bad magic on CPU#2, syz.3.4960/23729
Oops: general protection fault, probably for non-canonical address 0xdffffc00000000d2: 0000 [#1] SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000690-0x0000000000000697]
CPU: 2 UID: 0 PID: 23729 Comm: syz.3.4960 Tainted: G             L      syzkaller #0 PREEMPT(full) 
Tainted: [L]=SOFTLOCKUP
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:task_pid_nr include/linux/pid.h:236 [inline]
RIP: 0010:spin_dump+0xd7/0x160 kernel/locking/spinlock_debug.c:64
Code: 09 84 d2 74 05 e8 f9 33 57 01 44 8b 63 08 48 85 ed 74 37 48 8d bd 40 06 00 00 b8 ff ff 37 00 48 89 fa 48 c1 e0 2a 48 c1 ea 03 <8a> 04 02 84 c0 74 09 3c 03 7f 05 e8 c9 33 57 01 44 8b ad 40 06 00
RSP: 0018:ffffc90003d078b8 EFLAGS: 00010006
RAX: dffffc0000000000 RBX: ffff88802597c000 RCX: 0000000000000000
RDX: 00000000000000d2 RSI: ffffffff81e815e9 RDI: 0000000000000690
RBP: 0000000000000050 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000001 R11: 697073203a475542 R12: 0000000089ad02c0
R13: ffff888021460000 R14: ffff888021f67e48 R15: ffff888021f67e28
FS:  0000000000000000(0000) GS:ffff888096de3000(0063) knlGS:00000000f53ddb40
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000f7f1a190 CR3: 000000004acf7000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 spin_bug kernel/locking/spinlock_debug.c:78 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
 do_raw_spin_lock.cold+0x37/0x3c kernel/locking/spinlock_debug.c:115
 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_compat_sys_openat fs/open.c:1436 [inline]
 __se_compat_sys_openat fs/open.c:1434 [inline]
 __ia32_compat_sys_openat+0x12d/0x210 fs/open.c:1434
 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
 __do_fast_syscall_32+0xe7/0x970 arch/x86/entry/syscall_32.c:307
 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332
 entry_SYSENTER_compat_after_hwframe+0x84/0x8e
RIP: 0023:0xf6feefec
Code: Unable to access opcode bytes at 0xf6feefc2.
RSP: 002b:00000000f53dd50c EFLAGS: 00000292 ORIG_RAX: 0000000000000127
RAX: ffffffffffffffda RBX: 00000000ffffff9c RCX: 0000000080000300
RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:task_pid_nr include/linux/pid.h:236 [inline]
RIP: 0010:spin_dump+0xd7/0x160 kernel/locking/spinlock_debug.c:64
Code: 09 84 d2 74 05 e8 f9 33 57 01 44 8b 63 08 48 85 ed 74 37 48 8d bd 40 06 00 00 b8 ff ff 37 00 48 89 fa 48 c1 e0 2a 48 c1 ea 03 <8a> 04 02 84 c0 74 09 3c 03 7f 05 e8 c9 33 57 01 44 8b ad 40 06 00
RSP: 0018:ffffc90003d078b8 EFLAGS: 00010006
RAX: dffffc0000000000 RBX: ffff88802597c000 RCX: 0000000000000000
RDX: 00000000000000d2 RSI: ffffffff81e815e9 RDI: 0000000000000690
RBP: 0000000000000050 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000001 R11: 697073203a475542 R12: 0000000089ad02c0
R13: ffff888021460000 R14: ffff888021f67e48 R15: ffff888021f67e28
FS:  0000000000000000(0000) GS:ffff888096de3000(0063) knlGS:00000000f53ddb40
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000f6fef000 CR3: 000000004acf7000 CR4: 0000000000352ef0
----------------
Code disassembly (best guess):
   0:	09 84 d2 74 05 e8 f9 	or     %eax,-0x617fa8c(%rdx,%rdx,8)
   7:	33 57 01             	xor    0x1(%rdi),%edx
   a:	44 8b 63 08          	mov    0x8(%rbx),%r12d
   e:	48 85 ed             	test   %rbp,%rbp
  11:	74 37                	je     0x4a
  13:	48 8d bd 40 06 00 00 	lea    0x640(%rbp),%rdi
  1a:	b8 ff ff 37 00       	mov    $0x37ffff,%eax
  1f:	48 89 fa             	mov    %rdi,%rdx
  22:	48 c1 e0 2a          	shl    $0x2a,%rax
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	8a 04 02             	mov    (%rdx,%rax,1),%al <-- trapping instruction
  2d:	84 c0                	test   %al,%al
  2f:	74 09                	je     0x3a
  31:	3c 03                	cmp    $0x3,%al
  33:	7f 05                	jg     0x3a
  35:	e8 c9 33 57 01       	call   0x1573403
  3a:	44                   	rex.R
  3b:	8b                   	.byte 0x8b
  3c:	ad                   	lods   %ds:(%rsi),%eax
  3d:	40 06                	rex (bad)

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/07/27 06:31 upstream 4235cb24ec1e 4a865b71 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 BUG: spinlock bad magic in gadget_dev_open
2026/07/27 06:18 upstream 4235cb24ec1e 4a865b71 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 BUG: spinlock bad magic in gadget_dev_open
2026/07/27 05:50 upstream 4235cb24ec1e 4a865b71 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 BUG: spinlock bad magic in gadget_dev_open
* Struck through repros no longer work on HEAD.