================================ WARNING: inconsistent lock state 6.10.0-syzkaller-04558-g6189fa6faa09 #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz.4.419/6832 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff8880b9238798 (lock#10){?.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b9238798 (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:5753 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_lock include/linux/mmap_lock.h:145 [inline] exit_mm+0x2de/0x310 kernel/exit.c:542 do_exit+0x9b2/0x27f0 kernel/exit.c:864 do_group_exit+0x207/0x2c0 kernel/exit.c:1026 get_signal+0x16a1/0x1740 kernel/signal.c:2917 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xc9/0x370 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f irq event stamp: 1170 hardirqs last enabled at (1169): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline] hardirqs last enabled at (1169): [] _raw_spin_unlock_irqrestore+0x8f/0x140 kernel/locking/spinlock.c:194 hardirqs last disabled at (1170): [] sysvec_call_function_single+0xe/0xc0 arch/x86/kernel/smp.c:266 softirqs last enabled at (722): [] __do_softirq kernel/softirq.c:588 [inline] softirqs last enabled at (722): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last enabled at (722): [] __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637 softirqs last disabled at (707): [] __do_softirq kernel/softirq.c:588 [inline] softirqs last disabled at (707): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last disabled at (707): [] __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 *** 4 locks held by syz.4.419/6832: #0: ffffffff8e873c70 (namespace_sem){++++}-{3:3}, at: namespace_lock fs/namespace.c:1713 [inline] #0: ffffffff8e873c70 (namespace_sem){++++}-{3:3}, at: copy_mnt_ns+0x11a/0x840 fs/namespace.c:3904 #1: ffffffff8e80dce8 (pcpu_alloc_mutex){+.+.}-{3:3}, at: pcpu_alloc_noprof+0x27f/0x16e0 mm/percpu.c:1795 #2: ffffffff8e735fe0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:327 [inline] #2: ffffffff8e735fe0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:839 [inline] #2: ffffffff8e735fe0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2405 [inline] #2: ffffffff8e735fe0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2447 #3: ffff888028bb1498 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] #3: ffff888028bb1498 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x237/0x9d0 kernel/bpf/stackmap.c:141 stack backtrace: CPU: 0 PID: 6832 Comm: syz.4.419 Not tainted 6.10.0-syzkaller-04558-g6189fa6faa09 #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+0x241/0x360 lib/dump_stack.c:114 valid_state+0x13a/0x1c0 kernel/locking/lockdep.c:4012 mark_lock_irq+0xbb/0xc20 kernel/locking/lockdep.c:4215 mark_lock+0x223/0x350 kernel/locking/lockdep.c:4677 mark_usage kernel/locking/lockdep.c:4563 [inline] __lock_acquire+0xb8e/0x1fd0 kernel/locking/lockdep.c:5090 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5753 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:1997 [inline] bpf_get_stack_raw_tp+0x1a3/0x240 kernel/trace/bpf_trace.c:1987 bpf_prog_ec3b2eefa702d8d3+0x43/0x47 bpf_dispatcher_nop_func include/linux/bpf.h:1252 [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:2406 [inline] bpf_trace_run2+0x2ec/0x540 kernel/trace/bpf_trace.c:2447 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:134 [inline] __flush_smp_call_function_queue+0x3fc/0x1690 kernel/smp.c:512 __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:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0xd8/0x140 kernel/locking/spinlock.c:194 Code: 9c 8f 44 24 20 42 80 3c 23 00 74 08 4c 89 f7 e8 6e ec 40 f6 f6 44 24 21 02 75 52 41 f7 c7 00 02 00 00 74 01 fb bf 01 00 00 00 e3 e8 a9 f5 65 8b 05 d4 f8 47 74 85 c0 74 43 48 c7 04 24 0e 36 RSP: 0018:ffffc90016d1f640 EFLAGS: 00000206 RAX: ddaa4917cd825900 RBX: 1ffff92002da3ecc RCX: ffffffff817302da RDX: dffffc0000000000 RSI: ffffffff8beac920 RDI: 0000000000000001 RBP: ffffc90016d1f6d0 R08: ffffffff934f05c7 R09: 1ffffffff269e0b8 R10: dffffc0000000000 R11: fffffbfff269e0b9 R12: dffffc0000000000 R13: 1ffff92002da3ec8 R14: ffffc90016d1f660 R15: 0000000000000246 spin_unlock_irqrestore include/linux/spinlock.h:406 [inline] pcpu_alloc_noprof+0xaae/0x16e0 mm/percpu.c:1867 alloc_vfsmnt+0x161/0x4d0 fs/namespace.c:326 clone_mnt+0x6b/0xc80 fs/namespace.c:1292 copy_tree+0xe4/0x830 fs/namespace.c:2098 copy_mnt_ns+0x178/0x840 fs/namespace.c:3909 create_new_namespaces+0xd3/0x7b0 kernel/nsproxy.c:78 copy_namespaces+0x41a/0x490 kernel/nsproxy.c:179 copy_process+0x195e/0x3dc0 kernel/fork.c:2376 kernel_clone+0x226/0x8f0 kernel/fork.c:2780 __do_sys_clone kernel/fork.c:2923 [inline] __se_sys_clone kernel/fork.c:2907 [inline] __x64_sys_clone+0x258/0x2a0 kernel/fork.c:2907 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:0x7fbeffb75f19 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:00007fbf008fcff8 EFLAGS: 00000206 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 00007fbeffd05f60 RCX: 00007fbeffb75f19 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000022023400 RBP: 00007fbeffbe4e68 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000 R13: 000000000000000b R14: 00007fbeffd05f60 R15: 00007ffc02909ff8 ---------------- 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 6e ec 40 f6 call 0xf640ec82 14: f6 44 24 21 02 testb $0x2,0x21(%rsp) 19: 75 52 jne 0x6d 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 e3 e8 a9 f5 call 0xf5a9e912 <-- trapping instruction 2f: 65 8b 05 d4 f8 47 74 mov %gs:0x7447f8d4(%rip),%eax # 0x7447f90a 36: 85 c0 test %eax,%eax 38: 74 43 je 0x7d 3a: 48 rex.W 3b: c7 .byte 0xc7 3c: 04 24 add $0x24,%al 3e: 0e (bad) 3f: 36 ss