================================ WARNING: inconsistent lock state 6.1.102-syzkaller #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz.0.293/5124 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff8880b9835e90 (lock#11){?.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b9835e90 (lock#11){?.+.}-{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_lock_killable include/linux/mmap_lock.h:127 [inline] __get_user_pages_locked mm/gup.c:1488 [inline] get_dump_page+0x47b/0x8a0 mm/gup.c:1935 dump_user_range+0x111/0x8e0 fs/coredump.c:906 elf_core_dump+0x3d2b/0x4590 fs/binfmt_elf.c:2312 do_coredump+0x18b7/0x2700 fs/coredump.c:755 get_signal+0x1454/0x17d0 kernel/signal.c:2848 arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:316 exc_general_protection+0x3e0/0x590 arch/x86/kernel/traps.c:729 asm_exc_general_protection+0x22/0x30 arch/x86/include/asm/idtentry.h:564 irq event stamp: 26 hardirqs last enabled at (25): [] kasan_quarantine_put+0xd4/0x220 mm/kasan/quarantine.c:242 hardirqs last disabled at (26): [] 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#11); lock(lock#11); *** DEADLOCK *** 3 locks held by syz.0.293/5124: #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: ffff8880197cae58 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #2: ffff8880197cae58 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x232/0x9c0 kernel/bpf/stackmap.c:144 stack backtrace: CPU: 0 PID: 5124 Comm: syz.0.293 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:tomoyo_check_acl+0x190/0x3e0 Code: d6 c5 ff ff 84 c0 0f 85 2e 02 00 00 e8 39 8e 97 fd eb 0c e8 32 8e 97 fd eb 05 e8 2b 8e 97 fd 49 8d 6e 07 4c 89 f0 48 c1 e8 03 <42> 0f b6 04 28 84 c0 75 40 48 89 e8 48 c1 e8 03 42 0f b6 04 28 84 RSP: 0018:ffffc90004b57ba0 EFLAGS: 00000a02 RAX: 1ffff11004c686e0 RBX: 0000000000000000 RCX: ffff88807d183b80 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000 RBP: ffff888026343707 R08: ffffffff83f30cf6 R09: ffffffff83f4a408 R10: 0000000000000002 R11: ffff88807d183b80 R12: 0000000000000000 R13: dffffc0000000000 R14: ffff888026343700 R15: ffff888017b4b790 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:0x7f0434176e9b 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:00007f0434f3e070 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f0434176e9b RDX: 0000000000000000 RSI: 0000000000006364 RDI: 00000000000000d8 RBP: 00007f0434305f80 R08: 0000000000000000 R09: 00007ffee9e2d8b7 R10: 0000000000000008 R11: 0000000000000246 R12: ffffffffffffffa8 R13: 000000000000000b R14: 00007ffee9e2d7d0 R15: 00007ffee9e2d8b8 ---------------- Code disassembly (best guess), 3 bytes skipped: 0: ff 84 c0 0f 85 2e 02 incl 0x22e850f(%rax,%rax,8) 7: 00 00 add %al,(%rax) 9: e8 39 8e 97 fd call 0xfd978e47 e: eb 0c jmp 0x1c 10: e8 32 8e 97 fd call 0xfd978e47 15: eb 05 jmp 0x1c 17: e8 2b 8e 97 fd call 0xfd978e47 1c: 49 8d 6e 07 lea 0x7(%r14),%rbp 20: 4c 89 f0 mov %r14,%rax 23: 48 c1 e8 03 shr $0x3,%rax * 27: 42 0f b6 04 28 movzbl (%rax,%r13,1),%eax <-- trapping instruction 2c: 84 c0 test %al,%al 2e: 75 40 jne 0x70 30: 48 89 e8 mov %rbp,%rax 33: 48 c1 e8 03 shr $0x3,%rax 37: 42 0f b6 04 28 movzbl (%rax,%r13,1),%eax 3c: 84 .byte 0x84