============================= [ BUG: Invalid wait context ] 6.12.0-syzkaller-08446-g228a1157fb9f #0 Not tainted ----------------------------- sshd/5965 is trying to lock: ffffffff8e3a3298 (stack_list_lock){-.-.}-{3:3}, at: add_stack_record_to_list mm/page_owner.c:182 [inline] ffffffff8e3a3298 (stack_list_lock){-.-.}-{3:3}, at: inc_stack_record_count mm/page_owner.c:214 [inline] ffffffff8e3a3298 (stack_list_lock){-.-.}-{3:3}, at: __set_page_owner+0x3ea/0x560 mm/page_owner.c:329 other info that might help us debug this: context-{2:2} 4 locks held by sshd/5965: #0: ffff888028b3a8e0 (&mm->mmap_lock){++++}-{4:4}, at: mmap_write_downgrade include/linux/mmap_lock.h:138 [inline] #0: ffff888028b3a8e0 (&mm->mmap_lock){++++}-{4:4}, at: vms_complete_munmap_vmas+0x710/0x980 mm/vma.c:1139 #1: ffffffff8e1bbac0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #1: ffffffff8e1bbac0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #1: ffffffff8e1bbac0 (rcu_read_lock){....}-{1:3}, at: __pte_offset_map+0x42/0x540 mm/pgtable-generic.c:287 #2: ffff8880323f30d8 (ptlock_ptr(ptdesc)#2){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] #2: ffff8880323f30d8 (ptlock_ptr(ptdesc)#2){+.+.}-{3:3}, at: __pte_offset_map_lock+0xf1/0x300 mm/pgtable-generic.c:375 #3: ffff88806a83eb18 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x29/0x130 kernel/sched/core.c:598 stack backtrace: CPU: 2 UID: 0 PID: 5965 Comm: sshd Not tainted 6.12.0-syzkaller-08446-g228a1157fb9f #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 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+0x878/0x3c40 kernel/locking/lockdep.c:5176 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 add_stack_record_to_list mm/page_owner.c:182 [inline] inc_stack_record_count mm/page_owner.c:214 [inline] __set_page_owner+0x3ea/0x560 mm/page_owner.c:329 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 stack_depot_save_flags+0x566/0x8f0 lib/stackdepot.c:627 kasan_save_stack+0x42/0x60 mm/kasan/common.c:48 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 task_work_add+0xc0/0x3b0 kernel/task_work.c:77 task_tick_numa kernel/sched/fair.c:3607 [inline] task_tick_fair+0x524/0x8e0 kernel/sched/fair.c:13054 sched_tick+0x1dd/0x4f0 kernel/sched/core.c:5652 update_process_times+0x19c/0x2d0 kernel/time/timer.c:2524 tick_sched_handle kernel/time/tick-sched.c:276 [inline] tick_nohz_handler+0x376/0x530 kernel/time/tick-sched.c:297 __run_hrtimer kernel/time/hrtimer.c:1739 [inline] __hrtimer_run_queues+0x5fb/0xae0 kernel/time/hrtimer.c:1803 hrtimer_interrupt+0x392/0x8e0 kernel/time/hrtimer.c:1865 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1038 [inline] __sysvec_apic_timer_interrupt+0x10f/0x400 arch/x86/kernel/apic/apic.c:1055 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0x9f/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:find_first_bit include/linux/find.h:205 [inline] RIP: 0010:__first_node include/linux/nodemask.h:266 [inline] RIP: 0010:policy_nodemask+0x3b6/0x4e0 mm/mempolicy.c:2053 Code: 00 e9 4d fd ff ff e8 39 9a a0 ff 48 8d 7d 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 15 01 00 00 <48> 8b 5d 08 31 ff bd 40 00 00 00 48 89 de e8 77 9c a0 ff 48 85 db RSP: 0018:ffffc900045cf4b0 EFLAGS: 00000246 RAX: dffffc0000000000 RBX: 0000000000000001 RCX: ffffffff81ed9c30 RDX: 1ffffffff350b661 RSI: ffffffff81ed9f67 RDI: ffffffff9a85b308 RBP: ffffffff9a85b300 R08: 0000000000000003 R09: 0000000000000006 R10: 0000000000000001 R11: 0000000000000003 R12: ffffc900045cf548 R13: ffffffffffffffff R14: 0000000000002800 R15: dffffc0000000000 alloc_pages_mpol_noprof+0x9c/0x610 mm/mempolicy.c:2227 get_free_pages_noprof+0xc/0x40 mm/page_alloc.c:4798 tlb_next_batch mm/mmu_gather.c:35 [inline] __tlb_remove_folio_pages_size.constprop.0+0x2f0/0x560 mm/mmu_gather.c:196 zap_present_folio_ptes mm/memory.c:1525 [inline] zap_present_ptes mm/memory.c:1579 [inline] zap_pte_range mm/memory.c:1621 [inline] zap_pmd_range mm/memory.c:1739 [inline] zap_pud_range mm/memory.c:1768 [inline] zap_p4d_range mm/memory.c:1789 [inline] unmap_page_range+0x151a/0x3cf0 mm/memory.c:1810 unmap_single_vma+0x194/0x2b0 mm/memory.c:1856 unmap_vmas+0x22f/0x490 mm/memory.c:1900 vms_clear_ptes+0x426/0x780 mm/vma.c:1095 vms_complete_munmap_vmas+0x1ce/0x980 mm/vma.c:1144 do_vmi_align_munmap+0x619/0x890 mm/vma.c:1353 do_vmi_munmap+0x20b/0x3e0 mm/vma.c:1401 __vm_munmap+0x14f/0x340 mm/mmap.c:1623 __do_sys_munmap mm/mmap.c:1640 [inline] __se_sys_munmap mm/mmap.c:1637 [inline] __x64_sys_munmap+0x59/0x80 mm/mmap.c:1637 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f637dd1d817 Code: ff ff 76 10 48 8b 15 10 36 0d 00 f7 d8 64 89 02 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 b8 0b 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e1 35 0d 00 f7 d8 64 89 01 48 RSP: 002b:00007ffc4d8091d8 EFLAGS: 00000207 ORIG_RAX: 000000000000000b RAX: ffffffffffffffda RBX: fffffffffffffe98 RCX: 00007f637dd1d817 RDX: 0000000000000000 RSI: 00000000002b9000 RDI: 00007f637d438000 RBP: 0000000000000020 R08: 00007f637d438000 R09: 0000000000000000 R10: 0000000000000022 R11: 0000000000000207 R12: 00007f637d438000 R13: 00007f637d438010 R14: 00000000002b8000 R15: 00007ffc4d8093b8 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: e9 4d fd ff ff jmp 0xfffffd52 5: e8 39 9a a0 ff call 0xffa09a43 a: 48 8d 7d 08 lea 0x8(%rbp),%rdi e: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 15: fc ff df 18: 48 89 fa mov %rdi,%rdx 1b: 48 c1 ea 03 shr $0x3,%rdx 1f: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) 23: 0f 85 15 01 00 00 jne 0x13e * 29: 48 8b 5d 08 mov 0x8(%rbp),%rbx <-- trapping instruction 2d: 31 ff xor %edi,%edi 2f: bd 40 00 00 00 mov $0x40,%ebp 34: 48 89 de mov %rbx,%rsi 37: e8 77 9c a0 ff call 0xffa09cb3 3c: 48 85 db test %rbx,%rbx