=============================
[ BUG: Invalid wait context ]
syzkaller #0 Not tainted
-----------------------------
syz.0.0/5317 is trying to lock:
ffff888050c41bb0 (&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/5317:
#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: ffff888050fd38d0 (&sb->s_type->i_mutex_key#15){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1024 [inline]
#1: ffff888050fd38d0 (&sb->s_type->i_mutex_key#15){+.+.}-{4:4}, at: shmem_file_write_iter+0x7f/0x120 mm/shmem.c:3414
#2: ffff888050c42110 (&kvm->srcu){.?.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:187 [inline]
#2: ffff888050c42110 (&kvm->srcu){.?.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:294 [inline]
#2: ffff888050c42110 (&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: 5317 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:stack_depot_save+0x4/0x10 lib/stackdepot.c:747
Code: 48 83 3d 3e d2 9b 15 00 75 c8 90 0f 0b 90 eb c2 66 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 01 00 00 00 e9 e2 f7 ff ff 66 90 90 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc9000f34f2d8 EFLAGS: 00000246
RAX: 000000000000000e RBX: ffff88803e8805f8 RCX: 542f2bbdb3aa6c00
RDX: 0000000000140cca RSI: 000000000000000e RDI: ffffc9000f34f320
RBP: ffffc9000f34f410 R08: ffffffff81d76566 R09: 0000000000000000
R10: 0000000000000000 R11: ffffffff8eb59c60 R12: dffffc0000000000
R13: 1ffff11007d100bf R14: ffffc9000f34f320 R15: 1ffff92001e69e60
save_stack+0x130/0x230 mm/page_owner.c:166
__set_page_owner+0x8d/0x4c0 mm/page_owner.c:341
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1859
prep_new_page mm/page_alloc.c:1867 [inline]
get_page_from_freelist+0x21fa/0x2270 mm/page_alloc.c:3946
__alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5304
alloc_pages_mpol+0x212/0x380 mm/mempolicy.c:2490
folio_alloc_mpol_noprof+0x39/0x160 mm/mempolicy.c:2509
shmem_alloc_folio mm/shmem.c:1917 [inline]
shmem_alloc_and_add_folio+0x43e/0xf60 mm/shmem.c:1959
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:0x7f146115e90e
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:00007f14620f0cb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f14620f16c0 RCX: 00007f146115e90e
RDX: 0000000001000000 RSI: 00007f1455000000 RDI: 0000000000000006
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000006
R13: 00007f14620f0d9c R14: 00007f14620f0da0 R15: 00007f1455000000
----------------
Code disassembly (best guess):
0: 48 83 3d 3e d2 9b 15 cmpq $0x0,0x159bd23e(%rip) # 0x159bd246
7: 00
8: 75 c8 jne 0xffffffd2
a: 90 nop
b: 0f 0b ud2
d: 90 nop
e: eb c2 jmp 0xffffffd2
10: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1)
16: 90 nop
17: 90 nop
18: 90 nop
19: 90 nop
1a: 90 nop
1b: 90 nop
1c: 90 nop
1d: 90 nop
1e: 90 nop
1f: 90 nop
20: 90 nop
21: 90 nop
22: 90 nop
23: 90 nop
24: 90 nop
25: 90 nop
26: f3 0f 1e fa endbr64
* 2a: b9 01 00 00 00 mov $0x1,%ecx <-- trapping instruction
2f: e9 e2 f7 ff ff jmp 0xfffff816
34: 66 90 xchg %ax,%ax
36: 90 nop
37: 90 nop
38: 90 nop
39: 90 nop
3a: 90 nop
3b: 90 nop
3c: 90 nop
3d: 90 nop
3e: 90 nop
3f: 90 nop