================================ WARNING: inconsistent lock state 5.15.164-syzkaller #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz.3.1010/7844 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff8880b9b35bb8 (lock#12){?.+.}-{2:2}, at: local_lock_acquire+0xd/0x170 include/linux/local_lock_internal.h:28 {HARDIRQ-ON-W} state was registered at: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 local_lock_acquire+0x29/0x170 include/linux/local_lock_internal.h:29 __mmap_lock_do_trace_acquire_returned+0x7c/0x340 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+0x612/0x930 kernel/bpf/stackmap.c:185 __bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:496 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1490 [inline] bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1480 bpf_prog_ec3b2eefa702d8d3+0x3a/0x2b0 bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline] __bpf_prog_run include/linux/filter.h:628 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline] bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1917 trace_tlb_flush+0xed/0x110 include/trace/events/tlb.h:38 native_flush_tlb_multi+0x74/0xd0 __flush_tlb_multi arch/x86/include/asm/paravirt.h:87 [inline] flush_tlb_multi arch/x86/mm/tlb.c:900 [inline] flush_tlb_mm_range+0x2a5/0x4a0 arch/x86/mm/tlb.c:986 flush_tlb_page arch/x86/include/asm/tlbflush.h:239 [inline] ptep_clear_flush+0x112/0x150 mm/pgtable-generic.c:97 wp_page_copy+0xdfe/0x2070 mm/memory.c:3085 handle_pte_fault mm/memory.c:4639 [inline] __handle_mm_fault mm/memory.c:4756 [inline] handle_mm_fault+0x2a3d/0x5950 mm/memory.c:4854 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 copy_user_enhanced_fast_string+0xe/0x40 arch/x86/lib/copy_user_64.S:205 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline] copyout lib/iov_iter.c:157 [inline] copy_page_to_iter_iovec lib/iov_iter.c:228 [inline] __copy_page_to_iter lib/iov_iter.c:861 [inline] copy_page_to_iter+0x49a/0x10d0 lib/iov_iter.c:889 process_vm_rw_pages mm/process_vm_access.c:45 [inline] process_vm_rw_single_vec mm/process_vm_access.c:117 [inline] process_vm_rw_core mm/process_vm_access.c:215 [inline] process_vm_rw+0x886/0xcc0 mm/process_vm_access.c:283 __do_sys_process_vm_readv mm/process_vm_access.c:295 [inline] __se_sys_process_vm_readv mm/process_vm_access.c:291 [inline] __x64_sys_process_vm_readv+0xdc/0xf0 mm/process_vm_access.c:291 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 irq event stamp: 8890 hardirqs last enabled at (8889): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (8889): [] _raw_spin_unlock_irqrestore+0x8b/0x130 kernel/locking/spinlock.c:194 hardirqs last disabled at (8890): [] sysvec_call_function_single+0xa/0xb0 arch/x86/kernel/smp.c:243 softirqs last enabled at (6192): [] __do_softirq kernel/softirq.c:592 [inline] softirqs last enabled at (6192): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last enabled at (6192): [] __irq_exit_rcu+0x157/0x240 kernel/softirq.c:641 softirqs last disabled at (6187): [] __do_softirq kernel/softirq.c:592 [inline] softirqs last disabled at (6187): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last disabled at (6187): [] __irq_exit_rcu+0x157/0x240 kernel/softirq.c:641 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(lock#12); lock(lock#12); *** DEADLOCK *** 2 locks held by syz.3.1010/7844: #0: ffffffff8c91fb20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 #1: ffff888023c08f28 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #1: ffff888023c08f28 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x23e/0x930 kernel/bpf/stackmap.c:185 stack backtrace: CPU: 1 PID: 7844 Comm: syz.3.1010 Not tainted 5.15.164-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 valid_state+0x134/0x1c0 kernel/locking/lockdep.c:3932 mark_lock_irq+0xa8/0xba0 kernel/locking/lockdep.c:4135 mark_lock+0x21a/0x340 kernel/locking/lockdep.c:4591 mark_usage kernel/locking/lockdep.c:4483 [inline] __lock_acquire+0xb5c/0x1ff0 kernel/locking/lockdep.c:4966 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 local_lock_acquire+0x29/0x170 include/linux/local_lock_internal.h:29 __mmap_lock_do_trace_acquire_returned+0x7c/0x340 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+0x612/0x930 kernel/bpf/stackmap.c:185 __bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:496 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1490 [inline] bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1480 bpf_prog_ec3b2eefa702d8d3+0x3a/0x2b0 bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline] __bpf_prog_run include/linux/filter.h:628 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline] bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1917 trace_tlb_flush+0xed/0x110 include/trace/events/tlb.h:38 flush_tlb_func+0x480/0x590 arch/x86/mm/tlb.c:851 flush_smp_call_function_queue+0x2b5/0x760 kernel/smp.c:628 __sysvec_call_function_single+0x9a/0x250 arch/x86/kernel/smp.c:248 sysvec_call_function_single+0x89/0xb0 arch/x86/kernel/smp.c:243 asm_sysvec_call_function_single+0x16/0x20 arch/x86/include/asm/idtentry.h:646 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194 Code: 9c 8f 44 24 20 42 80 3c 23 00 74 08 4c 89 f7 e8 f2 90 8d f7 f6 44 24 21 02 75 4e 41 f7 c7 00 02 00 00 74 01 fb bf 01 00 00 00 97 c6 1a f7 65 8b 05 58 cb c5 75 85 c0 74 3f 48 c7 04 24 0e 36 RSP: 0018:ffffc90002f57ba0 EFLAGS: 00000206 RAX: 00db0dfa8b531a00 RBX: 1ffff920005eaf78 RCX: ffffffff91467f03 RDX: dffffc0000000000 RSI: ffffffff8a8b2a00 RDI: 0000000000000001 RBP: ffffc90002f57c30 R08: ffffffff8186e200 R09: ffffed1017365441 R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000 R13: 1ffff920005eaf74 R14: ffffc90002f57bc0 R15: 0000000000000246 hrtimer_start_expires include/linux/hrtimer.h:434 [inline] hrtimer_sleeper_start_expires kernel/time/hrtimer.c:1966 [inline] do_nanosleep+0x164/0x7b0 kernel/time/hrtimer.c:2042 hrtimer_nanosleep+0x24d/0x490 kernel/time/hrtimer.c:2098 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1313 [inline] __se_sys_clock_nanosleep+0x323/0x3b0 kernel/time/posix-timers.c:1290 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7faba8bc89e5 Code: 24 0c 89 3c 24 48 89 4c 24 18 e8 c6 57 ff ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 8b 74 24 0c 8b 3c 24 b8 e6 00 00 00 0f 05 <44> 89 c7 48 89 04 24 e8 1f 58 ff ff 48 8b 04 24 48 83 c4 28 f7 d8 RSP: 002b:00007ffd118a2cd0 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6 RAX: ffffffffffffffda RBX: 00007faba8d24f80 RCX: 00007faba8bc89e5 RDX: 00007ffd118a2d10 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007faba8d26a80 R08: 0000000000000000 R09: 0000000000000010 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000049698 R13: 00007ffd118a2e30 R14: 00007ffd118a2e50 R15: ffffffffffffffff ---------------- 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 f2 90 8d f7 call 0xf78d9106 14: f6 44 24 21 02 testb $0x2,0x21(%rsp) 19: 75 4e jne 0x69 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 97 c6 1a f7 call 0xf71ac6c6 <-- trapping instruction 2f: 65 8b 05 58 cb c5 75 mov %gs:0x75c5cb58(%rip),%eax # 0x75c5cb8e 36: 85 c0 test %eax,%eax 38: 74 3f je 0x79 3a: 48 rex.W 3b: c7 .byte 0xc7 3c: 04 24 add $0x24,%al 3e: 0e (bad) 3f: 36 ss