ODEBUG: object ffffc9000b30fb90 is on stack ffffc9000b308000, but NOT annotated.
======================================================
WARNING: possible circular locking dependency detected
6.15.0-rc7-next-20250522-syzkaller #0 Not tainted
------------------------------------------------------
bch-copygc/loop/9382 is trying to acquire lock:
ffffffff8e133280 (console_owner){-.-.}-{0:0}, at: console_trylock_spinning kernel/printk/printk.c:2048 [inline]
ffffffff8e133280 (console_owner){-.-.}-{0:0}, at: vprintk_emit+0x444/0x7a0 kernel/printk/printk.c:2449
but task is already holding lock:
ffffffff99d343c0 (&obj_hash[i].lock){-.-.}-{2:2}, at: __debug_object_init+0x85/0x3c0 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}:
lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5871
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa7/0xf0 kernel/locking/spinlock.c:162
__debug_check_no_obj_freed lib/debugobjects.c:1088 [inline]
debug_check_no_obj_freed+0x17a/0x470 lib/debugobjects.c:1129
free_pages_prepare mm/page_alloc.c:1255 [inline]
__free_frozen_pages+0x509/0xe70 mm/page_alloc.c:2706
stack_depot_save_flags+0x445/0x900 lib/stackdepot.c:678
kasan_save_stack mm/kasan/common.c:48 [inline]
kasan_save_track+0x4f/0x80 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
__kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:394
kasan_kmalloc include/linux/kasan.h:260 [inline]
__do_kmalloc_node mm/slub.c:4327 [inline]
__kmalloc_noprof+0x27a/0x4f0 mm/slub.c:4339
kmalloc_noprof include/linux/slab.h:909 [inline]
tty_buffer_alloc drivers/tty/tty_buffer.c:180 [inline]
__tty_buffer_request_room+0x1c8/0x520 drivers/tty/tty_buffer.c:273
__tty_insert_flip_string_flags+0xb8/0x430 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+0xa3/0x1f0 drivers/tty/tty_buffer.c:559
pty_write+0xa7/0xe0 drivers/tty/pty.c:118
n_tty_write+0x5db/0x11d0 drivers/tty/n_tty.c:2399
iterate_tty_write drivers/tty/tty_io.c:1006 [inline]
file_tty_write+0x501/0x990 drivers/tty/tty_io.c:1081
new_sync_write fs/read_write.c:593 [inline]
vfs_write+0x548/0xa90 fs/read_write.c:686
ksys_write+0x145/0x250 fs/read_write.c:738
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #2 (&port->lock#2){-.-.}-{3:3}:
lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5871
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa7/0xf0 kernel/locking/spinlock.c:162
tty_port_tty_get drivers/tty/tty_port.c:307 [inline]
tty_port_default_wakeup+0x21/0xf0 drivers/tty/tty_port.c:66
serial8250_tx_chars+0x72e/0x970 drivers/tty/serial/8250/8250_port.c:1838
serial8250_handle_irq+0x633/0xbb0 drivers/tty/serial/8250/8250_port.c:1946
serial8250_default_handle_irq+0xbf/0x1b0 drivers/tty/serial/8250/8250_port.c:1966
serial8250_interrupt+0xa2/0x1d0 drivers/tty/serial/8250/8250_core.c:86
__handle_irq_event_percpu+0x28c/0x980 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
handle_irq_event+0x8b/0x1e0 kernel/irq/handle.c:210
handle_edge_irq+0x267/0x9c0 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+0x140/0x250 arch/x86/kernel/irq.c:292
common_interrupt+0xb6/0xe0 arch/x86/kernel/irq.c:285
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
_raw_spin_unlock_irqrestore+0xa8/0x110 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
uart_port_unlock_irqrestore include/linux/serial_core.h:788 [inline]
uart_port_unlock_deref+0x111/0x2f0 drivers/tty/serial/serial_core.c:91
uart_write+0xe8/0x130 drivers/tty/serial/serial_core.c:637
process_output_block drivers/tty/n_tty.c:561 [inline]
n_tty_write+0xd32/0x11d0 drivers/tty/n_tty.c:2377
iterate_tty_write drivers/tty/tty_io.c:1006 [inline]
file_tty_write+0x501/0x990 drivers/tty/tty_io.c:1081
new_sync_write fs/read_write.c:593 [inline]
vfs_write+0x548/0xa90 fs/read_write.c:686
ksys_write+0x145/0x250 fs/read_write.c:738
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #1 (&port_lock_key){-.-.}-{3:3}:
lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5871
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa7/0xf0 kernel/locking/spinlock.c:162
uart_port_lock_irqsave include/linux/serial_core.h:717 [inline]
serial8250_console_write+0x17e/0x1ba0 drivers/tty/serial/8250/8250_port.c:3415
console_emit_next_record kernel/printk/printk.c:3138 [inline]
console_flush_all+0x728/0xc40 kernel/printk/printk.c:3226
__console_flush_and_unlock kernel/printk/printk.c:3285 [inline]
console_unlock+0xc4/0x270 kernel/printk/printk.c:3325
vprintk_emit+0x5b7/0x7a0 kernel/printk/printk.c:2450
_printk+0xcf/0x120 kernel/printk/printk.c:2475
register_console+0xa8b/0xf90 kernel/printk/printk.c:4125
univ8250_console_init+0x52/0x90 drivers/tty/serial/8250/8250_core.c:513
console_init+0x1a1/0x670 kernel/printk/printk.c:4323
start_kernel+0x2cc/0x500 init/main.c:1035
x86_64_start_reservations+0x24/0x30 arch/x86/kernel/head64.c:307
x86_64_start_kernel+0x143/0x1c0 arch/x86/kernel/head64.c:288
common_startup_64+0x13e/0x147
-> #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+0xb9b/0x2140 kernel/locking/lockdep.c:3911
__lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5240
lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5871
console_trylock_spinning kernel/printk/printk.c:2048 [inline]
vprintk_emit+0x460/0x7a0 kernel/printk/printk.c:2449
_printk+0xcf/0x120 kernel/printk/printk.c:2475
debug_object_is_on_stack lib/debugobjects.c:-1 [inline]
lookup_object_or_alloc lib/debugobjects.c:688 [inline]
__debug_object_init+0x2c8/0x3c0 lib/debugobjects.c:743
rhashtable_init_noprof+0x7c0/0xbb0 lib/rhashtable.c:1085
bch2_copygc_thread+0x116/0xdc0 fs/bcachefs/movinggc.c:355
kthread+0x711/0x8a0 kernel/kthread.c:464
ret_from_fork+0x3fc/0x770 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/9382:
#0: ffffffff99d343c0 (&obj_hash[i].lock){-.-.}-{2:2}, at: __debug_object_init+0x85/0x3c0 lib/debugobjects.c:741
stack backtrace:
CPU: 1 UID: 0 PID: 9382 Comm: bch-copygc/loop Not tainted 6.15.0-rc7-next-20250522-syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
print_circular_bug+0x2ee/0x310 kernel/locking/lockdep.c:2046
check_noncircular+0x134/0x160 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+0xb9b/0x2140 kernel/locking/lockdep.c:3911
__lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5240
lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5871
console_trylock_spinning kernel/printk/printk.c:2048 [inline]
vprintk_emit+0x460/0x7a0 kernel/printk/printk.c:2449
_printk+0xcf/0x120 kernel/printk/printk.c:2475
debug_object_is_on_stack lib/debugobjects.c:-1 [inline]
lookup_object_or_alloc lib/debugobjects.c:688 [inline]
__debug_object_init+0x2c8/0x3c0 lib/debugobjects.c:743
rhashtable_init_noprof+0x7c0/0xbb0 lib/rhashtable.c:1085
bch2_copygc_thread+0x116/0xdc0 fs/bcachefs/movinggc.c:355
kthread+0x711/0x8a0 kernel/kthread.c:464
ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
------------[ cut here ]------------
WARNING: CPU: 1 PID: 9382 at lib/debugobjects.c:655 debug_object_is_on_stack lib/debugobjects.c:655 [inline]
WARNING: CPU: 1 PID: 9382 at lib/debugobjects.c:655 lookup_object_or_alloc lib/debugobjects.c:688 [inline]
WARNING: CPU: 1 PID: 9382 at lib/debugobjects.c:655 __debug_object_init+0x2c9/0x3c0 lib/debugobjects.c:743
Modules linked in:
CPU: 1 UID: 0 PID: 9382 Comm: bch-copygc/loop Not tainted 6.15.0-rc7-next-20250522-syzkaller #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 lib/debugobjects.c:688 [inline]
RIP: 0010:__debug_object_init+0x2c9/0x3c0 lib/debugobjects.c:743
Code: a0 06 cc 41 ff c7 44 89 3d 64 e9 13 15 48 c7 c1 80 98 e2 8b 48 c7 c7 e0 98 e2 8b 84 c0 48 0f 45 f9 48 89 de e8 28 2c 61 fc 90 <0f> 0b 90 e9 c0 fe ff ff e8 3a 1c 00 00 8b 05 3c 9d c6 09 3b 05 3a
RSP: 0018:ffffc9000b30f6e0 EFLAGS: 00010046
RAX: 0000000000000050 RBX: ffffc9000b30fb90 RCX: 0a2fd5e7f3ad9400
RDX: 0000000000000000 RSI: 0000000080000001 RDI: 0000000000000000
RBP: ffff888026e53c20 R08: 0000000000000003 R09: 0000000000000004
R10: dffffc0000000000 R11: fffffbfff1bfaa44 R12: ffff888027d7d3d0
R13: ffff88805db1f428 R14: dffffc0000000000 R15: 0000000000000001
FS: 0000000000000000(0000) GS:ffff888125d59000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b3080eff8 CR3: 000000002803a000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
rhashtable_init_noprof+0x7c0/0xbb0 lib/rhashtable.c:1085
bch2_copygc_thread+0x116/0xdc0 fs/bcachefs/movinggc.c:355
kthread+0x711/0x8a0 kernel/kthread.c:464
ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245