================================ WARNING: inconsistent lock state 6.10.0-rc6-syzkaller-00163-g661e504db04c #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz.2.3696/23539 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff8880b9338a80 (lock#12){?.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b9338a80 (lock#12){?.+.}-{2:2}, at: __mmap_lock_do_trace_acquire_returned+0x7f/0x790 mm/mmap_lock.c:237 {HARDIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_acquire_returned+0x97/0x790 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 kernel/fork.c:1737 [inline] copy_process+0x8c5a/0x8f10 kernel/fork.c:2390 kernel_clone+0xfd/0x980 kernel/fork.c:2797 __do_sys_clone+0xba/0x100 kernel/fork.c:2940 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f irq event stamp: 14234 hardirqs last enabled at (14233): [] syscall_enter_from_user_mode include/linux/entry-common.h:197 [inline] hardirqs last enabled at (14233): [] do_syscall_64+0x91/0x250 arch/x86/entry/common.c:79 hardirqs last disabled at (14234): [] sysvec_call_function_single+0xe/0xb0 arch/x86/kernel/smp.c:266 softirqs last enabled at (14228): [] local_bh_enable include/linux/bottom_half.h:33 [inline] softirqs last enabled at (14228): [] fpregs_unlock arch/x86/include/asm/fpu/api.h:80 [inline] softirqs last enabled at (14228): [] restore_fpregs_from_user arch/x86/kernel/fpu/signal.c:331 [inline] softirqs last enabled at (14228): [] __fpu_restore_sig+0x62f/0x1430 arch/x86/kernel/fpu/signal.c:359 softirqs last disabled at (14226): [] local_bh_disable include/linux/bottom_half.h:20 [inline] softirqs last disabled at (14226): [] fpregs_lock arch/x86/include/asm/fpu/api.h:72 [inline] softirqs last disabled at (14226): [] restore_fpregs_from_user arch/x86/kernel/fpu/signal.c:285 [inline] softirqs last disabled at (14226): [] __fpu_restore_sig+0x2e1/0x1430 arch/x86/kernel/fpu/signal.c:359 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.2.3696/23539: #0: ffff88807d36f398 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:122 [inline] #0: ffff88807d36f398 (&mm->mmap_lock){++++}-{3:3}, at: do_madvise+0x1ea/0x7a0 mm/madvise.c:1439 #1: ffffffff8dbb1620 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #1: ffffffff8dbb1620 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #1: ffffffff8dbb1620 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2402 [inline] #1: ffffffff8dbb1620 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1c2/0x590 kernel/trace/bpf_trace.c:2444 stack backtrace: CPU: 1 PID: 23539 Comm: syz.2.3696 Not tainted 6.10.0-rc6-syzkaller-00163-g661e504db04c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_usage_bug kernel/locking/lockdep.c:3971 [inline] valid_state kernel/locking/lockdep.c:4013 [inline] mark_lock_irq kernel/locking/lockdep.c:4216 [inline] mark_lock+0x923/0xc60 kernel/locking/lockdep.c:4678 mark_usage kernel/locking/lockdep.c:4564 [inline] __lock_acquire+0x1359/0x3b30 kernel/locking/lockdep.c:5091 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_acquire_returned+0x97/0x790 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+0x5d9/0x7c0 kernel/bpf/stackmap.c:141 __bpf_get_stack+0x6bf/0x700 kernel/bpf/stackmap.c:449 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1994 [inline] bpf_get_stack_raw_tp+0x124/0x160 kernel/trace/bpf_trace.c:1984 ___bpf_prog_run+0x3e51/0xabd0 kernel/bpf/core.c:2011 __bpf_prog_run32+0xc1/0x100 kernel/bpf/core.c:2252 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+0x231/0x590 kernel/trace/bpf_trace.c:2444 __bpf_trace_tlb_flush+0xd2/0x110 include/trace/events/tlb.h:38 trace_tlb_flush+0xf3/0x170 include/trace/events/tlb.h:38 csd_do_func kernel/smp.c:133 [inline] __flush_smp_call_function_queue+0x27a/0x8c0 kernel/smp.c:511 __sysvec_call_function_single+0x8c/0x410 arch/x86/kernel/smp.c:271 instr_sysvec_call_function_single arch/x86/kernel/smp.c:266 [inline] sysvec_call_function_single+0x90/0xb0 arch/x86/kernel/smp.c:266 asm_sysvec_call_function_single+0x1a/0x20 arch/x86/include/asm/idtentry.h:709 RIP: 0010:__kasan_check_read+0x8/0x20 mm/kasan/shadow.c:31 Code: 60 48 c7 c7 20 00 27 8d 5b 5d 41 5c e9 81 a7 84 ff 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 48 8b 0c 24 <89> f6 31 d2 e9 2f f1 ff ff 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f RSP: 0018:ffffc900033c7c10 EFLAGS: 00000246 RAX: ffff8880b9200000 RBX: ffff88807d36f328 RCX: ffffffff816a66fd RDX: ffffed100fa6de67 RSI: 0000000000000008 RDI: ffff88807d36f330 RBP: ffff88807d36f330 R08: 0000000000000000 R09: ffffed100fa6de66 R10: ffff88807d36f337 R11: 0000000000000000 R12: ffff888016393c00 R13: ffffed10043c1b40 R14: dffffc0000000000 R15: ffff888016393c00 instrument_atomic_read include/linux/instrumented.h:68 [inline] atomic_long_read include/linux/atomic/atomic-instrumented.h:3188 [inline] rwsem_owner_flags kernel/locking/rwsem.c:284 [inline] rwsem_spin_on_owner+0x13d/0x2a0 kernel/locking/rwsem.c:767 rwsem_optimistic_spin kernel/locking/rwsem.c:839 [inline] rwsem_down_write_slowpath kernel/locking/rwsem.c:1113 [inline] __down_write_common+0x303/0x13f0 kernel/locking/rwsem.c:1306 __down_write_killable kernel/locking/rwsem.c:1320 [inline] down_write_killable+0x4b/0x70 kernel/locking/rwsem.c:1592 mmap_write_lock_killable include/linux/mmap_lock.h:122 [inline] do_madvise+0x1ea/0x7a0 mm/madvise.c:1439 __do_sys_madvise mm/madvise.c:1481 [inline] __se_sys_madvise mm/madvise.c:1479 [inline] __x64_sys_madvise+0xa9/0x110 mm/madvise.c:1479 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9cc3775bd9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f9cc44dc048 EFLAGS: 00000246 ORIG_RAX: 000000000000001c RAX: ffffffffffffffda RBX: 00007f9cc3903f60 RCX: 00007f9cc3775bd9 RDX: 000000000000000d RSI: 0000000000002000 RDI: 0000000020ffd000 RBP: 00007f9cc37e4aa1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f9cc3903f60 R15: 00007ffe19b3da08 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 48 c7 c7 20 00 27 8d mov $0xffffffff8d270020,%rdi 7: 5b pop %rbx 8: 5d pop %rbp 9: 41 5c pop %r12 b: e9 81 a7 84 ff jmp 0xff84a791 10: 90 nop 11: 90 nop 12: 90 nop 13: 90 nop 14: 90 nop 15: 90 nop 16: 90 nop 17: 90 nop 18: 90 nop 19: 90 nop 1a: 90 nop 1b: 90 nop 1c: 90 nop 1d: 90 nop 1e: 90 nop 1f: 90 nop 20: 90 nop 21: f3 0f 1e fa endbr64 25: 48 8b 0c 24 mov (%rsp),%rcx * 29: 89 f6 mov %esi,%esi <-- trapping instruction 2b: 31 d2 xor %edx,%edx 2d: e9 2f f1 ff ff jmp 0xfffff161 32: 66 66 2e 0f 1f 84 00 data16 cs nopw 0x0(%rax,%rax,1) 39: 00 00 00 00 3d: 0f .byte 0xf 3e: 1f (bad)