====================================================== WARNING: possible circular locking dependency detected 6.9.0-syzkaller-01893-g6bfd2d442af5 #0 Not tainted ------------------------------------------------------ syz-executor.1/13218 is trying to acquire lock: ffff88802c229558 (krc.lock){..-.}-{2:2}, at: krc_this_cpu_lock kernel/rcu/tree.c:3298 [inline] ffff88802c229558 (krc.lock){..-.}-{2:2}, at: add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3697 [inline] ffff88802c229558 (krc.lock){..-.}-{2:2}, at: kvfree_call_rcu+0xda/0xbe0 kernel/rcu/tree.c:3782 but task is already holding lock: ffff88805c31a9f8 (&trie->lock){..-.}-{2:2}, at: trie_update_elem+0xca/0xda0 kernel/bpf/lpm_trie.c:324 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&trie->lock){..-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 trie_delete_elem+0xb0/0x7e0 kernel/bpf/lpm_trie.c:451 0xffffffffa0000835 bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline] __bpf_prog_run include/linux/filter.h:657 [inline] bpf_prog_run include/linux/filter.h:664 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline] bpf_trace_run4+0x176/0x460 kernel/trace/bpf_trace.c:2422 trace_mm_page_alloc include/trace/events/kmem.h:177 [inline] __alloc_pages+0x3ad/0x2460 mm/page_alloc.c:4597 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2190 [inline] allocate_slab mm/slub.c:2353 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2406 ___slab_alloc+0xd28/0x1810 mm/slub.c:3592 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3682 __slab_alloc_node mm/slub.c:3735 [inline] slab_alloc_node mm/slub.c:3908 [inline] kmem_cache_alloc+0x2f3/0x330 mm/slub.c:3925 kmem_cache_zalloc include/linux/slab.h:739 [inline] fill_pool+0x275/0x5d0 lib/debugobjects.c:168 debug_objects_fill_pool lib/debugobjects.c:615 [inline] debug_object_activate+0x151/0x540 lib/debugobjects.c:704 debug_hrtimer_activate kernel/time/hrtimer.c:423 [inline] debug_activate kernel/time/hrtimer.c:478 [inline] enqueue_hrtimer+0x25/0x3c0 kernel/time/hrtimer.c:1085 __hrtimer_start_range_ns kernel/time/hrtimer.c:1260 [inline] hrtimer_start_range_ns+0x7c5/0xe10 kernel/time/hrtimer.c:1300 hrtimer_start_expires include/linux/hrtimer.h:289 [inline] tick_nohz_restart kernel/time/tick-sched.c:847 [inline] tick_nohz_restart_sched_tick+0x1c4/0x2f0 kernel/time/tick-sched.c:1102 tick_nohz_idle_update_tick kernel/time/tick-sched.c:1440 [inline] tick_nohz_idle_exit+0x21f/0x2e0 kernel/time/tick-sched.c:1483 do_idle+0x270/0x3f0 kernel/sched/idle.c:345 cpu_startup_entry+0x4f/0x60 kernel/sched/idle.c:430 start_secondary+0x220/0x2b0 arch/x86/kernel/smpboot.c:313 common_startup_64+0x13e/0x148 -> #1 (hrtimer_bases.lock){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 lock_hrtimer_base kernel/time/hrtimer.c:175 [inline] hrtimer_start_range_ns+0xe7/0xe10 kernel/time/hrtimer.c:1298 hrtimer_start include/linux/hrtimer.h:275 [inline] run_page_cache_worker kernel/rcu/tree.c:3679 [inline] kvfree_call_rcu+0x81d/0xbe0 kernel/rcu/tree.c:3784 rtnl_register_internal+0x343/0x670 net/core/rtnetlink.c:265 rtnl_register+0x34/0x80 net/core/rtnetlink.c:315 ip_rt_init+0x343/0x450 net/ipv4/route.c:3720 ip_init+0xe/0x20 net/ipv4/ip_output.c:1663 inet_init+0x3f0/0x6f0 net/ipv4/af_inet.c:2023 do_one_initcall+0x128/0x630 init/main.c:1245 do_initcall_level init/main.c:1307 [inline] do_initcalls init/main.c:1323 [inline] do_basic_setup init/main.c:1342 [inline] kernel_init_freeable+0x660/0xc50 init/main.c:1556 kernel_init+0x1c/0x2b0 init/main.c:1445 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #0 (krc.lock){..-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 krc_this_cpu_lock kernel/rcu/tree.c:3298 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3697 [inline] kvfree_call_rcu+0xda/0xbe0 kernel/rcu/tree.c:3782 trie_update_elem+0xb05/0xda0 kernel/bpf/lpm_trie.c:385 bpf_map_update_value+0x2c1/0x6c0 kernel/bpf/syscall.c:203 generic_map_update_batch+0x454/0x5f0 kernel/bpf/syscall.c:1876 bpf_map_do_batch+0x615/0x6e0 kernel/bpf/syscall.c:5174 __sys_bpf+0x18ff/0x58b0 kernel/bpf/syscall.c:5724 __do_sys_bpf kernel/bpf/syscall.c:5767 [inline] __se_sys_bpf kernel/bpf/syscall.c:5765 [inline] __ia32_sys_bpf+0x76/0xe0 kernel/bpf/syscall.c:5765 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e other info that might help us debug this: Chain exists of: krc.lock --> hrtimer_bases.lock --> &trie->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&trie->lock); lock(hrtimer_bases.lock); lock(&trie->lock); lock(krc.lock); *** DEADLOCK *** 2 locks held by syz-executor.1/13218: #0: ffffffff8d7b50a0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #0: ffffffff8d7b50a0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #0: ffffffff8d7b50a0 (rcu_read_lock){....}-{1:2}, at: bpf_map_update_value+0x24b/0x6c0 kernel/bpf/syscall.c:202 #1: ffff88805c31a9f8 (&trie->lock){..-.}-{2:2}, at: trie_update_elem+0xca/0xda0 kernel/bpf/lpm_trie.c:324 stack backtrace: CPU: 0 PID: 13218 Comm: syz-executor.1 Not tainted 6.9.0-syzkaller-01893-g6bfd2d442af5 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 krc_this_cpu_lock kernel/rcu/tree.c:3298 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3697 [inline] kvfree_call_rcu+0xda/0xbe0 kernel/rcu/tree.c:3782 trie_update_elem+0xb05/0xda0 kernel/bpf/lpm_trie.c:385 bpf_map_update_value+0x2c1/0x6c0 kernel/bpf/syscall.c:203 generic_map_update_batch+0x454/0x5f0 kernel/bpf/syscall.c:1876 bpf_map_do_batch+0x615/0x6e0 kernel/bpf/syscall.c:5174 __sys_bpf+0x18ff/0x58b0 kernel/bpf/syscall.c:5724 __do_sys_bpf kernel/bpf/syscall.c:5767 [inline] __se_sys_bpf kernel/bpf/syscall.c:5765 [inline] __ia32_sys_bpf+0x76/0xe0 kernel/bpf/syscall.c:5765 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7270579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f5e625ac EFLAGS: 00000292 ORIG_RAX: 0000000000000165 RAX: ffffffffffffffda RBX: 000000000000001a RCX: 0000000020000240 RDX: 0000000000000038 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi