====================================================== WARNING: possible circular locking dependency detected 6.1.147-syzkaller #0 Not tainted ------------------------------------------------------ syz.4.279/4774 is trying to acquire lock: ffff88805b0788d8 (&htab->lockdep_key#4){....}-{2:2}, at: htab_lock_bucket+0x17d/0x300 kernel/bpf/hashtab.c:166 but task is already holding lock: ffff88805b8f0da0 (&htab->lockdep_key#5){....}-{2:2}, at: htab_lock_bucket+0x17d/0x300 kernel/bpf/hashtab.c:166 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&htab->lockdep_key#5){....}-{2:2}: __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 htab_lock_bucket+0x17d/0x300 kernel/bpf/hashtab.c:166 htab_lru_map_delete_elem+0x1ad/0x760 kernel/bpf/hashtab.c:1438 bpf_prog_5966e622e8031da9+0x42/0x4b bpf_dispatcher_nop_func include/linux/bpf.h:1001 [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:2285 [inline] bpf_trace_run2+0x1cd/0x3b0 kernel/trace/bpf_trace.c:2324 __traceiter_contention_begin+0x74/0xa0 include/trace/events/lock.h:95 trace_contention_begin+0x142/0x190 include/trace/events/lock.h:95 __pv_queued_spin_lock_slowpath+0xdc/0x9c0 kernel/locking/qspinlock.c:405 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [inline] queued_spin_lock_slowpath+0x43/0x50 arch/x86/include/asm/qspinlock.h:51 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x217/0x280 kernel/locking/spinlock_debug.c:115 htab_lock_bucket+0x17d/0x300 kernel/bpf/hashtab.c:166 htab_lru_map_delete_elem+0x1ad/0x760 kernel/bpf/hashtab.c:1438 0xffffffffa0000996 bpf_dispatcher_nop_func include/linux/bpf.h:1001 [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:2285 [inline] bpf_trace_run2+0x1cd/0x3b0 kernel/trace/bpf_trace.c:2324 __traceiter_contention_begin+0x74/0xa0 include/trace/events/lock.h:95 trace_contention_begin+0x123/0x170 include/trace/events/lock.h:95 __mutex_lock_common kernel/locking/mutex.c:605 [inline] __mutex_lock+0x131/0xaf0 kernel/locking/mutex.c:747 tracepoint_probe_unregister+0x2c/0x930 kernel/tracepoint.c:548 bpf_raw_tp_link_release+0x5f/0x80 kernel/bpf/syscall.c:3190 bpf_link_free kernel/bpf/syscall.c:2759 [inline] bpf_link_put+0x22a/0x2c0 kernel/bpf/syscall.c:2785 bpf_link_release+0x37/0x40 kernel/bpf/syscall.c:2794 __fput+0x22c/0x920 fs/file_table.c:320 task_work_run+0x1ca/0x250 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177 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+0x16/0x40 kernel/entry/common.c:303 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&htab->lockdep_key#4){....}-{2:2}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 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 htab_lock_bucket+0x17d/0x300 kernel/bpf/hashtab.c:166 htab_lru_map_delete_elem+0x1ad/0x760 kernel/bpf/hashtab.c:1438 0xffffffffa0000996 bpf_dispatcher_nop_func include/linux/bpf.h:1001 [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:2285 [inline] bpf_trace_run2+0x1cd/0x3b0 kernel/trace/bpf_trace.c:2324 __traceiter_contention_begin+0x74/0xa0 include/trace/events/lock.h:95 trace_contention_begin+0x142/0x190 include/trace/events/lock.h:95 __pv_queued_spin_lock_slowpath+0xdc/0x9c0 kernel/locking/qspinlock.c:405 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [inline] queued_spin_lock_slowpath+0x43/0x50 arch/x86/include/asm/qspinlock.h:51 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x217/0x280 kernel/locking/spinlock_debug.c:115 htab_lock_bucket+0x17d/0x300 kernel/bpf/hashtab.c:166 htab_lru_map_delete_elem+0x1ad/0x760 kernel/bpf/hashtab.c:1438 bpf_prog_5966e622e8031da9+0x42/0x4b bpf_dispatcher_nop_func include/linux/bpf.h:1001 [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:2285 [inline] bpf_trace_run2+0x1cd/0x3b0 kernel/trace/bpf_trace.c:2324 __traceiter_contention_begin+0x74/0xa0 include/trace/events/lock.h:95 trace_contention_begin+0x123/0x170 include/trace/events/lock.h:95 __mutex_lock_common kernel/locking/mutex.c:605 [inline] __mutex_lock+0x131/0xaf0 kernel/locking/mutex.c:747 tracepoint_probe_unregister+0x2c/0x930 kernel/tracepoint.c:548 bpf_raw_tp_link_release+0x5f/0x80 kernel/bpf/syscall.c:3190 bpf_link_free kernel/bpf/syscall.c:2759 [inline] bpf_link_put+0x22a/0x2c0 kernel/bpf/syscall.c:2785 bpf_link_release+0x37/0x40 kernel/bpf/syscall.c:2794 __fput+0x22c/0x920 fs/file_table.c:320 task_work_run+0x1ca/0x250 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177 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+0x16/0x40 kernel/entry/common.c:303 do_syscall_64+0x58/0xa0 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(&htab->lockdep_key#5); lock(&htab->lockdep_key#4); lock(&htab->lockdep_key#5); lock(&htab->lockdep_key#4); *** DEADLOCK *** 4 locks held by syz.4.279/4774: #0: ffffffff8cb71f48 (tracepoints_mutex){+.+.}-{3:3}, at: tracepoint_probe_unregister+0x2c/0x930 kernel/tracepoint.c:548 #1: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #1: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #1: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2284 [inline] #1: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0xda/0x3b0 kernel/trace/bpf_trace.c:2324 #2: ffff88805b8f0da0 (&htab->lockdep_key#5){....}-{2:2}, at: htab_lock_bucket+0x17d/0x300 kernel/bpf/hashtab.c:166 #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2284 [inline] #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0xda/0x3b0 kernel/trace/bpf_trace.c:2324 stack backtrace: CPU: 1 PID: 4774 Comm: syz.4.279 Not tainted 6.1.147-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 check_noncircular+0x274/0x310 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 kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 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 htab_lock_bucket+0x17d/0x300 kernel/bpf/hashtab.c:166 htab_lru_map_delete_elem+0x1ad/0x760 kernel/bpf/hashtab.c:1438