================================ WARNING: inconsistent lock state 6.1.85-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor109/3956 [HC0[0]:SC1[1]:HE0:SE0] takes: ffff8880b9835e90 (lock#9){+.?.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b9835e90 (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 __put_user_nocheck_4+0x3/0x11 schedule_tail+0x91/0xb0 kernel/sched/core.c:5184 ret_from_fork+0x8/0x30 arch/x86/entry/entry_64.S:293 irq event stamp: 279 hardirqs last enabled at (278): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline] hardirqs last enabled at (278): [] _raw_spin_unlock_irqrestore+0x8b/0x130 kernel/locking/spinlock.c:194 hardirqs last disabled at (279): [] 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 (245): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last disabled at (245): [] __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 *** 9 locks held by syz-executor109/3956: #0: ffff888078fa17d8 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff888078fa17d8 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5304 [inline] #0: ffff888078fa17d8 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x2e/0x2e0 mm/memory.c:5366 #1: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #1: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #1: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: filemap_map_pages+0x277/0x12c0 mm/filemap.c:3415 #2: ffff88807791c4f8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] #2: ffff88807791c4f8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: filemap_map_pages+0x958/0x12c0 mm/filemap.c:3426 #3: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #3: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #3: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: folio_memcg_lock+0x85/0x380 mm/memcontrol.c:2098 #4: ffffffff8d12ad00 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #4: ffffffff8d12ad00 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2291 [inline] #4: ffffffff8d12ad00 (rcu_callback){....}-{0:0}, at: rcu_core+0xa64/0x17e0 kernel/rcu/tree.c:2556 #5: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #5: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #5: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: __queue_work+0xe5/0xf90 kernel/workqueue.c:1443 #6: ffff8880b983a258 (&pool->lock){-.-.}-{2:2}, at: __queue_work+0x58c/0xf90 #7: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #7: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #7: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] #7: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run3+0x146/0x440 kernel/trace/bpf_trace.c:2313 #8: ffff888078fa17d8 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #8: ffff888078fa17d8 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x232/0x9c0 kernel/bpf/stackmap.c:144 stack backtrace: CPU: 0 PID: 3956 Comm: syz-executor109 Not tainted 6.1.85-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 rcu_do_batch kernel/rcu/tree.c:2296 [inline] rcu_core+0xad4/0x17e0 kernel/rcu/tree.c:2556 __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:instrument_atomic_read include/linux/instrumented.h:72 [inline] RIP: 0010:atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] RIP: 0010:folio_memcg_lock+0x227/0x380 mm/memcontrol.c:2113 Code: 89 fe 74 0a 48 8d 7c 24 40 e8 c5 23 f9 ff f6 44 24 41 02 0f 85 88 00 00 00 41 f7 c4 00 02 00 00 74 01 fb 49 8d 9d 40 09 00 00 <48> 89 df be 04 00 00 00 e8 2c 25 f9 ff 48 89 d8 48 c1 e8 03 48 b9 RSP: 0000:ffffc9000af7f880 EFLAGS: 00000206 RAX: dffffc0000000000 RBX: ffff888140058940 RCX: 1ffff920015eff18 RDX: dffffc0000000000 RSI: ffffffff8aec01c0 RDI: ffffffff8b3d4120 RBP: ffffc9000af7f948 R08: dffffc0000000000 R09: fffffbfff2093045 R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000246 R13: ffff888140058000 R14: 1ffff920015eff1c R15: 1ffff920015eff1c page_add_file_rmap+0xe2/0x12f0 mm/rmap.c:1293 do_set_pte+0x381/0x590 mm/memory.c:4405 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:0x7f26614c51a0 Code: 7f 38 48 85 ff 74 05 f6 03 01 74 16 48 c7 43 38 00 00 00 00 48 89 df 31 f6 5b e9 bb eb ff ff 0f 1f 00 e8 63 57 00 00 eb e3 90 <41> 55 49 89 cd 41 54 49 89 f4 55 53 48 89 fb 48 83 ec 08 48 85 d2 RSP: 002b:00007ffc357f8b18 EFLAGS: 00010286 RAX: 00007f266155ed80 RBX: 00007ffc357f8cd0 RCX: 00007ffc357f8cd0 RDX: 00000000000003ff RSI: 00007ffc357f8cd0 RDI: 00007ffc357f8b30 RBP: 00007ffc357f8c20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f266152f01d R13: 00007ffc357f8cb8 R14: 0000000000000000 R15: 00007ffc357f8b30 ---------------- Code disassembly (best guess): 0: 89 fe mov %edi,%esi 2: 74 0a je 0xe 4: 48 8d 7c 24 40 lea 0x40(%rsp),%rdi 9: e8 c5 23 f9 ff call 0xfff923d3 e: f6 44 24 41 02 testb $0x2,0x41(%rsp) 13: 0f 85 88 00 00 00 jne 0xa1 19: 41 f7 c4 00 02 00 00 test $0x200,%r12d 20: 74 01 je 0x23 22: fb sti 23: 49 8d 9d 40 09 00 00 lea 0x940(%r13),%rbx * 2a: 48 89 df mov %rbx,%rdi <-- trapping instruction 2d: be 04 00 00 00 mov $0x4,%esi 32: e8 2c 25 f9 ff call 0xfff92563 37: 48 89 d8 mov %rbx,%rax 3a: 48 c1 e8 03 shr $0x3,%rax 3e: 48 rex.W 3f: b9 .byte 0xb9