============================= [ BUG: Invalid wait context ] 6.13.0-rc7-syzkaller-00019-gc45323b7560e #0 Not tainted ----------------------------- syz.2.575/8422 is trying to lock: ffff88813fffca18 (&zone->lock){-.-.}-{3:3}, at: rmqueue_buddy mm/page_alloc.c:2909 [inline] ffff88813fffca18 (&zone->lock){-.-.}-{3:3}, at: rmqueue mm/page_alloc.c:3082 [inline] ffff88813fffca18 (&zone->lock){-.-.}-{3:3}, at: get_page_from_freelist+0xb41/0x37a0 mm/page_alloc.c:3473 other info that might help us debug this: context-{2:2} 4 locks held by syz.2.575/8422: #0: ffff8880324e27e0 (&mm->mmap_lock){++++}-{4:4}, at: mmap_write_lock_killable include/linux/mmap_lock.h:122 [inline] #0: ffff8880324e27e0 (&mm->mmap_lock){++++}-{4:4}, at: vm_mmap_pgoff+0x17c/0x3d0 mm/util.c:573 #1: ffffffff8e937ae0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #1: ffffffff8e937ae0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #1: ffffffff8e937ae0 (rcu_read_lock){....}-{1:3}, at: ___pte_offset_map+0x82/0x380 mm/pgtable-generic.c:287 #2: ffff8880344dccd8 (ptlock_ptr(ptdesc)#2){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] #2: ffff8880344dccd8 (ptlock_ptr(ptdesc)#2){+.+.}-{3:3}, at: __pte_offset_map_lock+0x1ba/0x300 mm/pgtable-generic.c:402 #3: ffff8880b86447d8 (&pcp->lock){+.+.}-{3:3}, at: spin_trylock include/linux/spinlock.h:361 [inline] #3: ffff8880b86447d8 (&pcp->lock){+.+.}-{3:3}, at: free_unref_page+0x6ec/0x1000 mm/page_alloc.c:2680 stack backtrace: CPU: 0 UID: 0 PID: 8422 Comm: syz.2.575 Not tainted 6.13.0-rc7-syzkaller-00019-gc45323b7560e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __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_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 rmqueue_buddy mm/page_alloc.c:2909 [inline] rmqueue mm/page_alloc.c:3082 [inline] get_page_from_freelist+0xb41/0x37a0 mm/page_alloc.c:3473 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x3e1/0x780 mm/mempolicy.c:2269 stack_depot_save_flags+0x72d/0x940 lib/stackdepot.c:627 kasan_save_stack+0x4f/0x60 mm/kasan/common.c:48 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:544 task_work_add+0xd9/0x490 kernel/task_work.c:77 __run_posix_cpu_timers kernel/time/posix-cpu-timers.c:1223 [inline] run_posix_cpu_timers+0x6ac/0x810 kernel/time/posix-cpu-timers.c:1422 tick_sched_handle kernel/time/tick-sched.c:276 [inline] tick_nohz_handler+0x37c/0x500 kernel/time/tick-sched.c:297 __run_hrtimer kernel/time/hrtimer.c:1739 [inline] __hrtimer_run_queues+0x551/0xd30 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+0x52/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0xd8/0x140 kernel/locking/spinlock.c:194 Code: 9c 8f 44 24 20 42 80 3c 23 00 74 08 4c 89 f7 e8 ae 83 3f f6 f6 44 24 21 02 75 52 41 f7 c7 00 02 00 00 74 01 fb bf 01 00 00 00 43 b6 a9 f5 65 8b 05 84 07 40 74 85 c0 74 43 48 c7 04 24 0e 36 RSP: 0018:ffffc900000073a0 EFLAGS: 00000206 RAX: bf18b01034ceb900 RBX: 1ffff92000000e78 RCX: ffffffff817b282a RDX: dffffc0000000000 RSI: ffffffff8c0a98e0 RDI: 0000000000000001 RBP: ffffc90000007430 R08: ffffffff94271887 R09: 1ffffffff284e310 R10: dffffc0000000000 R11: fffffbfff284e311 R12: dffffc0000000000 R13: 1ffff92000000e74 R14: ffffc900000073c0 R15: 0000000000000246 free_unref_page_commit+0x582/0x1140 mm/page_alloc.c:2634 free_unref_page+0x70c/0x1000 mm/page_alloc.c:2682 __folio_put+0x2b3/0x360 mm/swap.c:112 page_to_skb+0x3dd/0x9b0 drivers/net/virtio_net.c:914 receive_mergeable drivers/net/virtio_net.c:2434 [inline] receive_buf+0x3ae/0x1850 drivers/net/virtio_net.c:2572 virtnet_receive_packets drivers/net/virtio_net.c:2887 [inline] virtnet_receive drivers/net/virtio_net.c:2911 [inline] virtnet_poll+0x27aa/0x39b0 drivers/net/virtio_net.c:3006 __napi_poll+0xcb/0x490 net/core/dev.c:6902 napi_poll net/core/dev.c:6971 [inline] net_rx_action+0x89b/0x1240 net/core/dev.c:7093 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:561 __do_softirq kernel/softirq.c:595 [inline] invoke_softirq kernel/softirq.c:435 [inline] __irq_exit_rcu+0xf7/0x220 kernel/softirq.c:662 irq_exit_rcu+0x9/0x30 kernel/softirq.c:678 common_interrupt+0xb9/0xd0 arch/x86/kernel/irq.c:278 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:get_current arch/x86/include/asm/current.h:49 [inline] RIP: 0010:__sanitizer_cov_trace_pc+0x8/0x70 kernel/kcov.c:216 Code: 8b 3d 44 b1 8d 0c 48 89 de 5b e9 63 70 58 00 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 48 8b 04 24 <65> 48 8b 0c 25 80 d4 03 00 65 8b 15 50 62 64 7e 81 e2 00 01 ff 00 RSP: 0018:ffffc9000c4673d0 EFLAGS: 00000246 RAX: ffffffff81f1389f RBX: 0000000000000000 RCX: ffff88801f3a1e00 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000013155 R08: ffffffff81f13888 R09: 1ffffffff2030b26 R10: dffffc0000000000 R11: fffffbfff2030b27 R12: ffffea0001a59780 R13: ffffea0001a59780 R14: 0000000000000000 R15: 0000000000000001 arch_static_branch arch/x86/include/asm/jump_label.h:36 [inline] page_fixed_fake_head include/linux/page-flags.h:205 [inline] _compound_head include/linux/page-flags.h:246 [inline] __folio_rmap_sanity_checks+0x11f/0x590 include/linux/rmap.h:216 __folio_add_rmap mm/rmap.c:1170 [inline] __folio_add_file_rmap mm/rmap.c:1489 [inline] folio_add_file_rmap_ptes+0x82/0x380 mm/rmap.c:1511 insert_page_into_pte_locked+0x3dc/0x6c0 mm/memory.c:2073 insert_page mm/memory.c:2093 [inline] vm_insert_page+0x4c1/0x710 mm/memory.c:2243 kcov_mmap+0xd7/0x140 kernel/kcov.c:506 call_mmap include/linux/fs.h:2183 [inline] mmap_file mm/internal.h:124 [inline] __mmap_new_file_vma mm/vma.c:2291 [inline] __mmap_new_vma mm/vma.c:2355 [inline] __mmap_region+0x224e/0x2d30 mm/vma.c:2456 mmap_region+0x226/0x2c0 mm/mmap.c:1352 do_mmap+0x97a/0x10d0 mm/mmap.c:500 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:575 ksys_mmap_pgoff+0x4eb/0x720 mm/mmap.c:546 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa8fd585d63 Code: f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 41 89 ca 41 f7 c1 ff 0f 00 00 75 14 b8 09 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 25 c3 0f 1f 40 00 48 c7 c0 a8 ff ff ff 64 c7 RSP: 002b:00007ffdc78eabc8 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007fa8fd7762d8 RCX: 00007fa8fd585d63 RDX: 0000000000000003 RSI: 0000000000400000 RDI: 00007fa8faff6000 RBP: 00007fa8fd776240 R08: 00000000000000db R09: 0000000000000000 R10: 0000000000000011 R11: 0000000000000246 R12: 0000000000000003 R13: 00007fa8fd776240 R14: 0000000000000003 R15: 00000000000016e9 ---------------- Code disassembly (best guess): 0: 9c pushf 1: 8f 44 24 20 pop 0x20(%rsp) 5: 42 80 3c 23 00 cmpb $0x0,(%rbx,%r12,1) a: 74 08 je 0x14 c: 4c 89 f7 mov %r14,%rdi f: e8 ae 83 3f f6 call 0xf63f83c2 14: f6 44 24 21 02 testb $0x2,0x21(%rsp) 19: 75 52 jne 0x6d 1b: 41 f7 c7 00 02 00 00 test $0x200,%r15d 22: 74 01 je 0x25 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 43 b6 a9 f5 call 0xf5a9b672 <-- trapping instruction 2f: 65 8b 05 84 07 40 74 mov %gs:0x74400784(%rip),%eax # 0x744007ba 36: 85 c0 test %eax,%eax 38: 74 43 je 0x7d 3a: 48 rex.W 3b: c7 .byte 0xc7 3c: 04 24 add $0x24,%al 3e: 0e (bad) 3f: 36 ss