================================ WARNING: inconsistent lock state 6.10.0-syzkaller-04559-g7d30b8aa4fc3 #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz.3.957/8514 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff8880b9338798 (lock#10){?.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b9338798 (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_released+0x9c/0x620 mm/mmap_lock.c:243 __mmap_lock_trace_released include/linux/mmap_lock.h:42 [inline] mmap_read_unlock include/linux/mmap_lock.h:170 [inline] do_user_addr_fault arch/x86/mm/fault.c:1417 [inline] handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x7a2/0x8c0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 rep_movs_alternative+0x4a/0x70 arch/x86/lib/copy_user_64.S:65 copy_user_generic arch/x86/include/asm/uaccess_64.h:110 [inline] raw_copy_from_user arch/x86/include/asm/uaccess_64.h:125 [inline] _copy_from_user+0x8c/0xe0 lib/usercopy.c:28 copy_from_user include/linux/uaccess.h:183 [inline] generic_map_update_batch+0x5ba/0x900 kernel/bpf/syscall.c:1886 bpf_map_do_batch+0x3e0/0x690 kernel/bpf/syscall.c:5218 __sys_bpf+0x377/0x810 __do_sys_bpf kernel/bpf/syscall.c:5817 [inline] __se_sys_bpf kernel/bpf/syscall.c:5815 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5815 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 irq event stamp: 22 hardirqs last enabled at (21): [] seqcount_lockdep_reader_access+0x14d/0x220 include/linux/seqlock.h:74 hardirqs last disabled at (22): [] sysvec_call_function_single+0xe/0xc0 arch/x86/kernel/smp.c:266 softirqs last enabled at (0): [] rcu_lock_acquire include/linux/rcupdate.h:327 [inline] softirqs last enabled at (0): [] rcu_read_lock include/linux/rcupdate.h:839 [inline] softirqs last enabled at (0): [] copy_process+0xa03/0x3dc0 kernel/fork.c:2242 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 *** 4 locks held by syz.3.957/8514: #0: ffffffff8edc66d0 (tomoyo_ss){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:151 [inline] #0: ffffffff8edc66d0 (tomoyo_ss){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:250 [inline] #0: ffffffff8edc66d0 (tomoyo_ss){.+.+}-{0:0}, at: tomoyo_read_lock security/tomoyo/common.h:1108 [inline] #0: ffffffff8edc66d0 (tomoyo_ss){.+.+}-{0:0}, at: tomoyo_path_number_perm+0x208/0x880 security/tomoyo/file.c:722 #1: ffffffff8e735fe0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:327 [inline] #1: ffffffff8e735fe0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:839 [inline] #1: ffffffff8e735fe0 (rcu_read_lock){....}-{1:2}, at: __dentry_path+0x27/0x6b0 fs/d_path.c:337 #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: ffff8880790ba798 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] #3: ffff8880790ba798 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x237/0x9d0 kernel/bpf/stackmap.c:141 stack backtrace: CPU: 1 PID: 8514 Comm: syz.3.957 Not tainted 6.10.0-syzkaller-04559-g7d30b8aa4fc3 #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:seqcount_lockdep_reader_access+0x1d6/0x220 include/linux/seqlock.h:75 Code: 62 e8 ae 7b 78 ff 4d 85 f6 48 bb 00 00 00 00 00 fc ff df 75 07 e8 9a 7b 78 ff eb 06 e8 93 7b 78 ff fb 48 c7 04 24 0e 36 e0 45 <4a> c7 04 23 00 00 00 00 66 42 c7 44 23 09 00 00 42 c6 44 23 0b 00 RSP: 0018:ffffc9000e04f800 EFLAGS: 00000293 RAX: ffffffff821de22d RBX: dffffc0000000000 RCX: ffff888021911e00 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc9000e04f8a8 R08: ffffffff821de208 R09: 1ffffffff269e0bf R10: dffffc0000000000 R11: fffffbfff269e0c0 R12: 1ffff92001c09f00 R13: ffffc9000e04f820 R14: 0000000000000200 R15: 0000000000000046 read_seqbegin include/linux/seqlock.h:772 [inline] read_seqbegin_or_lock include/linux/seqlock.h:1076 [inline] __dentry_path+0x16c/0x6b0 fs/d_path.c:341 dentry_path_raw+0x141/0x210 fs/d_path.c:367 tomoyo_get_dentry_path security/tomoyo/realpath.c:131 [inline] tomoyo_get_local_path+0xd2/0x7b0 security/tomoyo/realpath.c:157 tomoyo_realpath_from_path+0x49c/0x5e0 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x23a/0x880 security/tomoyo/file.c:723 security_file_ioctl+0x75/0xb0 security/security.c:2791 __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:0x7f714bd76e9b 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:00007f714ca7f070 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f714bd76e9b RDX: 0000000000000000 RSI: 0000000000006364 RDI: 00000000000000d8 RBP: 00007f714bf05f80 R08: 0000000000000000 R09: 00007ffc79ac7537 R10: 0000000000000008 R11: 0000000000000246 R12: ffffffffffffffa8 R13: 000000000000000b R14: 00007ffc79ac7450 R15: 00007ffc79ac7538 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: e8 ae 7b 78 ff call 0xff787bb3 5: 4d 85 f6 test %r14,%r14 8: 48 bb 00 00 00 00 00 movabs $0xdffffc0000000000,%rbx f: fc ff df 12: 75 07 jne 0x1b 14: e8 9a 7b 78 ff call 0xff787bb3 19: eb 06 jmp 0x21 1b: e8 93 7b 78 ff call 0xff787bb3 20: fb sti 21: 48 c7 04 24 0e 36 e0 movq $0x45e0360e,(%rsp) 28: 45 * 29: 4a c7 04 23 00 00 00 movq $0x0,(%rbx,%r12,1) <-- trapping instruction 30: 00 31: 66 42 c7 44 23 09 00 movw $0x0,0x9(%rbx,%r12,1) 38: 00 39: 42 c6 44 23 0b 00 movb $0x0,0xb(%rbx,%r12,1)