================================ WARNING: inconsistent lock state 6.10.0-rc1-syzkaller-00304-g83814698cf48 #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz-executor.1/5336 [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_acquire_returned+0xa8/0x630 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_write_lock_killable include/linux/mmap_lock.h:123 [inline] dup_mmap kernel/fork.c:638 [inline] dup_mm kernel/fork.c:1688 [inline] copy_mm+0x1f8c/0x2020 kernel/fork.c:1737 copy_process+0x187a/0x3dc0 kernel/fork.c:2390 kernel_clone+0x226/0x8f0 kernel/fork.c:2797 __do_sys_clone kernel/fork.c:2940 [inline] __se_sys_clone kernel/fork.c:2924 [inline] __x64_sys_clone+0x258/0x2a0 kernel/fork.c:2924 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: 36804 hardirqs last enabled at (36803): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline] hardirqs last enabled at (36803): [] _raw_spin_unlock_irqrestore+0x8f/0x140 kernel/locking/spinlock.c:194 hardirqs last disabled at (36804): [] sysvec_call_function_single+0xe/0xc0 arch/x86/kernel/smp.c:266 softirqs last enabled at (34732): [] __do_softirq kernel/softirq.c:588 [inline] softirqs last enabled at (34732): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last enabled at (34732): [] __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637 softirqs last disabled at (34705): [] __do_softirq kernel/softirq.c:588 [inline] softirqs last disabled at (34705): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last disabled at (34705): [] __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(lock#10); lock(lock#10); *** DEADLOCK *** 5 locks held by syz-executor.1/5336: #0: ffff88807ebc1e18 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:144 [inline] #0: ffff88807ebc1e18 (&mm->mmap_lock){++++}-{3:3}, at: do_madvise+0x481/0x4590 mm/madvise.c:1442 #1: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #1: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #1: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: __pte_offset_map+0x82/0x380 mm/pgtable-generic.c:287 #2: ffff88802ddab618 (ptlock_ptr(ptdesc)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] #2: ffff88802ddab618 (ptlock_ptr(ptdesc)#2){+.+.}-{2:2}, at: __pte_offset_map_lock+0x1ba/0x300 mm/pgtable-generic.c:375 #3: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #3: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #3: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2402 [inline] #3: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2444 #4: ffff88807ebc1e18 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] #4: ffff88807ebc1e18 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x237/0x9d0 kernel/bpf/stackmap.c:141 stack backtrace: CPU: 1 PID: 5336 Comm: syz-executor.1 Not tainted 6.10.0-rc1-syzkaller-00304-g83814698cf48 #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_get_stack_raw_tp kernel/trace/bpf_trace.c:1994 [inline] bpf_get_stack_raw_tp+0x1a3/0x240 kernel/trace/bpf_trace.c:1984 bpf_prog_ec3b2eefa702d8d3+0x42/0x4a 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_trace_run kernel/trace/bpf_trace.c:2403 [inline] bpf_trace_run2+0x2ee/0x540 kernel/trace/bpf_trace.c:2444 trace_tlb_flush+0x118/0x140 include/trace/events/tlb.h:38 flush_tlb_func+0x4e7/0x630 arch/x86/mm/tlb.c:892 csd_do_func kernel/smp.c:133 [inline] __flush_smp_call_function_queue+0x3fe/0x1690 kernel/smp.c:511 __sysvec_call_function_single+0xb8/0x430 arch/x86/kernel/smp.c:271 instr_sysvec_call_function_single arch/x86/kernel/smp.c:266 [inline] sysvec_call_function_single+0x9e/0xc0 arch/x86/kernel/smp.c:266 asm_sysvec_call_function_single+0x1a/0x20 arch/x86/include/asm/idtentry.h:709 RIP: 0010:arch_atomic_read arch/x86/include/asm/atomic.h:23 [inline] RIP: 0010:raw_atomic_read include/linux/atomic/atomic-arch-fallback.h:457 [inline] RIP: 0010:rcu_dynticks_curr_cpu_in_eqs include/linux/context_tracking.h:122 [inline] RIP: 0010:rcu_is_watching+0x4e/0xb0 kernel/rcu/tree.c:724 Code: ff df 4c 8d 34 dd e0 b9 db 8d 4c 89 f0 48 c1 e8 03 42 80 3c 38 00 74 08 4c 89 f7 e8 9c 8f 7f 00 48 c7 c3 08 7d 03 00 49 03 1e <48> 89 d8 48 c1 e8 03 42 0f b6 04 38 84 c0 75 22 8b 03 65 ff 0d 01 RSP: 0018:ffffc90002ea71e0 EFLAGS: 00000282 RAX: 1ffffffff1bb773d RBX: ffff8880b9537d08 RCX: ffffffff81725554 RDX: 0000000000000000 RSI: ffffffff8c1ff220 RDI: ffffffff8c1ff1e0 RBP: ffffc90002ea7348 R08: ffffffff8fad456f R09: 1ffffffff1f5a8ad R10: dffffc0000000000 R11: fffffbfff1f5a8ae R12: 1ffff920005d4e48 R13: dffffc0000000000 R14: ffffffff8ddbb9e8 R15: dffffc0000000000 trace_lock_acquire include/trace/events/lock.h:24 [inline] lock_acquire+0xe3/0x550 kernel/locking/lockdep.c:5725 rcu_lock_acquire include/linux/rcupdate.h:329 [inline] rcu_read_lock include/linux/rcupdate.h:781 [inline] __lruvec_stat_mod_folio+0x9a/0x300 mm/memcontrol.c:1061 __folio_remove_rmap mm/rmap.c:1556 [inline] folio_remove_rmap_ptes+0x2bf/0x4f0 mm/rmap.c:1595 zap_present_folio_ptes mm/memory.c:1505 [inline] zap_present_ptes mm/memory.c:1570 [inline] zap_pte_range mm/memory.c:1612 [inline] zap_pmd_range mm/memory.c:1730 [inline] zap_pud_range mm/memory.c:1759 [inline] zap_p4d_range mm/memory.c:1780 [inline] unmap_page_range+0x191f/0x4d00 mm/memory.c:1801 zap_page_range_single+0x45c/0x630 mm/memory.c:1926 madvise_dontneed_single_vma mm/madvise.c:846 [inline] madvise_dontneed_free mm/madvise.c:927 [inline] madvise_vma_behavior mm/madvise.c:1046 [inline] madvise_walk_vmas mm/madvise.c:1268 [inline] do_madvise+0x20a9/0x4590 mm/madvise.c:1464 __do_sys_madvise mm/madvise.c:1481 [inline] __se_sys_madvise mm/madvise.c:1479 [inline] __x64_sys_madvise+0xa6/0xc0 mm/madvise.c:1479 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:0x7ff423c7cee9 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:00007ff4249340c8 EFLAGS: 00000246 ORIG_RAX: 000000000000001c RAX: ffffffffffffffda RBX: 00007ff423db4070 RCX: 00007ff423c7cee9 RDX: 0000000000000004 RSI: 0000000000c00003 RDI: 0000000020000000 RBP: 00007ff423cc947f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007ff423db4070 R15: 00007ffcbf81d588 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: df 4c 8d 34 fisttps 0x34(%rbp,%rcx,4) 4: dd e0 fucom %st(0) 6: b9 db 8d 4c 89 mov $0x894c8ddb,%ecx b: f0 48 c1 e8 03 lock shr $0x3,%rax 10: 42 80 3c 38 00 cmpb $0x0,(%rax,%r15,1) 15: 74 08 je 0x1f 17: 4c 89 f7 mov %r14,%rdi 1a: e8 9c 8f 7f 00 call 0x7f8fbb 1f: 48 c7 c3 08 7d 03 00 mov $0x37d08,%rbx 26: 49 03 1e add (%r14),%rbx * 29: 48 89 d8 mov %rbx,%rax <-- trapping instruction 2c: 48 c1 e8 03 shr $0x3,%rax 30: 42 0f b6 04 38 movzbl (%rax,%r15,1),%eax 35: 84 c0 test %al,%al 37: 75 22 jne 0x5b 39: 8b 03 mov (%rbx),%eax 3b: 65 gs 3c: ff .byte 0xff 3d: 0d .byte 0xd 3e: 01 .byte 0x1