============================= [ BUG: Invalid wait context ] 6.12.0-rc5-next-20241031-syzkaller #0 Not tainted ----------------------------- syz.3.275/7380 is trying to lock: ffffffff8ea733d8 (stack_list_lock){-.-.}-{3:3}, at: add_stack_record_to_list mm/page_owner.c:182 [inline] ffffffff8ea733d8 (stack_list_lock){-.-.}-{3:3}, at: inc_stack_record_count mm/page_owner.c:214 [inline] ffffffff8ea733d8 (stack_list_lock){-.-.}-{3:3}, at: __set_page_owner+0x5cb/0x800 mm/page_owner.c:329 other info that might help us debug this: context-{2:2} 3 locks held by syz.3.275/7380: #0: ffff88802a6320f8 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x254/0x320 fs/file.c:1191 #1: ffff88805b5ac260 (&type->i_mutex_dir_key#20){++++}-{4:4}, at: iterate_dir+0x20c/0x800 fs/readdir.c:101 #2: ffffffff8e939f20 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #2: ffffffff8e939f20 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #2: ffffffff8e939f20 (rcu_read_lock){....}-{1:3}, at: blk_mq_flush_plug_list+0x6b0/0x18b0 block/blk-mq.c:2885 stack backtrace: CPU: 0 UID: 0 PID: 7380 Comm: syz.3.275 Not tainted 6.12.0-rc5-next-20241031-syzkaller #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 add_stack_record_to_list mm/page_owner.c:182 [inline] inc_stack_record_count mm/page_owner.c:214 [inline] __set_page_owner+0x5cb/0x800 mm/page_owner.c:329 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1541 prep_new_page mm/page_alloc.c:1549 [inline] get_page_from_freelist+0x3725/0x3870 mm/page_alloc.c:3495 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4771 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265 stack_depot_save_flags+0x666/0x830 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:1219 [inline] run_posix_cpu_timers+0x6ac/0x810 kernel/time/posix-cpu-timers.c:1418 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:1691 [inline] __hrtimer_run_queues+0x551/0xd50 kernel/time/hrtimer.c:1755 hrtimer_interrupt+0x396/0x990 kernel/time/hrtimer.c:1817 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 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline] RIP: 0010:_raw_spin_unlock_irq+0x29/0x50 kernel/locking/spinlock.c:202 Code: 90 f3 0f 1e fa 53 48 89 fb 48 83 c7 18 48 8b 74 24 08 e8 6a e5 a2 f5 48 89 df e8 a2 2c a4 f5 e8 dd 56 cf f5 fb bf 01 00 00 00 b2 9d 95 f5 65 8b 05 d3 42 36 74 85 c0 74 06 5b c3 cc cc cc cc RSP: 0018:ffffc9000340f118 EFLAGS: 00000286 RAX: f010e2eab9532500 RBX: ffff888024e850c0 RCX: ffffffff8170c69a RDX: dffffc0000000000 RSI: ffffffff8c0ad3a0 RDI: 0000000000000001 RBP: ffff88802930e860 R08: ffffffff942cd937 R09: 1ffffffff2859b26 R10: dffffc0000000000 R11: fffffbfff2859b27 R12: dffffc0000000000 R13: ffff888024f41490 R14: ffff88802930e860 R15: ffff88802930e868 spin_unlock_irq include/linux/spinlock.h:401 [inline] loop_queue_work drivers/block/loop.c:903 [inline] loop_queue_rq+0xa01/0xaf0 drivers/block/loop.c:1877 __blk_mq_issue_directly block/blk-mq.c:2665 [inline] blk_mq_request_issue_directly+0x352/0x6a0 block/blk-mq.c:2752 blk_mq_plug_issue_direct+0x22a/0x5c0 block/blk-mq.c:2773 blk_mq_flush_plug_list+0x860/0x18b0 block/blk-mq.c:2885 __blk_flush_plug+0x420/0x500 block/blk-core.c:1213 blk_finish_plug block/blk-core.c:1240 [inline] __submit_bio+0x466/0x560 block/blk-core.c:637 __submit_bio_noacct_mq block/blk-core.c:710 [inline] submit_bio_noacct_nocheck+0x4d3/0xe30 block/blk-core.c:739 mpage_bio_submit_read fs/mpage.c:75 [inline] do_mpage_readpage+0x197b/0x1c80 fs/mpage.c:307 mpage_read_folio+0x108/0x1e0 fs/mpage.c:392 filemap_read_folio+0x14b/0x630 mm/filemap.c:2366 do_read_cache_folio+0x3f5/0x850 mm/filemap.c:3826 read_mapping_folio include/linux/pagemap.h:1011 [inline] nilfs_get_folio+0x4b/0x240 fs/nilfs2/dir.c:190 nilfs_readdir+0x1b3/0x7d0 fs/nilfs2/dir.c:251 iterate_dir+0x571/0x800 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:407 [inline] __se_sys_getdents64+0x1d3/0x4a0 fs/readdir.c:392 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:0x7fdb4d17e719 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdb4df64038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007fdb4d335f80 RCX: 00007fdb4d17e719 RDX: 000000000000009c RSI: 0000000020000000 RDI: 0000000000000004 RBP: 00007fdb4d1f132e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fdb4d335f80 R15: 00007ffcbe6541b8 ---------------- Code disassembly (best guess): 0: 90 nop 1: f3 0f 1e fa endbr64 5: 53 push %rbx 6: 48 89 fb mov %rdi,%rbx 9: 48 83 c7 18 add $0x18,%rdi d: 48 8b 74 24 08 mov 0x8(%rsp),%rsi 12: e8 6a e5 a2 f5 call 0xf5a2e581 17: 48 89 df mov %rbx,%rdi 1a: e8 a2 2c a4 f5 call 0xf5a42cc1 1f: e8 dd 56 cf f5 call 0xf5cf5701 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 b2 9d 95 f5 call 0xf5959de1 <-- trapping instruction 2f: 65 8b 05 d3 42 36 74 mov %gs:0x743642d3(%rip),%eax # 0x74364309 36: 85 c0 test %eax,%eax 38: 74 06 je 0x40 3a: 5b pop %rbx 3b: c3 ret 3c: cc int3 3d: cc int3 3e: cc int3 3f: cc int3