============================= [ BUG: Invalid wait context ] syzkaller #0 Not tainted ----------------------------- syz.0.0/5321 is trying to lock: ffff888012311bb0 (&gpc->lock){....}-{3:3}, at: kvm_xen_set_evtchn_fast+0x1f4/0x9a0 arch/x86/kvm/xen.c:1822 other info that might help us debug this: context-{2:2} 3 locks held by syz.0.0/5321: #0: ffff88801c2da450 (sb_writers#5){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2733 [inline] #0: ffff88801c2da450 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0x22b/0xba0 fs/read_write.c:683 #1: ffff888043768890 (&sb->s_type->i_mutex_key#15){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1024 [inline] #1: ffff888043768890 (&sb->s_type->i_mutex_key#15){+.+.}-{4:4}, at: shmem_file_write_iter+0x7f/0x120 mm/shmem.c:3414 #2: ffff888012312110 (&kvm->srcu){.?.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:187 [inline] #2: ffff888012312110 (&kvm->srcu){.?.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:294 [inline] #2: ffff888012312110 (&kvm->srcu){.?.+}-{0:0}, at: kvm_xen_set_evtchn_fast+0x1bc/0x9a0 arch/x86/kvm/xen.c:1820 stack backtrace: CPU: 0 UID: 0 PID: 5321 Comm: syz.0.0 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 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_lock_invalid_wait_context kernel/locking/lockdep.c:4830 [inline] check_wait_context kernel/locking/lockdep.c:4902 [inline] __lock_acquire+0xe39/0x2cf0 kernel/locking/lockdep.c:5187 lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5868 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:174 [inline] _raw_read_lock_irqsave+0x48/0x60 kernel/locking/spinlock.c:240 kvm_xen_set_evtchn_fast+0x1f4/0x9a0 arch/x86/kvm/xen.c:1822 xen_timer_callback+0x109/0x220 arch/x86/kvm/xen.c:140 __run_hrtimer kernel/time/hrtimer.c:2032 [inline] __hrtimer_run_queues+0x371/0xa10 kernel/time/hrtimer.c:2096 hrtimer_interrupt+0x448/0x910 kernel/time/hrtimer.c:2215 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1051 [inline] __sysvec_apic_timer_interrupt+0x102/0x430 arch/x86/kernel/apic/apic.c:1068 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 RIP: 0010:constant_test_bit arch/x86/include/asm/bitops.h:202 [inline] RIP: 0010:arch_test_bit arch/x86/include/asm/bitops.h:232 [inline] RIP: 0010:_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline] RIP: 0010:folio_test_head include/linux/page-flags.h:843 [inline] RIP: 0010:folio_test_large include/linux/page-flags.h:864 [inline] RIP: 0010:folio_order include/linux/mm.h:1768 [inline] RIP: 0010:shmem_add_to_page_cache+0x2e3/0xd40 mm/shmem.c:895 Code: 53 d3 b4 ff 48 83 e3 01 0f 85 94 09 00 00 4c 8b 6c 24 10 4c 89 ef be 08 00 00 00 e8 b7 05 24 00 48 8b 44 24 18 42 80 3c 30 00 <74> 08 4c 89 ef e8 33 03 24 00 49 8b 5d 00 48 89 de 48 83 e6 40 31 RSP: 0018:ffffc9000ea5f720 EFLAGS: 00000246 RAX: 1ffffd400008e8b0 RBX: 0000000000000000 RCX: ffffffff82124489 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffea0000474580 RBP: ffffc9000ea5f870 R08: ffffea0000474587 R09: 1ffffd400008e8b0 R10: dffffc0000000000 R11: fffff9400008e8b1 R12: ffffea0000474588 R13: ffffea0000474580 R14: dffffc0000000000 R15: 00000000000000d2 shmem_alloc_and_add_folio+0x854/0xf60 mm/shmem.c:1985 shmem_get_folio_gfp+0x5da/0x16d0 mm/shmem.c:2512 shmem_get_folio mm/shmem.c:2618 [inline] shmem_write_begin+0x16c/0x330 mm/shmem.c:3249 generic_perform_write+0x2d5/0x8f0 mm/filemap.c:4364 shmem_file_write_iter+0xf8/0x120 mm/shmem.c:3424 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x612/0xba0 fs/read_write.c:687 ksys_write+0x150/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7efcdc15e90e Code: 08 0f 85 a5 a8 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08 RSP: 002b:00007efcdd12ad68 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007efcdd12b6c0 RCX: 00007efcdc15e90e RDX: 0000000000100000 RSI: 00007efcd0000000 RDI: 0000000000000008 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000008 R13: 00007efcdd12aea0 R14: 00007efcdd12ae60 R15: 00007efcd0000000 ---------------- Code disassembly (best guess): 0: 53 push %rbx 1: d3 b4 ff 48 83 e3 01 shll %cl,0x1e38348(%rdi,%rdi,8) 8: 0f 85 94 09 00 00 jne 0x9a2 e: 4c 8b 6c 24 10 mov 0x10(%rsp),%r13 13: 4c 89 ef mov %r13,%rdi 16: be 08 00 00 00 mov $0x8,%esi 1b: e8 b7 05 24 00 call 0x2405d7 20: 48 8b 44 24 18 mov 0x18(%rsp),%rax 25: 42 80 3c 30 00 cmpb $0x0,(%rax,%r14,1) * 2a: 74 08 je 0x34 <-- trapping instruction 2c: 4c 89 ef mov %r13,%rdi 2f: e8 33 03 24 00 call 0x240367 34: 49 8b 5d 00 mov 0x0(%r13),%rbx 38: 48 89 de mov %rbx,%rsi 3b: 48 83 e6 40 and $0x40,%rsi 3f: 31 .byte 0x31