syzbot


possible deadlock in debug_check_no_obj_freed (2)

Status: upstream: reported on 2025/05/26 13:49
Subsystems: serial
[Documentation on labels]
Reported-by: syzbot+84186930788ce222de35@syzkaller.appspotmail.com
First crash: 42d, last: 22d
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] Monthly serial report (Jun 2025) 0 (1) 2025/06/23 07:33
[syzbot] [serial?] possible deadlock in debug_check_no_obj_freed (2) 0 (1) 2025/05/26 13:49
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in debug_check_no_obj_freed bpf 1 262d 258d 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 1 131d 131d 0/3 auto-obsoleted due to no activity on 2025/06/02 22:49

Sample crash report:
ODEBUG: object ffffc9000424fa98 is on stack ffffc90004248000, but NOT annotated.
======================================================
WARNING: possible circular locking dependency detected
6.16.0-rc1-syzkaller-00004-gaef17cb3d3c4 #0 Not tainted
------------------------------------------------------
bch-copygc/loop/7297 is trying to acquire lock:
ffffffff8e4d1dc0 (console_owner){-...}-{0:0}, at: console_trylock_spinning kernel/printk/printk.c:2048 [inline]
ffffffff8e4d1dc0 (console_owner){-...}-{0:0}, at: vprintk_emit+0x4d4/0x6d0 kernel/printk/printk.c:2449

but task is already holding lock:
ffffffff9b00f4f8 (&obj_hash[i].lock){-.-.}-{2:2}, at: __debug_object_init+0xec/0x3d0 lib/debugobjects.c:741

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&obj_hash[i].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
       __debug_check_no_obj_freed lib/debugobjects.c:1088 [inline]
       debug_check_no_obj_freed+0x1c9/0x600 lib/debugobjects.c:1129
       free_pages_prepare mm/page_alloc.c:1255 [inline]
       __free_frozen_pages+0x34a/0x1180 mm/page_alloc.c:2706
       stack_depot_save_flags+0x354/0xa40 lib/stackdepot.c:678
       kasan_save_stack+0x42/0x60 mm/kasan/common.c:48
       kasan_save_track+0x14/0x30 mm/kasan/common.c:68
       poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
       __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394
       kasan_kmalloc include/linux/kasan.h:260 [inline]
       __do_kmalloc_node mm/slub.c:4328 [inline]
       __kmalloc_noprof+0x223/0x510 mm/slub.c:4340
       kmalloc_noprof include/linux/slab.h:909 [inline]
       tty_buffer_alloc+0x297/0x3d0 drivers/tty/tty_buffer.c:180
       __tty_buffer_request_room+0x129/0x2c0 drivers/tty/tty_buffer.c:273
       __tty_insert_flip_string_flags+0xd5/0x420 drivers/tty/tty_buffer.c:309
       tty_insert_flip_string_fixed_flag include/linux/tty_flip.h:35 [inline]
       tty_insert_flip_string include/linux/tty_flip.h:83 [inline]
       tty_insert_flip_string_and_push_buffer+0x9c/0x1f0 drivers/tty/tty_buffer.c:559
       pty_write+0xd2/0x100 drivers/tty/pty.c:118
       tty_put_char+0x130/0x160 drivers/tty/tty_io.c:3154
       __process_echoes+0x11e/0xb10 drivers/tty/n_tty.c:708
       flush_echoes drivers/tty/n_tty.c:791 [inline]
       __receive_buf drivers/tty/n_tty.c:1626 [inline]
       n_tty_receive_buf_common+0xa28/0x1980 drivers/tty/n_tty.c:1723
       tty_ldisc_receive_buf+0xaa/0x1a0 drivers/tty/tty_buffer.c:387
       tty_port_default_receive_buf+0x70/0xb0 drivers/tty/tty_port.c:37
       receive_buf drivers/tty/tty_buffer.c:445 [inline]
       flush_to_ldisc+0x26b/0x780 drivers/tty/tty_buffer.c:495
       process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3238
       process_scheduled_works kernel/workqueue.c:3321 [inline]
       worker_thread+0x6c8/0xf10 kernel/workqueue.c:3402
       kthread+0x3c5/0x780 kernel/kthread.c:464
       ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148
       ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

-> #2 (&port->lock#2){-.-.}-{3:3}:
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
       tty_port_tty_get+0x21/0x100 drivers/tty/tty_port.c:307
       tty_port_default_wakeup+0x15/0x40 drivers/tty/tty_port.c:66
       serial8250_tx_chars+0x68e/0x860 drivers/tty/serial/8250/8250_port.c:1838
       serial8250_handle_irq+0x761/0xcb0 drivers/tty/serial/8250/8250_port.c:1946
       serial8250_default_handle_irq+0x9a/0x210 drivers/tty/serial/8250/8250_port.c:1966
       serial8250_interrupt+0x106/0x210 drivers/tty/serial/8250/8250_core.c:86
       __handle_irq_event_percpu+0x22c/0x7d0 kernel/irq/handle.c:158
       handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
       handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:210
       handle_edge_irq+0x28e/0xab0 kernel/irq/chip.c:789
       generic_handle_irq_desc include/linux/irqdesc.h:173 [inline]
       handle_irq arch/x86/kernel/irq.c:254 [inline]
       call_irq_handler arch/x86/kernel/irq.c:266 [inline]
       __common_interrupt+0xe2/0x250 arch/x86/kernel/irq.c:292
       common_interrupt+0xba/0xe0 arch/x86/kernel/irq.c:285
       asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
       native_safe_halt arch/x86/include/asm/irqflags.h:48 [inline]
       pv_native_safe_halt+0xf/0x20 arch/x86/kernel/paravirt.c:81
       arch_safe_halt arch/x86/include/asm/paravirt.h:107 [inline]
       default_idle+0x13/0x20 arch/x86/kernel/process.c:749
       default_idle_call+0x6d/0xb0 kernel/sched/idle.c:117
       cpuidle_idle_call kernel/sched/idle.c:185 [inline]
       do_idle+0x391/0x510 kernel/sched/idle.c:325
       cpu_startup_entry+0x4f/0x60 kernel/sched/idle.c:423
       start_secondary+0x21d/0x2b0 arch/x86/kernel/smpboot.c:315
       common_startup_64+0x13e/0x148

-> #1 (&port_lock_key){-.-.}-{3:3}:
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
       uart_port_lock_irqsave include/linux/serial_core.h:717 [inline]
       serial8250_console_write+0x181/0x1890 drivers/tty/serial/8250/8250_port.c:3415
       console_emit_next_record kernel/printk/printk.c:3138 [inline]
       console_flush_all+0x801/0xc60 kernel/printk/printk.c:3226
       __console_flush_and_unlock kernel/printk/printk.c:3285 [inline]
       console_unlock+0xd8/0x210 kernel/printk/printk.c:3325
       vprintk_emit+0x418/0x6d0 kernel/printk/printk.c:2450
       _printk+0xc7/0x100 kernel/printk/printk.c:2475
       register_console+0xc2d/0x11b0 kernel/printk/printk.c:4125
       univ8250_console_init+0x5f/0x90 drivers/tty/serial/8250/8250_core.c:513
       console_init+0x14f/0x680 kernel/printk/printk.c:4323
       start_kernel+0x29f/0x4d0 init/main.c:1035
       x86_64_start_reservations+0x18/0x30 arch/x86/kernel/head64.c:307
       x86_64_start_kernel+0x130/0x190 arch/x86/kernel/head64.c:288
       common_startup_64+0x13e/0x148

-> #0 (console_owner){-...}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3168 [inline]
       check_prevs_add kernel/locking/lockdep.c:3287 [inline]
       validate_chain kernel/locking/lockdep.c:3911 [inline]
       __lock_acquire+0x126f/0x1c90 kernel/locking/lockdep.c:5240
       lock_acquire kernel/locking/lockdep.c:5871 [inline]
       lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5828
       console_trylock_spinning kernel/printk/printk.c:2048 [inline]
       vprintk_emit+0x4e5/0x6d0 kernel/printk/printk.c:2449
       _printk+0xc7/0x100 kernel/printk/printk.c:2475
       debug_object_is_on_stack lib/debugobjects.c:649 [inline]
       lookup_object_or_alloc.part.0+0x3d7/0x590 lib/debugobjects.c:688
       lookup_object_or_alloc lib/debugobjects.c:665 [inline]
       __debug_object_init+0x2a9/0x3d0 lib/debugobjects.c:743
       __init_work+0x4c/0x60 kernel/workqueue.c:677
       rhashtable_init_noprof+0x49f/0x7e0 lib/rhashtable.c:1085
       bch2_copygc_thread+0xf6/0xdd0 fs/bcachefs/movinggc.c:353
       kthread+0x3c5/0x780 kernel/kthread.c:464
       ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148
       ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

other info that might help us debug this:

Chain exists of:
  console_owner --> &port->lock#2 --> &obj_hash[i].lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&obj_hash[i].lock);
                               lock(&port->lock#2);
                               lock(&obj_hash[i].lock);
  lock(console_owner);

 *** DEADLOCK ***

1 lock held by bch-copygc/loop/7297:
 #0: ffffffff9b00f4f8 (&obj_hash[i].lock){-.-.}-{2:2}, at: __debug_object_init+0xec/0x3d0 lib/debugobjects.c:741

stack backtrace:
CPU: 0 UID: 0 PID: 7297 Comm: bch-copygc/loop Not tainted 6.16.0-rc1-syzkaller-00004-gaef17cb3d3c4 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 print_circular_bug+0x275/0x350 kernel/locking/lockdep.c:2046
 check_noncircular+0x14c/0x170 kernel/locking/lockdep.c:2178
 check_prev_add kernel/locking/lockdep.c:3168 [inline]
 check_prevs_add kernel/locking/lockdep.c:3287 [inline]
 validate_chain kernel/locking/lockdep.c:3911 [inline]
 __lock_acquire+0x126f/0x1c90 kernel/locking/lockdep.c:5240
 lock_acquire kernel/locking/lockdep.c:5871 [inline]
 lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5828
 console_trylock_spinning kernel/printk/printk.c:2048 [inline]
 vprintk_emit+0x4e5/0x6d0 kernel/printk/printk.c:2449
 _printk+0xc7/0x100 kernel/printk/printk.c:2475
 debug_object_is_on_stack lib/debugobjects.c:649 [inline]
 lookup_object_or_alloc.part.0+0x3d7/0x590 lib/debugobjects.c:688
 lookup_object_or_alloc lib/debugobjects.c:665 [inline]
 __debug_object_init+0x2a9/0x3d0 lib/debugobjects.c:743
 __init_work+0x4c/0x60 kernel/workqueue.c:677
 rhashtable_init_noprof+0x49f/0x7e0 lib/rhashtable.c:1085
 bch2_copygc_thread+0xf6/0xdd0 fs/bcachefs/movinggc.c:353
 kthread+0x3c5/0x780 kernel/kthread.c:464
 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>
------------[ cut here ]------------
WARNING: CPU: 0 PID: 7297 at lib/debugobjects.c:655 debug_object_is_on_stack lib/debugobjects.c:655 [inline]
WARNING: CPU: 0 PID: 7297 at lib/debugobjects.c:655 lookup_object_or_alloc.part.0+0x2b1/0x590 lib/debugobjects.c:688
Modules linked in:
CPU: 0 UID: 0 PID: 7297 Comm: bch-copygc/loop Not tainted 6.16.0-rc1-syzkaller-00004-gaef17cb3d3c4 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
RIP: 0010:debug_object_is_on_stack lib/debugobjects.c:655 [inline]
RIP: 0010:lookup_object_or_alloc.part.0+0x2b1/0x590 lib/debugobjects.c:688
Code: 0e 48 8d 7d 20 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 58 02 00 00 48 8b 55 20 4c 89 e6 48 c7 c7 60 67 15 8c e8 a0 ea bb fc 90 <0f> 0b 90 48 83 c4 18 48 89 d8 5b 5d 41 5c 41 5d 41 5e 41 5f e9 d1
RSP: 0018:ffffc9000424f7b0 EFLAGS: 00010086
RAX: 0000000000000050 RBX: ffff888079650d90 RCX: ffffffff819b01d9
RDX: 0000000000000000 RSI: ffffffff819b8066 RDI: 0000000000000005
RBP: ffff88802ef9da00 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000001 R11: 692064696c617375 R12: ffffc9000424fa98
R13: ffff88802ef9da00 R14: 0000000000000000 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff88812475b000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f12f1928f98 CR3: 000000007866d000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 lookup_object_or_alloc lib/debugobjects.c:665 [inline]
 __debug_object_init+0x2a9/0x3d0 lib/debugobjects.c:743
 __init_work+0x4c/0x60 kernel/workqueue.c:677
 rhashtable_init_noprof+0x49f/0x7e0 lib/rhashtable.c:1085
 bch2_copygc_thread+0xf6/0xdd0 fs/bcachefs/movinggc.c:353
 kthread+0x3c5/0x780 kernel/kthread.c:464
 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>

Crashes (11):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/11 16:08 upstream aef17cb3d3c4 5d7e17ca .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in debug_check_no_obj_freed
2025/06/07 15:49 upstream 7a912d04415b 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in debug_check_no_obj_freed
2025/05/27 09:52 upstream 914873bc7df9 874a1386 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in debug_check_no_obj_freed
2025/06/09 00:32 linux-next 475c850a7fdd 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in debug_check_no_obj_freed
2025/06/01 19:51 linux-next 3a83b350b5be 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in debug_check_no_obj_freed
2025/05/31 21:30 linux-next 3a83b350b5be 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in debug_check_no_obj_freed
2025/05/28 04:11 linux-next fefff2755f2a 874a1386 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in debug_check_no_obj_freed
2025/05/27 23:59 linux-next fefff2755f2a 874a1386 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in debug_check_no_obj_freed
2025/05/26 05:27 linux-next 176e917e010c 2d4582d0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in debug_check_no_obj_freed
2025/05/23 07:12 linux-next 460178e842c7 fa44301a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in debug_check_no_obj_freed
2025/05/22 13:45 linux-next 460178e842c7 0919b50b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in debug_check_no_obj_freed
* Struck through repros no longer work on HEAD.