================================ WARNING: inconsistent lock state 6.10.0-rc1-syzkaller-00104-gd8ec19857b09 #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz-executor.1/8638 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff8880b9538828 (lock#12){?.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b9538828 (lock#12){?.+.}-{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_read_trylock include/linux/mmap_lock.h:164 [inline] get_mmap_lock_carefully mm/memory.c:5715 [inline] lock_mm_and_find_vma+0x213/0x2f0 mm/memory.c:5775 do_user_addr_fault arch/x86/mm/fault.c:1361 [inline] handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x1bf/0x8c0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 __put_user_8+0x11/0x20 arch/x86/lib/putuser.S:105 clear_rseq_cs kernel/rseq.c:257 [inline] rseq_ip_fixup kernel/rseq.c:291 [inline] __rseq_handle_notify_resume+0x666/0x14e0 kernel/rseq.c:329 rseq_handle_notify_resume include/linux/rseq.h:38 [inline] resume_user_mode_work include/linux/resume_user_mode.h:62 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [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+0x114/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: 28 hardirqs last enabled at (27): [] seqcount_lockdep_reader_access+0x14d/0x220 include/linux/seqlock.h:74 hardirqs last disabled at (28): [] sysvec_call_function_single+0xe/0xc0 arch/x86/kernel/smp.c:266 softirqs last enabled at (0): [] rcu_lock_acquire include/linux/rcupdate.h:329 [inline] softirqs last enabled at (0): [] rcu_read_lock include/linux/rcupdate.h:781 [inline] softirqs last enabled at (0): [] copy_process+0xa03/0x3dc0 kernel/fork.c:2259 softirqs last disabled at (0): [<0000000000000000>] 0x0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(lock#12); lock(lock#12); *** DEADLOCK *** 3 locks held by syz-executor.1/8638: #0: ffffffff8e9bf830 (tomoyo_ss){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:116 [inline] #0: ffffffff8e9bf830 (tomoyo_ss){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:215 [inline] #0: ffffffff8e9bf830 (tomoyo_ss){.+.+}-{0:0}, at: tomoyo_read_lock security/tomoyo/common.h:1108 [inline] #0: ffffffff8e9bf830 (tomoyo_ss){.+.+}-{0:0}, at: tomoyo_path_number_perm+0x208/0x880 security/tomoyo/file.c:722 #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: __bpf_trace_run kernel/trace/bpf_trace.c:2402 [inline] #1: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2444 #2: ffff88801f3c3a98 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] #2: ffff88801f3c3a98 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x237/0x9d0 kernel/bpf/stackmap.c:141 stack backtrace: CPU: 1 PID: 8638 Comm: syz-executor.1 Not tainted 6.10.0-rc1-syzkaller-00104-gd8ec19857b09 #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_e6cf5f9c69743609+0x42/0x4a bpf_dispatcher_nop_func include/linux/bpf.h:1243 [inline] __bpf_prog_run include/linux/filter.h:682 [inline] bpf_prog_run include/linux/filter.h:698 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2403 [inline] bpf_trace_run2+0x47f/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:unwind_next_frame+0xda2/0x2a00 Code: 0f b6 04 28 84 c0 0f 85 73 1a 00 00 48 89 d8 48 c1 e8 03 42 0f b6 04 28 84 c0 48 89 ee 0f 85 82 1a 00 00 48 0f bf 02 48 01 c6 02 02 00 00 e8 74 29 55 00 48 8b 2c 24 48 8d 5d 28 48 89 d8 48 RSP: 0018:ffffc90010fdf580 EFLAGS: 00000286 RAX: 0000000000000010 RBX: ffffffff902f0399 RCX: ffff888049813c00 RDX: ffffffff902f0398 RSI: ffffc90010fdf760 RDI: 0000000000000004 RBP: 0000000000000004 R08: 0000000000000005 R09: ffffffff8140e71e R10: 0000000000000008 R11: ffff888049813c00 R12: ffffffff902f039c R13: dffffc0000000000 R14: ffffc90010fdf710 R15: 1ffff920021fbed8 __unwind_start+0x641/0x7c0 arch/x86/kernel/unwind_orc.c:760 unwind_start arch/x86/include/asm/unwind.h:64 [inline] arch_stack_walk+0x103/0x1b0 arch/x86/kernel/stacktrace.c:24 stack_trace_save+0x118/0x1d0 kernel/stacktrace.c:122 kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:4121 [inline] __kmalloc_noprof+0x1f9/0x400 mm/slub.c:4134 kmalloc_noprof include/linux/slab.h:664 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] tomoyo_encode2 security/tomoyo/realpath.c:45 [inline] tomoyo_encode+0x26f/0x540 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x59e/0x5e0 security/tomoyo/realpath.c:283 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x23a/0x880 security/tomoyo/file.c:723 security_file_ioctl+0x77/0xb0 security/security.c:2765 __do_sys_ioctl fs/ioctl.c:901 [inline] __se_sys_ioctl+0x47/0x170 fs/ioctl.c:893 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:0x7f78d767cc4b Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00 RSP: 002b:00007f78d84600f0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f78d767cc4b RDX: 0000000000000000 RSI: 0000000000006364 RDI: 00000000000000d8 RBP: 00007f78d77b3fa0 R08: 0000000000000000 R09: 00007fff87934bc7 R10: 0000000000000008 R11: 0000000000000246 R12: ffffffffffffffb0 R13: 000000000000000b R14: 00007fff87934ae0 R15: 00007fff87934bc8 ---------------- Code disassembly (best guess): 0: 0f b6 04 28 movzbl (%rax,%rbp,1),%eax 4: 84 c0 test %al,%al 6: 0f 85 73 1a 00 00 jne 0x1a7f c: 48 89 d8 mov %rbx,%rax f: 48 c1 e8 03 shr $0x3,%rax 13: 42 0f b6 04 28 movzbl (%rax,%r13,1),%eax 18: 84 c0 test %al,%al 1a: 48 89 ee mov %rbp,%rsi 1d: 0f 85 82 1a 00 00 jne 0x1aa5 23: 48 0f bf 02 movswq (%rdx),%rax 27: 48 01 c6 add %rax,%rsi * 2a: e9 02 02 00 00 jmp 0x231 <-- trapping instruction 2f: e8 74 29 55 00 call 0x5529a8 34: 48 8b 2c 24 mov (%rsp),%rbp 38: 48 8d 5d 28 lea 0x28(%rbp),%rbx 3c: 48 89 d8 mov %rbx,%rax 3f: 48 rex.W