syzbot


WARNING: locking bug in kvm_xen_set_evtchn_fast

Status: upstream: reported C repro on 2024/11/21 15:03
Subsystems: kvm
[Documentation on labels]
Reported-by: syzbot+919877893c9d28162dc2@syzkaller.appspotmail.com
First crash: 159d, last: 1d09h
Cause bisection: introduced by (bisect log) :
commit 560af5dc839eef08a273908f390cfefefb82aa04
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Wed Oct 9 15:45:03 2024 +0000

  lockdep: Enable PROVE_RAW_LOCK_NESTING with PROVE_LOCKING.

Crash: WARNING: locking bug in kvm_xen_set_evtchn_fast (log)
Repro: C syz .config
  
Discussions (5)
Title Replies (including bot) Last reply
[syzbot] Monthly kvm report (Apr 2025) 0 (1) 2025/04/02 09:38
[syzbot] Monthly kvm report (Feb 2025) 0 (1) 2025/02/11 13:32
[syzbot] Monthly kvm report (Jan 2025) 0 (1) 2025/01/13 10:54
[syzbot] Monthly kvm report (Dec 2024) 0 (1) 2024/12/11 11:27
[syzbot] [kvm?] WARNING: locking bug in kvm_xen_set_evtchn_fast 4 (7) 2024/11/26 16:26

Sample crash report:
=============================
[ BUG: Invalid wait context ]
6.12.0-syzkaller-07834-g06afb0f36106 #0 Not tainted
-----------------------------
kworker/0:1/9 is trying to lock:
ffffc90003bca460 (&gpc->lock){....}-{3:3}, at: kvm_xen_set_evtchn_fast+0x1ee/0xa00 arch/x86/kvm/xen.c:1755
other info that might help us debug this:
context-{2:2}
6 locks held by kworker/0:1/9:
 #0: ffff888144a92148 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3204 [inline]
 #0: ffff888144a92148 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_scheduled_works+0x93b/0x1850 kernel/workqueue.c:3310
 #1: ffffc900000e7d00 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3205 [inline]
 #1: ffffc900000e7d00 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_scheduled_works+0x976/0x1850 kernel/workqueue.c:3310
 #2: ffff888145711190 (&dev->mutex){....}-{4:4}, at: device_lock include/linux/device.h:1014 [inline]
 #2: ffff888145711190 (&dev->mutex){....}-{4:4}, at: hub_event+0x1fe/0x5150 drivers/usb/core/hub.c:5849
 #3: ffffffff8e817de0 (console_lock){+.+.}-{0:0}, at: dev_vprintk_emit+0x2ae/0x330 drivers/base/core.c:4942
 #4: ffffffff8e8179f0 (console_srcu){....}-{0:0}, at: rcu_try_lock_acquire include/linux/rcupdate.h:342 [inline]
 #4: ffffffff8e8179f0 (console_srcu){....}-{0:0}, at: srcu_read_lock_nmisafe include/linux/srcu.h:297 [inline]
 #4: ffffffff8e8179f0 (console_srcu){....}-{0:0}, at: console_srcu_read_lock kernel/printk/printk.c:288 [inline]
 #4: ffffffff8e8179f0 (console_srcu){....}-{0:0}, at: console_flush_all+0x1a3/0xeb0 kernel/printk/printk.c:3187
 #5: ffffc90003bca8c8 (&kvm->srcu){.?.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:158 [inline]
 #5: ffffc90003bca8c8 (&kvm->srcu){.?.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:249 [inline]
 #5: ffffc90003bca8c8 (&kvm->srcu){.?.+}-{0:0}, at: kvm_xen_set_evtchn_fast+0x1bb/0xa00 arch/x86/kvm/xen.c:1753
stack backtrace:
CPU: 0 UID: 0 PID: 9 Comm: kworker/0:1 Not tainted 6.12.0-syzkaller-07834-g06afb0f36106 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: usb_hub_wq hub_event
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_lock_invalid_wait_context kernel/locking/lockdep.c:4826 [inline]
 check_wait_context kernel/locking/lockdep.c:4898 [inline]
 __lock_acquire+0x15a8/0x2100 kernel/locking/lockdep.c:5176
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
 _raw_read_lock_irqsave+0xdd/0x130 kernel/locking/spinlock.c:236
 kvm_xen_set_evtchn_fast+0x1ee/0xa00 arch/x86/kvm/xen.c:1755
 xen_timer_callback+0x1a0/0x380 arch/x86/kvm/xen.c:140
 __run_hrtimer kernel/time/hrtimer.c:1739 [inline]
 __hrtimer_run_queues+0x551/0xd50 kernel/time/hrtimer.c:1803
 hrtimer_interrupt+0x403/0xa40 kernel/time/hrtimer.c:1865
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1038 [inline]
 __sysvec_apic_timer_interrupt+0x110/0x420 arch/x86/kernel/apic/apic.c:1055
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline]
 sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1049
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:console_flush_all+0x996/0xeb0
Code: 48 21 c3 0f 85 16 02 00 00 e8 66 aa 20 00 4c 8b 7c 24 10 4d 85 f6 75 07 e8 57 aa 20 00 eb 06 e8 50 aa 20 00 fb 48 8b 5c 24 18 <48> 8b 44 24 30 42 80 3c 28 00 74 08 48 89 df e8 76 61 8b 00 4c 8b
RSP: 0018:ffffc900000e7000 EFLAGS: 00000293
RAX: ffffffff8174a2e0 RBX: ffffffff8f17fa58 RCX: ffff88801bef8000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900000e71b0 R08: ffffffff8174a2b7 R09: 1ffffffff285cb10
R10: dffffc0000000000 R11: fffffbfff285cb11 R12: ffffffff8f17fa00
R13: dffffc0000000000 R14: 0000000000000200 R15: ffffc900000e7200
 __console_flush_and_unlock kernel/printk/printk.c:3269 [inline]
 console_unlock+0x14f/0x3b0 kernel/printk/printk.c:3309
 vprintk_emit+0x730/0xa10 kernel/printk/printk.c:2432
 dev_vprintk_emit+0x2ae/0x330 drivers/base/core.c:4942
 dev_printk_emit+0xdd/0x120 drivers/base/core.c:4953
 _dev_info+0x122/0x170 drivers/base/core.c:5011
 show_string drivers/usb/core/hub.c:2357 [inline]
 announce_device drivers/usb/core/hub.c:2375 [inline]
 usb_new_device+0xd02/0x19a0 drivers/usb/core/hub.c:2632
 hub_port_connect drivers/usb/core/hub.c:5521 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5661 [inline]
 port_event drivers/usb/core/hub.c:5821 [inline]
 hub_event+0x2d6d/0x5150 drivers/usb/core/hub.c:5903
 process_one_work kernel/workqueue.c:3229 [inline]
 process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310
 worker_thread+0x870/0xd30 kernel/workqueue.c:3391
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
----------------
Code disassembly (best guess):
   0:	48 21 c3             	and    %rax,%rbx
   3:	0f 85 16 02 00 00    	jne    0x21f
   9:	e8 66 aa 20 00       	call   0x20aa74
   e:	4c 8b 7c 24 10       	mov    0x10(%rsp),%r15
  13:	4d 85 f6             	test   %r14,%r14
  16:	75 07                	jne    0x1f
  18:	e8 57 aa 20 00       	call   0x20aa74
  1d:	eb 06                	jmp    0x25
  1f:	e8 50 aa 20 00       	call   0x20aa74
  24:	fb                   	sti
  25:	48 8b 5c 24 18       	mov    0x18(%rsp),%rbx
* 2a:	48 8b 44 24 30       	mov    0x30(%rsp),%rax <-- trapping instruction
  2f:	42 80 3c 28 00       	cmpb   $0x0,(%rax,%r13,1)
  34:	74 08                	je     0x3e
  36:	48 89 df             	mov    %rbx,%rdi
  39:	e8 76 61 8b 00       	call   0x8b61b4
  3e:	4c                   	rex.WR
  3f:	8b                   	.byte 0x8b

Crashes (488):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/23 13:17 upstream 06afb0f36106 68da6d95 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/03/04 11:39 upstream 99fa936e8e4f c3901742 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/07 05:10 upstream 16cd1c265776 1c65791e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/03/21 03:44 upstream 5fc319360819 62330552 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/02/25 03:20 upstream d082ecbc71e9 d34966d1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/28 09:25 upstream b4432656b36e c6b4fb39 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/27 14:02 upstream 5bc1018675ec c6b4fb39 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/20 16:54 upstream 6fea5fabd332 2a20f901 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/28 15:54 upstream b4432656b36e c6b4fb39 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/22 23:39 upstream bc3372351d0c 53a8b9bd .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/22 20:38 upstream a33b5a08cbbd 53a8b9bd .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/22 01:15 upstream 9d7a0577c9db 2a20f901 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/19 19:28 upstream 8560697b23dc 2a20f901 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/19 12:28 upstream 3088d26962e8 2a20f901 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/19 10:18 upstream 3088d26962e8 2a20f901 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/17 05:32 upstream cfb2e2c57aef a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/17 03:51 upstream c62f4b82d571 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/17 02:17 upstream c62f4b82d571 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/17 01:01 upstream c62f4b82d571 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 23:30 upstream c62f4b82d571 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 21:11 upstream c62f4b82d571 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 19:35 upstream c62f4b82d571 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 17:56 upstream c62f4b82d571 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 16:22 upstream c62f4b82d571 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 15:15 upstream 1a1d569a75f3 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 14:07 upstream 1a1d569a75f3 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 13:45 upstream 1a1d569a75f3 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 12:33 upstream 1a1d569a75f3 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 10:36 upstream 1a1d569a75f3 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 09:15 upstream 1a1d569a75f3 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 09:04 upstream 1a1d569a75f3 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 05:49 upstream 1a1d569a75f3 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 04:48 upstream 1a1d569a75f3 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 03:46 upstream 1a1d569a75f3 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 02:30 upstream 1a1d569a75f3 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 02:28 upstream 1a1d569a75f3 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 01:25 upstream 1a1d569a75f3 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/16 00:16 upstream 1a1d569a75f3 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 23:05 upstream 1a1d569a75f3 a95239b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 20:11 upstream 1a1d569a75f3 85125322 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 19:05 upstream 1a1d569a75f3 85125322 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 17:00 upstream 1a1d569a75f3 85125322 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 16:59 upstream 1a1d569a75f3 85125322 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 14:45 upstream 834a4a689699 85125322 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 13:34 upstream 834a4a689699 85125322 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 10:51 upstream 834a4a689699 85125322 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 08:51 upstream 834a4a689699 85125322 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 07:42 upstream 834a4a689699 0bd6db41 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 06:24 upstream 834a4a689699 0bd6db41 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 05:18 upstream 834a4a689699 0bd6db41 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 04:55 upstream 834a4a689699 0bd6db41 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 03:14 upstream 834a4a689699 0bd6db41 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 02:07 upstream 834a4a689699 0bd6db41 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/15 00:36 upstream 834a4a689699 0bd6db41 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2024/11/21 10:38 upstream 8f7c8b88bda4 4b25d554 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2024/11/21 04:53 upstream 8f7c8b88bda4 4b25d554 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: locking bug in kvm_xen_set_evtchn_fast
2025/04/12 23:05 upstream 3bde70a2c827 0bd6db41 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: locking bug in kvm_xen_set_evtchn_fast
* Struck through repros no longer work on HEAD.