====================================================== WARNING: possible circular locking dependency detected 6.1.92-syzkaller #0 Not tainted ------------------------------------------------------ syz-fuzzer/3552 is trying to acquire lock: ffff8880b9835e90 (lock#10){+.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b9835e90 (lock#10){+.+.}-{2:2}, at: __mmap_lock_do_trace_acquire_returned+0x84/0x670 mm/mmap_lock.c:237 but task is already holding lock: ffff8880b9828358 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x120/0x260 kernel/time/timer.c:999 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&base->lock){-.-.}-{2:2}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 lock_timer_base+0x120/0x260 kernel/time/timer.c:999 __mod_timer+0x1cb/0xee0 kernel/time/timer.c:1072 queue_delayed_work_on+0x156/0x250 kernel/workqueue.c:1704 queue_delayed_work include/linux/workqueue.h:527 [inline] schedule_delayed_monitor_work kernel/rcu/tree.c:3171 [inline] kvfree_call_rcu+0x520/0x8c0 kernel/rcu/tree.c:3427 rtnl_register_internal+0x489/0x580 net/core/rtnetlink.c:260 rtnl_register+0x32/0x70 net/core/rtnetlink.c:310 ip_rt_init+0x335/0x3c7 net/ipv4/route.c:3769 ip_init+0xa/0x14 net/ipv4/ip_output.c:1767 inet_init+0x2ae/0x3c0 net/ipv4/af_inet.c:2031 do_one_initcall+0x265/0x8f0 init/main.c:1299 do_initcall_level+0x157/0x207 init/main.c:1372 do_initcalls+0x49/0x86 init/main.c:1388 kernel_init_freeable+0x45c/0x60f init/main.c:1627 kernel_init+0x19/0x290 init/main.c:1515 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 -> #2 (krc.lock){..-.}-{2:2}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 krc_this_cpu_lock kernel/rcu/tree.c:2990 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3310 [inline] kvfree_call_rcu+0x1b2/0x8c0 kernel/rcu/tree.c:3401 trie_delete_elem+0x520/0x690 0xffffffffa00006f2 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 __bpf_trace_kfree+0x6e/0x90 include/trace/events/kmem.h:94 trace_kfree include/trace/events/kmem.h:94 [inline] kfree+0xf6/0x190 mm/slab_common.c:994 fscrypt_free_filename include/linux/fscrypt.h:335 [inline] ext4_fname_free_filename+0x3c/0xb0 fs/ext4/crypto.c:67 ext4_lookup_entry fs/ext4/namei.c:1773 [inline] ext4_lookup+0x181/0x740 fs/ext4/namei.c:1839 lookup_one_qstr_excl+0x117/0x240 fs/namei.c:1605 filename_create+0x293/0x530 fs/namei.c:3879 do_symlinkat+0xf5/0x390 fs/namei.c:4492 __do_sys_symlinkat fs/namei.c:4519 [inline] __se_sys_symlinkat fs/namei.c:4516 [inline] __x64_sys_symlinkat+0x95/0xa0 fs/namei.c:4516 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 -> #1 (&trie->lock){..-.}-{2:2}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:451 bpf_prog_e6cf5f9c69743609+0x22/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_run4+0x253/0x470 kernel/trace/bpf_trace.c:2314 __traceiter_mmap_lock_acquire_returned+0x8c/0xe0 include/trace/events/mmap_lock.h:52 trace_mmap_lock_acquire_returned include/trace/events/mmap_lock.h:52 [inline] __mmap_lock_do_trace_acquire_returned+0x5e3/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:1343 [inline] handle_page_fault arch/x86/mm/fault.c:1462 [inline] exc_page_fault+0x169/0x660 arch/x86/mm/fault.c:1518 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 strncpy_from_user+0x159/0x360 lib/strncpy_from_user.c:139 strncpy_from_bpfptr include/linux/bpfptr.h:85 [inline] bpf_prog_load+0x188/0x1bb0 kernel/bpf/syscall.c:2515 __sys_bpf+0x382/0x6c0 kernel/bpf/syscall.c:5005 __do_sys_bpf kernel/bpf/syscall.c:5109 [inline] __se_sys_bpf kernel/bpf/syscall.c:5107 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5107 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 -> #0 (lock#10){+.+.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 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_prog_e6cf5f9c69743609+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_prog_run_array include/linux/bpf.h:1635 [inline] trace_call_bpf+0x345/0x6a0 kernel/trace/bpf_trace.c:135 perf_trace_run_bpf_submit+0x7b/0x1d0 kernel/events/core.c:9924 perf_trace_timer_class+0x2c8/0x380 include/trace/events/timer.h:12 trace_timer_cancel include/trace/events/timer.h:138 [inline] debug_deactivate kernel/time/timer.c:832 [inline] detach_timer+0x2f4/0x380 kernel/time/timer.c:878 detach_if_pending kernel/time/timer.c:899 [inline] __mod_timer+0x407/0xee0 kernel/time/timer.c:1076 sk_reset_timer+0x1f/0xb0 net/core/sock.c:3371 tcp_event_new_data_sent+0x203/0x360 net/ipv4/tcp_output.c:81 tcp_write_xmit+0x1a8b/0x64c0 net/ipv4/tcp_output.c:2716 __tcp_push_pending_frames+0x97/0x350 net/ipv4/tcp_output.c:2894 tcp_sendmsg_locked+0x37b2/0x4100 net/ipv4/tcp.c:1461 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1489 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:730 [inline] sock_write_iter+0x394/0x4e0 net/socket.c:1143 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x7ae/0xba0 fs/read_write.c:584 ksys_write+0x19c/0x2c0 fs/read_write.c:637 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 other info that might help us debug this: Chain exists of: lock#10 --> krc.lock --> &base->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&base->lock); lock(krc.lock); lock(&base->lock); lock(lock#10); *** DEADLOCK *** 4 locks held by syz-fuzzer/3552: #0: ffff888074888d70 (sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1748 [inline] #0: ffff888074888d70 (sk_lock-AF_INET){+.+.}-{0:0}, at: tcp_sendmsg+0x1e/0x40 net/ipv4/tcp.c:1488 #1: ffff8880b9828358 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x120/0x260 kernel/time/timer.c:999 #2: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #2: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #2: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: trace_call_bpf+0xbe/0x6a0 kernel/trace/bpf_trace.c:134 #3: ffff88807eef7958 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #3: ffff88807eef7958 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x232/0x9c0 kernel/bpf/stackmap.c:144 stack backtrace: CPU: 0 PID: 3552 Comm: syz-fuzzer Not tainted 6.1.92-syzkaller #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+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 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_prog_e6cf5f9c69743609+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_prog_run_array include/linux/bpf.h:1635 [inline] trace_call_bpf+0x345/0x6a0 kernel/trace/bpf_trace.c:135 perf_trace_run_bpf_submit+0x7b/0x1d0 kernel/events/core.c:9924 perf_trace_timer_class+0x2c8/0x380 include/trace/events/timer.h:12 trace_timer_cancel include/trace/events/timer.h:138 [inline] debug_deactivate kernel/time/timer.c:832 [inline] detach_timer+0x2f4/0x380 kernel/time/timer.c:878 detach_if_pending kernel/time/timer.c:899 [inline] __mod_timer+0x407/0xee0 kernel/time/timer.c:1076 sk_reset_timer+0x1f/0xb0 net/core/sock.c:3371 tcp_event_new_data_sent+0x203/0x360 net/ipv4/tcp_output.c:81 tcp_write_xmit+0x1a8b/0x64c0 net/ipv4/tcp_output.c:2716 __tcp_push_pending_frames+0x97/0x350 net/ipv4/tcp_output.c:2894 tcp_sendmsg_locked+0x37b2/0x4100 net/ipv4/tcp.c:1461 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1489 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:730 [inline] sock_write_iter+0x394/0x4e0 net/socket.c:1143 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x7ae/0xba0 fs/read_write.c:584 ksys_write+0x19c/0x2c0 fs/read_write.c:637 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:0x40720e Code: 48 83 ec 38 e8 13 00 00 00 48 83 c4 38 5d c3 cc cc cc cc cc cc cc cc cc cc cc cc cc 49 89 f2 48 89 fa 48 89 ce 48 89 df 0f 05 <48> 3d 01 f0 ff ff 76 15 48 f7 d8 48 89 c1 48 c7 c0 ff ff ff ff 48 RSP: 002b:000000c0006a7af8 EFLAGS: 00000206 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000040720e RDX: 0000000000000148 RSI: 000000c001609eb8 RDI: 0000000000000003 RBP: 000000c0006a7b38 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 000000c0006a7c78 R13: 0000000000061fda R14: 000000c000f6cea0 R15: 000000c0015a8000