====================================================== WARNING: possible circular locking dependency detected 6.1.109-syzkaller #0 Not tainted ------------------------------------------------------ syz.1.111/4126 is trying to acquire lock: ffff8880b8e28118 (krc.lock){..-.}-{2:2}, at: krc_this_cpu_lock kernel/rcu/tree.c:2991 [inline] ffff8880b8e28118 (krc.lock){..-.}-{2:2}, at: add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3311 [inline] ffff8880b8e28118 (krc.lock){..-.}-{2:2}, at: kvfree_call_rcu+0x1b2/0x8c0 kernel/rcu/tree.c:3402 but task is already holding lock: ffff8880b8e28358 (&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: -> #1 (&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:3172 [inline] kvfree_call_rcu+0x520/0x8c0 kernel/rcu/tree.c:3428 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:3763 ip_init+0xa/0x14 net/ipv4/ip_output.c:1767 inet_init+0x2ae/0x3c0 net/ipv4/af_inet.c:2035 do_one_initcall+0x265/0x8f0 init/main.c:1298 do_initcall_level+0x157/0x207 init/main.c:1371 do_initcalls+0x49/0x86 init/main.c:1387 kernel_init_freeable+0x45c/0x60f init/main.c:1626 kernel_init+0x19/0x290 init/main.c:1514 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 -> #0 (krc.lock){..-.}-{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 __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:2991 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3311 [inline] kvfree_call_rcu+0x1b2/0x8c0 kernel/rcu/tree.c:3402 trie_delete_elem+0x53a/0x690 kernel/bpf/lpm_trie.c:532 bpf_prog_9c69e7db813340a1+0x3d/0x41 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_run3+0x231/0x440 kernel/trace/bpf_trace.c:2313 trace_timer_start include/trace/events/timer.h:53 [inline] enqueue_timer+0x440/0x600 kernel/time/timer.c:609 __mod_timer+0x92b/0xee0 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1504 expire_timers kernel/time/timer.c:1549 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1820 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833 handle_softirqs+0x2ee/0xa40 kernel/softirq.c:571 __do_softirq kernel/softirq.c:605 [inline] invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x157/0x240 kernel/softirq.c:654 irq_exit_rcu+0x5/0x20 kernel/softirq.c:666 sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 get_current arch/x86/include/asm/current.h:15 [inline] lockdep_enabled kernel/locking/lockdep.c:122 [inline] lock_release+0x11a/0xa20 kernel/locking/lockdep.c:5675 rcu_lock_release include/linux/rcupdate.h:355 [inline] rcu_read_unlock_sched include/linux/rcupdate.h:904 [inline] pfn_valid+0x3eb/0x440 include/linux/mmzone.h:1867 page_table_check_clear+0x1e/0x6d0 mm/page_table_check.c:67 zap_pte_range mm/memory.c:1435 [inline] zap_pmd_range mm/memory.c:1574 [inline] zap_pud_range mm/memory.c:1603 [inline] zap_p4d_range mm/memory.c:1624 [inline] unmap_page_range+0x1b4a/0x2740 mm/memory.c:1645 unmap_vmas+0x48b/0x640 mm/memory.c:1730 exit_mmap+0x252/0x9f0 mm/mmap.c:3227 __mmput+0x115/0x3c0 kernel/fork.c:1199 exit_mm+0x226/0x300 kernel/exit.c:565 do_exit+0x9f6/0x26a0 kernel/exit.c:858 do_group_exit+0x202/0x2b0 kernel/exit.c:1021 get_signal+0x16f7/0x17d0 kernel/signal.c:2870 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 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:303 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&base->lock); lock(krc.lock); lock(&base->lock); lock(krc.lock); *** DEADLOCK *** 6 locks held by syz.1.111/4126: #0: ffff8880753c44d8 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:117 [inline] #0: ffff8880753c44d8 (&mm->mmap_lock){++++}-{3:3}, at: exit_mmap+0x1bb/0x9f0 mm/mmap.c:3212 #1: ffff888024537918 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] #1: ffff888024537918 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pte_range mm/memory.c:1417 [inline] #1: ffff888024537918 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pmd_range mm/memory.c:1574 [inline] #1: ffff888024537918 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pud_range mm/memory.c:1603 [inline] #1: ffff888024537918 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_p4d_range mm/memory.c:1624 [inline] #1: ffff888024537918 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: unmap_page_range+0xacc/0x2740 mm/memory.c:1645 #2: ffffffff8d32af40 (rcu_read_lock_sched){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #2: ffffffff8d32af40 (rcu_read_lock_sched){....}-{1:2}, at: rcu_read_lock_sched include/linux/rcupdate.h:883 [inline] #2: ffffffff8d32af40 (rcu_read_lock_sched){....}-{1:2}, at: pfn_valid+0xf6/0x440 include/linux/mmzone.h:1857 #3: ffffc90000007bc0 ((&app->join_timer)){+.-.}-{0:0}, at: call_timer_fn+0xc2/0x6b0 kernel/time/timer.c:1501 #4: ffff8880b8e28358 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x120/0x260 kernel/time/timer.c:999 #5: ffffffff8d32afc0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #5: ffffffff8d32afc0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #5: ffffffff8d32afc0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] #5: ffffffff8d32afc0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run3+0x146/0x440 kernel/trace/bpf_trace.c:2313 stack backtrace: CPU: 0 PID: 4126 Comm: syz.1.111 Not tainted 6.1.109-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/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 __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:2991 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3311 [inline] kvfree_call_rcu+0x1b2/0x8c0 kernel/rcu/tree.c:3402 trie_delete_elem+0x53a/0x690 kernel/bpf/lpm_trie.c:532 bpf_prog_9c69e7db813340a1+0x3d/0x41 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_run3+0x231/0x440 kernel/trace/bpf_trace.c:2313 trace_timer_start include/trace/events/timer.h:53 [inline] enqueue_timer+0x440/0x600 kernel/time/timer.c:609 __mod_timer+0x92b/0xee0 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1504 expire_timers kernel/time/timer.c:1549 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1820 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833 handle_softirqs+0x2ee/0xa40 kernel/softirq.c:571 __do_softirq kernel/softirq.c:605 [inline] invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x157/0x240 kernel/softirq.c:654 irq_exit_rcu+0x5/0x20 kernel/softirq.c:666 sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 RIP: 0010:lockdep_enabled kernel/locking/lockdep.c:122 [inline] RIP: 0010:lock_release+0x11a/0xa20 kernel/locking/lockdep.c:5675 Code: 0f 85 cd 05 00 00 83 3d b7 66 2f 0d 00 0f 84 2b 05 00 00 65 8b 05 46 cf 97 7e 85 c0 0f 85 1c 05 00 00 65 4c 8b 35 b6 c5 97 7e <49> 8d 9e dc 0a 00 00 48 89 d8 48 c1 e8 03 42 0f b6 04 38 84 c0 0f RSP: 0018:ffffc900039e7160 EFLAGS: 00000246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff816aa937 RDX: 0000000000000000 RSI: ffffffff8b5d69a0 RDI: ffffffff8b5d6960 RBP: ffffc900039e7298 R08: dffffc0000000000 R09: fffffbfff1d33b6e R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff9200073ce38 R13: ffffffff81ecf6f6 R14: ffff888025440000 R15: dffffc0000000000 rcu_lock_release include/linux/rcupdate.h:355 [inline] rcu_read_unlock_sched include/linux/rcupdate.h:904 [inline] pfn_valid+0x3eb/0x440 include/linux/mmzone.h:1867 page_table_check_clear+0x1e/0x6d0 mm/page_table_check.c:67 zap_pte_range mm/memory.c:1435 [inline] zap_pmd_range mm/memory.c:1574 [inline] zap_pud_range mm/memory.c:1603 [inline] zap_p4d_range mm/memory.c:1624 [inline] unmap_page_range+0x1b4a/0x2740 mm/memory.c:1645 unmap_vmas+0x48b/0x640 mm/memory.c:1730 exit_mmap+0x252/0x9f0 mm/mmap.c:3227 __mmput+0x115/0x3c0 kernel/fork.c:1199 exit_mm+0x226/0x300 kernel/exit.c:565 do_exit+0x9f6/0x26a0 kernel/exit.c:858 do_group_exit+0x202/0x2b0 kernel/exit.c:1021 get_signal+0x16f7/0x17d0 kernel/signal.c:2870 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 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:303 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f5cfef7def9 Code: Unable to access opcode bytes at 0x7f5cfef7decf. RSP: 002b:00007f5cffd02fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: fffffffffffffff4 RBX: 00007f5cff135f80 RCX: 00007f5cfef7def9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007f5cfeff0b76 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f5cff135f80 R15: 00007ffc7a1cea28 ---------------- Code disassembly (best guess): 0: 0f 85 cd 05 00 00 jne 0x5d3 6: 83 3d b7 66 2f 0d 00 cmpl $0x0,0xd2f66b7(%rip) # 0xd2f66c4 d: 0f 84 2b 05 00 00 je 0x53e 13: 65 8b 05 46 cf 97 7e mov %gs:0x7e97cf46(%rip),%eax # 0x7e97cf60 1a: 85 c0 test %eax,%eax 1c: 0f 85 1c 05 00 00 jne 0x53e 22: 65 4c 8b 35 b6 c5 97 mov %gs:0x7e97c5b6(%rip),%r14 # 0x7e97c5e0 29: 7e * 2a: 49 8d 9e dc 0a 00 00 lea 0xadc(%r14),%rbx <-- trapping instruction 31: 48 89 d8 mov %rbx,%rax 34: 48 c1 e8 03 shr $0x3,%rax 38: 42 0f b6 04 38 movzbl (%rax,%r15,1),%eax 3d: 84 c0 test %al,%al 3f: 0f .byte 0xf