ODEBUG: object ffffc9000391fb90 is on stack ffffc90003918000, but NOT annotated. ====================================================== WARNING: possible circular locking dependency detected 6.15.0-next-20250527-syzkaller #0 Not tainted ------------------------------------------------------ bch-copygc/loop/9879 is trying to acquire lock: ffffffff8e1331c0 (console_owner){-...}-{0:0}, at: console_trylock_spinning kernel/printk/printk.c:2048 [inline] ffffffff8e1331c0 (console_owner){-...}-{0:0}, at: vprintk_emit+0x444/0x7a0 kernel/printk/printk.c:2449 but task is already holding lock: ffffffff99cb6558 (&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:4328 [inline] __kmalloc_noprof+0x27a/0x4f0 mm/slub.c:4340 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 tty_put_char+0x10e/0x160 drivers/tty/tty_io.c:3154 do_output_char+0x6ac/0x970 drivers/tty/n_tty.c:463 __process_echoes+0x2e1/0xa20 drivers/tty/n_tty.c:701 flush_echoes drivers/tty/n_tty.c:791 [inline] __receive_buf drivers/tty/n_tty.c:1626 [inline] n_tty_receive_buf_common+0xc29/0x12f0 drivers/tty/n_tty.c:1723 tty_port_default_receive_buf+0x6e/0xa0 drivers/tty/tty_port.c:37 receive_buf drivers/tty/tty_buffer.c:445 [inline] flush_to_ldisc+0x247/0x720 drivers/tty/tty_buffer.c:495 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xade/0x17b0 kernel/workqueue.c:3321 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3402 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 -> #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 native_safe_halt arch/x86/include/asm/irqflags.h:48 [inline] pv_native_safe_halt+0x13/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:743 default_idle_call+0x74/0xb0 kernel/sched/idle.c:117 cpuidle_idle_call kernel/sched/idle.c:185 [inline] do_idle+0x1e8/0x510 kernel/sched/idle.c:325 cpu_startup_entry+0x44/0x60 kernel/sched/idle.c:423 rest_init+0x2de/0x300 init/main.c:744 start_kernel+0x47d/0x500 init/main.c:1101 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 -> #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/9879: #0: ffffffff99cb6558 (&obj_hash[i].lock){-.-.}-{2:2}, at: __debug_object_init+0x85/0x3c0 lib/debugobjects.c:741 stack backtrace: CPU: 0 UID: 0 PID: 9879 Comm: bch-copygc/loop Not tainted 6.15.0-next-20250527-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: 0 PID: 9879 at lib/debugobjects.c:655 debug_object_is_on_stack lib/debugobjects.c:655 [inline] WARNING: CPU: 0 PID: 9879 at lib/debugobjects.c:655 lookup_object_or_alloc lib/debugobjects.c:688 [inline] WARNING: CPU: 0 PID: 9879 at lib/debugobjects.c:655 __debug_object_init+0x2c9/0x3c0 lib/debugobjects.c:743 Modules linked in: CPU: 0 UID: 0 PID: 9879 Comm: bch-copygc/loop Not tainted 6.15.0-next-20250527-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: a1 06 cc 41 ff c7 44 89 3d 24 ec 13 15 48 c7 c1 80 9e e2 8b 48 c7 c7 e0 9e e2 8b 84 c0 48 0f 45 f9 48 89 de e8 98 ee 60 fc 90 <0f> 0b 90 e9 c0 fe ff ff e8 3a 1c 00 00 8b 05 bc 5e c6 09 3b 05 ba RSP: 0018:ffffc9000391f6e0 EFLAGS: 00010046 RAX: 0000000000000050 RBX: ffffc9000391fb90 RCX: 8b59b24b3d396900 RDX: 0000000000000000 RSI: 0000000080000001 RDI: 0000000000000000 RBP: ffff88805500bc20 R08: 0000000000000003 R09: 0000000000000004 R10: dffffc0000000000 R11: fffffbfff1bfaa44 R12: 0000000000000040 R13: ffff8880792d16c8 R14: dffffc0000000000 R15: 0000000000000001 FS: 0000000000000000(0000) GS:ffff888125c55000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000110c368512 CR3: 00000000270a0000 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