syzbot


BUG: spinlock bad magic in wg_packet_decrypt_worker

Status: moderation: reported on 2024/06/04 19:45
Subsystems: wireguard
[Documentation on labels]
Reported-by: syzbot+6456845c30b2ab8591cc@syzkaller.appspotmail.com
First crash: 22d, last: 22d

Sample crash report:
BUG: spinlock bad magic on CPU#1, kworker/1:5/6783
Oops: general protection fault, probably for non-canonical address 0xf29b069c200000b8: 0000 [#1] PREEMPT SMP KASAN NOPTI
KASAN: maybe wild-memory-access in range [0x94d854e1000005c0-0x94d854e1000005c7]
CPU: 1 PID: 6783 Comm: kworker/1:5 Not tainted 6.10.0-rc2-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Workqueue: wg-crypt-wg2 wg_packet_decrypt_worker
RIP: 0010:task_pid_nr include/linux/pid.h:232 [inline]
RIP: 0010:spin_dump kernel/locking/spinlock_debug.c:64 [inline]
RIP: 0010:spin_bug+0x100/0x1d0 kernel/locking/spinlock_debug.c:78
Code: 08 84 d2 0f 85 db 00 00 00 48 85 ed 44 8b 4b 08 74 7d 48 8d bd c8 05 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 04 3c 03 7e 68 44 8b 85 c8 05 00 00 48 8d 8d
RSP: 0018:ffffc90003a5fb90 EFLAGS: 00010a07
RAX: dffffc0000000000 RBX: ffff888059324eec RCX: ffffffff816f3159
RDX: 129b0a9c200000b8 RSI: ffffffff816fbd56 RDI: 94d854e1000005c7
RBP: 94d854e0ffffffff R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000201 R11: 697073203a475542 R12: ffffffff8b2d1f60
R13: ffff888021484880 R14: ffff888059324e64 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff88802c100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f4cd65720a0 CR3: 00000000560e0000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
 do_raw_spin_lock+0x225/0x2c0 kernel/locking/spinlock_debug.c:115
 spin_lock_bh include/linux/spinlock.h:356 [inline]
 ptr_ring_consume_bh include/linux/ptr_ring.h:365 [inline]
 wg_packet_decrypt_worker+0x2aa/0x530 drivers/net/wireguard/receive.c:499
 process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231
 process_scheduled_works kernel/workqueue.c:3312 [inline]
 worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393
 kthread+0x2c1/0x3a0 kernel/kthread.c:389
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:task_pid_nr include/linux/pid.h:232 [inline]
RIP: 0010:spin_dump kernel/locking/spinlock_debug.c:64 [inline]
RIP: 0010:spin_bug+0x100/0x1d0 kernel/locking/spinlock_debug.c:78
Code: 08 84 d2 0f 85 db 00 00 00 48 85 ed 44 8b 4b 08 74 7d 48 8d bd c8 05 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 04 3c 03 7e 68 44 8b 85 c8 05 00 00 48 8d 8d
RSP: 0018:ffffc90003a5fb90 EFLAGS: 00010a07
RAX: dffffc0000000000 RBX: ffff888059324eec RCX: ffffffff816f3159
RDX: 129b0a9c200000b8 RSI: ffffffff816fbd56 RDI: 94d854e1000005c7
RBP: 94d854e0ffffffff R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000201 R11: 697073203a475542 R12: ffffffff8b2d1f60
R13: ffff888021484880 R14: ffff888059324e64 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff88802c100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f4cd65720a0 CR3: 000000000d97a000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	08 84 d2 0f 85 db 00 	or     %al,0xdb850f(%rdx,%rdx,8)
   7:	00 00                	add    %al,(%rax)
   9:	48 85 ed             	test   %rbp,%rbp
   c:	44 8b 4b 08          	mov    0x8(%rbx),%r9d
  10:	74 7d                	je     0x8f
  12:	48 8d bd c8 05 00 00 	lea    0x5c8(%rbp),%rdi
  19:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  20:	fc ff df
  23:	48 89 fa             	mov    %rdi,%rdx
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	0f b6 04 02          	movzbl (%rdx,%rax,1),%eax <-- trapping instruction
  2e:	84 c0                	test   %al,%al
  30:	74 04                	je     0x36
  32:	3c 03                	cmp    $0x3,%al
  34:	7e 68                	jle    0x9e
  36:	44 8b 85 c8 05 00 00 	mov    0x5c8(%rbp),%r8d
  3d:	48                   	rex.W
  3e:	8d                   	.byte 0x8d
  3f:	8d                   	.byte 0x8d

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/06/03 09:08 upstream c3f38fa61af7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 BUG: spinlock bad magic in wg_packet_decrypt_worker
* Struck through repros no longer work on HEAD.