================================ WARNING: inconsistent lock state 6.1.102-syzkaller #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz.3.603/6078 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff8880b9935e90 (lock#10){?.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b9935e90 (lock#10){?.+.}-{2:2}, at: __mmap_lock_do_trace_acquire_returned+0x84/0x670 mm/mmap_lock.c:237 {HARDIRQ-ON-W} state was registered at: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_acquire_returned+0x9d/0x670 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:137 [inline] get_mmap_lock_carefully mm/memory.c:5304 [inline] lock_mm_and_find_vma+0x219/0x2e0 mm/memory.c:5366 do_user_addr_fault arch/x86/mm/fault.c:1312 [inline] handle_page_fault arch/x86/mm/fault.c:1431 [inline] exc_page_fault+0x169/0x620 arch/x86/mm/fault.c:1487 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 irq event stamp: 24 hardirqs last enabled at (23): [] kasan_quarantine_put+0xd4/0x220 mm/kasan/quarantine.c:242 hardirqs last disabled at (24): [] sysvec_call_function_single+0xa/0xb0 arch/x86/kernel/smp.c:262 softirqs last enabled at (0): [] rcu_lock_acquire include/linux/rcupdate.h:350 [inline] softirqs last enabled at (0): [] rcu_read_lock include/linux/rcupdate.h:791 [inline] softirqs last enabled at (0): [] copy_process+0x9e1/0x4060 kernel/fork.c:2132 softirqs last disabled at (0): [<0000000000000000>] 0x0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(lock#10); lock(lock#10); *** DEADLOCK *** 3 locks held by syz.3.603/6078: #0: ffffffff8d91a5e8 (tomoyo_ss){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #0: ffffffff8d91a5e8 (tomoyo_ss){....}-{0:0}, at: srcu_read_lock include/linux/srcu.h:165 [inline] #0: ffffffff8d91a5e8 (tomoyo_ss){....}-{0:0}, at: tomoyo_read_lock security/tomoyo/common.h:1110 [inline] #0: ffffffff8d91a5e8 (tomoyo_ss){....}-{0:0}, at: tomoyo_path_number_perm+0x1f2/0x7f0 security/tomoyo/file.c:722 #1: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #1: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #1: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] #1: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x110/0x410 kernel/trace/bpf_trace.c:2312 #2: ffff888023e77958 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #2: ffff888023e77958 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x232/0x9c0 kernel/bpf/stackmap.c:144 stack backtrace: CPU: 1 PID: 6078 Comm: syz.3.603 Not tainted 6.1.102-syzkaller #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+0x1e3/0x2cb lib/dump_stack.c:106 valid_state+0x136/0x1c0 kernel/locking/lockdep.c:3969 mark_lock_irq+0xa8/0xba0 kernel/locking/lockdep.c:4172 mark_lock+0x21c/0x340 kernel/locking/lockdep.c:4628 mark_usage kernel/locking/lockdep.c:4520 [inline] __lock_acquire+0xb40/0x1f80 kernel/locking/lockdep.c:5003 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_acquire_returned+0x9d/0x670 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:137 [inline] stack_map_get_build_id_offset+0x99e/0x9c0 kernel/bpf/stackmap.c:144 __bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:452 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1877 [inline] bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1867 bpf_prog_ec3b2eefa702d8d3+0x3a/0x3e bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312 trace_tlb_flush+0x151/0x1a0 include/trace/events/tlb.h:38 flush_tlb_func+0x4e3/0x620 arch/x86/mm/tlb.c:875 __flush_smp_call_function_queue+0x2d9/0xd00 kernel/smp.c:641 __sysvec_call_function_single+0xbb/0x360 arch/x86/kernel/smp.c:267 sysvec_call_function_single+0x89/0xb0 arch/x86/kernel/smp.c:262 asm_sysvec_call_function_single+0x16/0x20 arch/x86/include/asm/idtentry.h:661 RIP: 0010:__sanitizer_cov_trace_pc+0x58/0x60 kernel/kcov.c:225 Code: f8 15 00 00 83 fa 02 75 21 48 8b 91 00 16 00 00 48 8b 32 48 8d 7e 01 8b 89 fc 15 00 00 48 39 cf 73 08 48 89 3a 48 89 44 f2 08 0f 1f 80 00 00 00 00 4c 8b 04 24 65 48 8b 15 44 d3 77 7e 65 8b RSP: 0018:ffffc9001655fb98 EFLAGS: 00000293 RAX: ffffffff83f30ed5 RBX: 0000000000000005 RCX: ffff88807dc4bb80 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000002 RBP: ffff888023042701 R08: ffffffff83f30ec0 R09: ffffed10046d49d7 R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000006 R13: dffffc0000000000 R14: ffff8880236a4eb0 R15: ffff8880236a4e90 tomoyo_check_acl+0x2f5/0x3e0 security/tomoyo/domain.c:183 tomoyo_path_number_perm+0x430/0x7f0 security/tomoyo/file.c:733 security_file_ioctl+0x6d/0xa0 security/security.c:1568 __do_sys_ioctl fs/ioctl.c:864 [inline] __se_sys_ioctl+0x47/0x160 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fa313376fbb 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:00007fa314204070 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fa313376fbb RDX: 0000000000000000 RSI: 0000000000006364 RDI: 00000000000000d8 RBP: 00007fa313505f80 R08: 0000000000000000 R09: 00007ffdccc30db7 R10: 0000000000000008 R11: 0000000000000246 R12: ffffffffffffffa8 R13: 000000000000000b R14: 00007ffdccc30cd0 R15: 00007ffdccc30db8 vkms_vblank_simulate: vblank timer overrun ---------------- Code disassembly (best guess): 0: f8 clc 1: 15 00 00 83 fa adc $0xfa830000,%eax 6: 02 75 21 add 0x21(%rbp),%dh 9: 48 8b 91 00 16 00 00 mov 0x1600(%rcx),%rdx 10: 48 8b 32 mov (%rdx),%rsi 13: 48 8d 7e 01 lea 0x1(%rsi),%rdi 17: 8b 89 fc 15 00 00 mov 0x15fc(%rcx),%ecx 1d: 48 39 cf cmp %rcx,%rdi 20: 73 08 jae 0x2a 22: 48 89 3a mov %rdi,(%rdx) 25: 48 89 44 f2 08 mov %rax,0x8(%rdx,%rsi,8) * 2a: c3 ret <-- trapping instruction 2b: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 32: 4c 8b 04 24 mov (%rsp),%r8 36: 65 48 8b 15 44 d3 77 mov %gs:0x7e77d344(%rip),%rdx # 0x7e77d382 3d: 7e 3e: 65 gs 3f: 8b .byte 0x8b