================================ WARNING: inconsistent lock state 6.9.0-syzkaller-12162-gf85af9d955ac #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz-executor.0/8656 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff8880b9538828 (lock#10){?.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b9538828 (lock#10){?.+.}-{2:2}, at: __mmap_lock_do_trace_acquire_returned+0x8f/0x630 mm/mmap_lock.c:237 {HARDIRQ-ON-W} state was registered at: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_start_locking+0x9c/0x620 mm/mmap_lock.c:230 __mmap_lock_trace_start_locking include/linux/mmap_lock.h:29 [inline] mmap_write_lock_killable include/linux/mmap_lock.h:121 [inline] vm_mmap_pgoff+0x37a/0x3d0 mm/util.c:571 ksys_mmap_pgoff+0x4f1/0x720 mm/mmap.c:1433 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 irq event stamp: 2014 hardirqs last enabled at (2013): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1418 [inline] hardirqs last enabled at (2013): [] finish_lock_switch kernel/sched/core.c:5162 [inline] hardirqs last enabled at (2013): [] finish_task_switch+0x1e5/0x870 kernel/sched/core.c:5280 hardirqs last disabled at (2014): [] sysvec_irq_work+0xe/0xc0 arch/x86/kernel/irq_work.c:17 softirqs last enabled at (1952): [] bpf_prog_load+0x1881/0x20f0 kernel/bpf/syscall.c:2934 softirqs last disabled at (1950): [] spin_lock_bh include/linux/spinlock.h:356 [inline] softirqs last disabled at (1950): [] bpf_ksym_add+0x30/0x370 kernel/bpf/core.c:660 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(lock#10); lock(lock#10); *** DEADLOCK *** 2 locks held by syz-executor.0/8656: #0: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: trace_call_bpf+0xbc/0x8a0 #1: ffff888023309e18 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] #1: ffff888023309e18 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x237/0x9d0 kernel/bpf/stackmap.c:141 stack backtrace: CPU: 1 PID: 8656 Comm: syz-executor.0 Not tainted 6.9.0-syzkaller-12162-gf85af9d955ac #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 valid_state+0x13a/0x1c0 kernel/locking/lockdep.c:4013 mark_lock_irq+0xbb/0xc20 kernel/locking/lockdep.c:4216 mark_lock+0x223/0x350 kernel/locking/lockdep.c:4678 mark_usage kernel/locking/lockdep.c:4564 [inline] __lock_acquire+0xb8e/0x1fd0 kernel/locking/lockdep.c:5091 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_acquire_returned+0xa8/0x630 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:164 [inline] stack_map_get_build_id_offset+0x9af/0x9d0 kernel/bpf/stackmap.c:141 __bpf_get_stack+0x4ad/0x5a0 kernel/bpf/stackmap.c:449 bpf_prog_e6cf5f9c69743609+0x42/0x46 bpf_dispatcher_nop_func include/linux/bpf.h:1243 [inline] __bpf_prog_run include/linux/filter.h:691 [inline] bpf_prog_run include/linux/filter.h:698 [inline] bpf_prog_run_array include/linux/bpf.h:2104 [inline] trace_call_bpf+0x369/0x8a0 kernel/trace/bpf_trace.c:147 perf_trace_run_bpf_submit+0x7c/0x1d0 kernel/events/core.c:10269 perf_trace_lock_acquire+0x3c3/0x4f0 include/trace/events/lock.h:24 trace_lock_acquire include/trace/events/lock.h:24 [inline] lock_acquire+0x51b/0x550 kernel/locking/lockdep.c:5725 rcu_lock_acquire include/linux/rcupdate.h:329 [inline] rcu_read_lock include/linux/rcupdate.h:781 [inline] group_send_sig_info+0xa3/0x310 kernel/signal.c:1446 do_bpf_send_signal+0x85/0x190 kernel/trace/bpf_trace.c:838 irq_work_single+0xe2/0x240 kernel/irq_work.c:221 irq_work_run_list kernel/irq_work.c:252 [inline] irq_work_run+0x18b/0x350 kernel/irq_work.c:261 __sysvec_irq_work+0xb8/0x430 arch/x86/kernel/irq_work.c:22 instr_sysvec_irq_work arch/x86/kernel/irq_work.c:17 [inline] sysvec_irq_work+0x9e/0xc0 arch/x86/kernel/irq_work.c:17 asm_sysvec_irq_work+0x1a/0x20 arch/x86/include/asm/idtentry.h:738 RIP: 0010:finish_task_switch+0x1ea/0x870 kernel/sched/core.c:5282 Code: c9 50 e8 99 c9 0b 00 48 83 c4 08 4c 89 f7 e8 cd 38 00 00 0f 1f 44 00 00 4c 89 f7 e8 f0 46 2a 0a e8 bb f6 36 00 fb 48 8b 5d c0 <48> 8d bb f8 15 00 00 48 89 f8 48 c1 e8 03 49 be 00 00 00 00 00 fc RSP: 0018:ffffc90002e677a8 EFLAGS: 00000286 RAX: ebf64738b452c800 RBX: ffff888020e43c00 RCX: ffffffff947a0603 RDX: dffffc0000000000 RSI: ffffffff8bcab880 RDI: ffffffff8c1fe500 RBP: ffffc90002e677f0 R08: ffffffff8fad366f R09: 1ffffffff1f5a6cd R10: dffffc0000000000 R11: fffffbfff1f5a6ce R12: 1ffff110172a7ea7 R13: dffffc0000000000 R14: ffff8880b953e7c0 R15: ffff8880b953f538 context_switch kernel/sched/core.c:5411 [inline] __schedule+0x17f0/0x4a20 kernel/sched/core.c:6745 __schedule_loop kernel/sched/core.c:6822 [inline] schedule+0x14b/0x320 kernel/sched/core.c:6837 futex_wait_queue+0x14e/0x1d0 kernel/futex/waitwake.c:370 __futex_wait+0x17f/0x320 kernel/futex/waitwake.c:669 futex_wait+0x101/0x360 kernel/futex/waitwake.c:697 do_futex+0x33b/0x560 kernel/futex/syscalls.c:102 __do_sys_futex kernel/futex/syscalls.c:179 [inline] __se_sys_futex+0x3f9/0x480 kernel/futex/syscalls.c:160 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:0x7ff8e2e7cf69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ff8e3c3e178 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: ffffffffffffffda RBX: 00007ff8e2fb3f88 RCX: 00007ff8e2e7cf69 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007ff8e2fb3f88 RBP: 00007ff8e2fb3f80 R08: 00007ff8e3c3e6c0 R09: 00007ff8e3c3e6c0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff8e2fb3f8c R13: 000000000000000b R14: 00007ffcdaf1f2b0 R15: 00007ffcdaf1f398 ---------------- Code disassembly (best guess): 0: c9 leave 1: 50 push %rax 2: e8 99 c9 0b 00 call 0xbc9a0 7: 48 83 c4 08 add $0x8,%rsp b: 4c 89 f7 mov %r14,%rdi e: e8 cd 38 00 00 call 0x38e0 13: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 18: 4c 89 f7 mov %r14,%rdi 1b: e8 f0 46 2a 0a call 0xa2a4710 20: e8 bb f6 36 00 call 0x36f6e0 25: fb sti 26: 48 8b 5d c0 mov -0x40(%rbp),%rbx * 2a: 48 8d bb f8 15 00 00 lea 0x15f8(%rbx),%rdi <-- trapping instruction 31: 48 89 f8 mov %rdi,%rax 34: 48 c1 e8 03 shr $0x3,%rax 38: 49 rex.WB 39: be 00 00 00 00 mov $0x0,%esi 3e: 00 fc add %bh,%ah