syzbot


possible deadlock in debug_check_no_obj_freed

Status: upstream: reported on 2025/07/24 08:35
Reported-by: syzbot+3c1e658da7a98bd082a2@syzkaller.appspotmail.com
First crash: 100d, last: 55d
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in debug_check_no_obj_freed (2) serial 4 11 143d 159d 0/29 auto-obsoleted due to no activity on 2025/08/20 16:08
upstream possible deadlock in debug_check_no_obj_freed bpf 4 1 383d 379d 0/29 auto-obsoleted due to no activity on 2025/01/22 14:24
linux-6.1 possible deadlock in debug_check_no_obj_freed 4 1 252d 252d 0/3 auto-obsoleted due to no activity on 2025/06/02 22:49
linux-6.1 possible deadlock in debug_check_no_obj_freed (2) 4 1 33d 33d 0/3 upstream: reported on 2025/09/29 09:14

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.2.1795/11093 is trying to acquire lock:
ffffffff97126d10 (&obj_hash[i].lock){-.-.}-{2:2}, at: __debug_check_no_obj_freed lib/debugobjects.c:979 [inline]
ffffffff97126d10 (&obj_hash[i].lock){-.-.}-{2:2}, at: debug_check_no_obj_freed+0x13a/0x540 lib/debugobjects.c:1020

but task is already holding lock:
ffff888030e0c238 (&trie->lock){..-.}-{2:2}, at: trie_update_elem+0xca/0xea0 kernel/bpf/lpm_trie.c:335

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&trie->lock){..-.}-{2:2}:
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0xa8/0xf0 kernel/locking/spinlock.c:162
       trie_delete_elem+0x96/0x6a0 kernel/bpf/lpm_trie.c:467
       0xffffffffa0000a0d
       bpf_dispatcher_nop_func include/linux/bpf.h:1213 [inline]
       __bpf_prog_run include/linux/filter.h:605 [inline]
       bpf_prog_run include/linux/filter.h:619 [inline]
       __bpf_trace_run kernel/trace/bpf_trace.c:2322 [inline]
       bpf_trace_run2+0x312/0x3c0 kernel/trace/bpf_trace.c:2361
       __bpf_trace_contention_end+0xdd/0x130 include/trace/events/lock.h:122
       trace_contention_end+0xe6/0x110 include/trace/events/lock.h:122
       __pv_queued_spin_lock_slowpath+0x7ec/0x9d0 kernel/locking/qspinlock.c:560
       pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:586 [inline]
       queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:51 [inline]
       queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
       do_raw_spin_lock+0x24e/0x2c0 kernel/locking/spinlock_debug.c:115
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
       _raw_spin_lock_irqsave+0xb4/0xf0 kernel/locking/spinlock.c:162
       debug_object_active_state+0x6f/0x340 lib/debugobjects.c:937
       debug_rcu_head_unqueue kernel/rcu/rcu.h:236 [inline]
       rcu_do_batch kernel/rcu/tree.c:2186 [inline]
       rcu_core+0xc3b/0x1720 kernel/rcu/tree.c:2467
       handle_softirqs+0x280/0x820 kernel/softirq.c:578
       __do_softirq kernel/softirq.c:612 [inline]
       invoke_softirq kernel/softirq.c:452 [inline]
       __irq_exit_rcu+0xc7/0x190 kernel/softirq.c:661
       irq_exit_rcu+0x9/0x20 kernel/softirq.c:673
       instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1088 [inline]
       sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1088
       asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:687
       lock_acquire+0x1f2/0x410 kernel/locking/lockdep.c:5758
       rcu_lock_acquire include/linux/rcupdate.h:334 [inline]
       rcu_read_lock_sched include/linux/rcupdate.h:878 [inline]
       pfn_valid+0xe9/0x420 include/linux/mmzone.h:2011
       page_table_check_set+0x25/0x6f0 mm/page_table_check.c:110
       page_table_check_ptes_set include/linux/page_table_check.h:74 [inline]
       set_ptes include/linux/pgtable.h:238 [inline]
       copy_present_pte mm/memory.c:978 [inline]
       copy_pte_range mm/memory.c:1082 [inline]
       copy_pmd_range mm/memory.c:1167 [inline]
       copy_pud_range mm/memory.c:1204 [inline]
       copy_p4d_range mm/memory.c:1228 [inline]
       copy_page_range+0x248d/0x3600 mm/memory.c:1322
       dup_mmap kernel/fork.c:764 [inline]
       dup_mm kernel/fork.c:1692 [inline]
       copy_mm+0x112a/0x1c20 kernel/fork.c:1741
       copy_process+0x16d3/0x3d70 kernel/fork.c:2506
       kernel_clone+0x21b/0x840 kernel/fork.c:2914
       __do_sys_clone kernel/fork.c:3057 [inline]
       __se_sys_clone kernel/fork.c:3041 [inline]
       __x64_sys_clone+0x18c/0x1e0 kernel/fork.c:3041
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&obj_hash[i].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+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
       lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0xa8/0xf0 kernel/locking/spinlock.c:162
       __debug_check_no_obj_freed lib/debugobjects.c:979 [inline]
       debug_check_no_obj_freed+0x13a/0x540 lib/debugobjects.c:1020
       free_pages_prepare mm/page_alloc.c:1160 [inline]
       __free_pages_ok+0x2c2/0xad0 mm/page_alloc.c:1284
       free_large_kmalloc+0x101/0x1a0 mm/slab_common.c:984
       trie_update_elem+0x6d1/0xea0 kernel/bpf/lpm_trie.c:444
       bpf_map_update_value+0x660/0x720 kernel/bpf/syscall.c:201
       map_update_elem+0x57b/0x700 kernel/bpf/syscall.c:1561
       __sys_bpf+0x652/0x800 kernel/bpf/syscall.c:5455
       __do_sys_bpf kernel/bpf/syscall.c:5571 [inline]
       __se_sys_bpf kernel/bpf/syscall.c:5569 [inline]
       __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5569
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&trie->lock);
                               lock(&obj_hash[i].lock);
                               lock(&trie->lock);
  lock(&obj_hash[i].lock);

 *** DEADLOCK ***

2 locks held by syz.2.1795/11093:
 #0: ffffffff8cd2fc20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:334 [inline]
 #0: ffffffff8cd2fc20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:786 [inline]
 #0: ffffffff8cd2fc20 (rcu_read_lock){....}-{1:2}, at: bpf_map_update_value+0x41d/0x720 kernel/bpf/syscall.c:200
 #1: ffff888030e0c238 (&trie->lock){..-.}-{2:2}, at: trie_update_elem+0xca/0xea0 kernel/bpf/lpm_trie.c:335

stack backtrace:
CPU: 0 PID: 11093 Comm: syz.2.1795 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
 check_noncircular+0x2bd/0x3c0 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+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xa8/0xf0 kernel/locking/spinlock.c:162
 __debug_check_no_obj_freed lib/debugobjects.c:979 [inline]
 debug_check_no_obj_freed+0x13a/0x540 lib/debugobjects.c:1020
 free_pages_prepare mm/page_alloc.c:1160 [inline]
 __free_pages_ok+0x2c2/0xad0 mm/page_alloc.c:1284
 free_large_kmalloc+0x101/0x1a0 mm/slab_common.c:984
 trie_update_elem+0x6d1/0xea0 kernel/bpf/lpm_trie.c:444
 bpf_map_update_value+0x660/0x720 kernel/bpf/syscall.c:201
 map_update_elem+0x57b/0x700 kernel/bpf/syscall.c:1561
 __sys_bpf+0x652/0x800 kernel/bpf/syscall.c:5455
 __do_sys_bpf kernel/bpf/syscall.c:5571 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5569 [inline]
 __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5569
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f5def58ebe9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f5df04dc038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f5def7c5fa0 RCX: 00007f5def58ebe9
RDX: 0000000000000090 RSI: 0000200000000680 RDI: 0000000000000002
RBP: 00007f5def611e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5def7c6038 R14: 00007f5def7c5fa0 R15: 00007ffe63f265c8
 </TASK>

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/07 21:23 linux-6.6.y 355bd0b51d2f d291dd2d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan-perf possible deadlock in debug_check_no_obj_freed
2025/08/12 22:25 linux-6.6.y 3a8ababb8b6a 22ec1469 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan-perf possible deadlock in debug_check_no_obj_freed
2025/07/24 08:35 linux-6.6.y dbcb8d8e4163 0c1d6ded .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan-perf possible deadlock in debug_check_no_obj_freed
* Struck through repros no longer work on HEAD.