================================ WARNING: inconsistent lock state 6.1.89-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor411/3719 [HC0[0]:SC1[1]:HE0:SE0] takes: ffff8880b9935e90 (lock#9){+.?.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b9935e90 (lock#9){+.?.}-{2:2}, at: __mmap_lock_do_trace_acquire_returned+0x84/0x670 mm/mmap_lock.c:237 {SOFTIRQ-ON-W} state was registered at: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_acquire_returned+0x9d/0x670 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_read_trylock include/linux/mmap_lock.h:137 [inline] get_mmap_lock_carefully mm/memory.c:5304 [inline] lock_mm_and_find_vma+0x219/0x2e0 mm/memory.c:5366 do_user_addr_fault arch/x86/mm/fault.c:1343 [inline] handle_page_fault arch/x86/mm/fault.c:1462 [inline] exc_page_fault+0x169/0x660 arch/x86/mm/fault.c:1518 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 irq event stamp: 285 hardirqs last enabled at (284): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (284): [] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 hardirqs last disabled at (285): [] queue_work_on+0xf6/0x250 kernel/workqueue.c:1545 softirqs last enabled at (0): [] rcu_lock_acquire include/linux/rcupdate.h:350 [inline] softirqs last enabled at (0): [] rcu_read_lock include/linux/rcupdate.h:791 [inline] softirqs last enabled at (0): [] copy_process+0x9e1/0x4060 kernel/fork.c:2132 softirqs last disabled at (281): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last disabled at (281): [] __irq_exit_rcu+0x155/0x240 kernel/softirq.c:650 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(lock#9); lock(lock#9); *** DEADLOCK *** 8 locks held by syz-executor411/3719: #0: ffff88807e1288d8 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88807e1288d8 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5304 [inline] #0: ffff88807e1288d8 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x2e/0x2e0 mm/memory.c:5366 #1: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #1: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #1: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: filemap_map_pages+0x277/0x12c0 mm/filemap.c:3415 #2: ffff888021c99c78 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] #2: ffff888021c99c78 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: filemap_map_pages+0x958/0x12c0 mm/filemap.c:3426 #3: ffffc900001e0bc0 ((&sdp->delay_work)){+.-.}-{0:0}, at: call_timer_fn+0xc2/0x6b0 kernel/time/timer.c:1501 #4: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #4: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #4: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: __queue_work+0xe5/0xf90 kernel/workqueue.c:1443 #5: ffff8880b983a258 (&pool->lock){-.-.}-{2:2}, at: __queue_work+0x58c/0xf90 #6: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #6: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #6: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] #6: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run3+0x146/0x440 kernel/trace/bpf_trace.c:2313 #7: ffff88807e1288d8 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #7: ffff88807e1288d8 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x232/0x9c0 kernel/bpf/stackmap.c:144 stack backtrace: CPU: 1 PID: 3719 Comm: syz-executor411 Not tainted 6.1.89-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 valid_state+0x136/0x1c0 kernel/locking/lockdep.c:3969 mark_lock_irq+0xa8/0xba0 kernel/locking/lockdep.c:4172 mark_lock+0x21c/0x340 kernel/locking/lockdep.c:4628 __lock_acquire+0xb7f/0x1f80 kernel/locking/lockdep.c:5003 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_acquire_returned+0x9d/0x670 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_read_trylock include/linux/mmap_lock.h:137 [inline] stack_map_get_build_id_offset+0x99e/0x9c0 kernel/bpf/stackmap.c:144 __bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:452 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1877 [inline] bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1867 bpf_prog_e6cf5f9c69743609+0x3a/0x3e bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run3+0x231/0x440 kernel/trace/bpf_trace.c:2313 __traceiter_workqueue_queue_work+0x79/0xd0 include/trace/events/workqueue.h:23 trace_workqueue_queue_work include/trace/events/workqueue.h:23 [inline] __queue_work+0xeeb/0xf90 kernel/workqueue.c:1500 queue_work_on+0x14b/0x250 kernel/workqueue.c:1548 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1504 expire_timers kernel/time/timer.c:1549 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1820 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833 __do_softirq+0x2e9/0xa4c kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x155/0x240 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 RIP: 0010:constant_test_bit arch/x86/include/asm/bitops.h:207 [inline] RIP: 0010:arch_test_bit arch/x86/include/asm/bitops.h:239 [inline] RIP: 0010:_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline] RIP: 0010:PageSwapBacked include/linux/page-flags.h:502 [inline] RIP: 0010:mm_counter_file+0xd5/0x2c0 include/linux/mm.h:2125 Code: 83 e6 01 31 ff e8 ab 57 bd ff 48 89 d8 48 83 e0 01 75 5f 0f 1f 44 00 00 e8 b8 53 bd ff 4c 89 f7 be 08 00 00 00 e8 7b cc 14 00 <4c> 89 f0 48 c1 e8 03 42 80 3c 20 00 74 08 4c 89 f7 e8 d5 ca 14 00 RSP: 0000:ffffc90003aff988 EFLAGS: 00000256 RAX: ffffffff81cd3b01 RBX: ffffea0001c32e88 RCX: ffffffff81cd3bb5 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffea0001c32ec0 RBP: ffffc90003affa90 R08: dffffc0000000000 R09: fffff940003865d9 R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000 R13: 1ffffd40003865d9 R14: ffffea0001c32ec0 R15: ffffea0001c32ec8 do_set_pte+0x2fe/0x590 mm/memory.c:4404 filemap_map_pages+0xc7c/0x12c0 mm/filemap.c:3452 do_fault_around mm/memory.c:4581 [inline] do_read_fault mm/memory.c:4607 [inline] do_fault mm/memory.c:4741 [inline] handle_pte_fault mm/memory.c:5013 [inline] __handle_mm_fault mm/memory.c:5155 [inline] handle_mm_fault+0x33e2/0x5340 mm/memory.c:5276 do_user_addr_fault arch/x86/mm/fault.c:1371 [inline] handle_page_fault arch/x86/mm/fault.c:1462 [inline] exc_page_fault+0x26f/0x660 arch/x86/mm/fault.c:1518 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x7fb1275148e0 Code: e9 75 e6 ff ff e8 90 be fe ff ba 01 00 00 00 e9 d9 f2 ff ff b8 01 00 00 00 e9 8f e7 ff ff ba 01 00 00 00 e9 a9 ee ff ff 66 90 <41> 57 41 56 41 55 49 89 d5 41 54 55 53 48 89 fb 48 81 ec 18 05 00 RSP: 002b:00007ffda18dfe48 EFLAGS: 00010206 RAX: 00007ffda18e0000 RBX: 00007ffda18e0000 RCX: 0000000000000000 RDX: 00007ffda18dffe8 RSI: 00007fb12754801d RDI: 00007ffda18dfe60 RBP: 00007ffda18dff50 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb12754801d R13: 00007ffda18dffe8 R14: 0000000000000000 R15: 00007ffda18dfe60 ---------------- Code disassembly (best guess): 0: 83 e6 01 and $0x1,%esi 3: 31 ff xor %edi,%edi 5: e8 ab 57 bd ff call 0xffbd57b5 a: 48 89 d8 mov %rbx,%rax d: 48 83 e0 01 and $0x1,%rax 11: 75 5f jne 0x72 13: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 18: e8 b8 53 bd ff call 0xffbd53d5 1d: 4c 89 f7 mov %r14,%rdi 20: be 08 00 00 00 mov $0x8,%esi 25: e8 7b cc 14 00 call 0x14cca5 * 2a: 4c 89 f0 mov %r14,%rax <-- trapping instruction 2d: 48 c1 e8 03 shr $0x3,%rax 31: 42 80 3c 20 00 cmpb $0x0,(%rax,%r12,1) 36: 74 08 je 0x40 38: 4c 89 f7 mov %r14,%rdi 3b: e8 d5 ca 14 00 call 0x14cb15