------------[ cut here ]------------ ====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc3-syzkaller #0 Not tainted ------------------------------------------------------ kworker/0:1/9 is trying to acquire lock: ffffffff8e328140 (console_owner){-.-.}-{0:0}, at: rcu_try_lock_acquire include/linux/rcupdate.h:334 [inline] ffffffff8e328140 (console_owner){-.-.}-{0:0}, at: srcu_read_lock_nmisafe include/linux/srcu.h:232 [inline] ffffffff8e328140 (console_owner){-.-.}-{0:0}, at: console_srcu_read_lock kernel/printk/printk.c:286 [inline] ffffffff8e328140 (console_owner){-.-.}-{0:0}, at: console_flush_all+0x152/0xfd0 kernel/printk/printk.c:2986 but task is already holding lock: ffffffff94ad1d18 (&port_lock_key){-.-.}-{2:2}, at: uart_port_lock_irqsave include/linux/serial_core.h:618 [inline] ffffffff94ad1d18 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x10e/0x320 drivers/tty/serial/serial_core.c:624 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&port_lock_key){-.-.}-{2:2}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 uart_port_lock_irqsave include/linux/serial_core.h:618 [inline] serial8250_console_write+0x1a8/0x1770 drivers/tty/serial/8250/8250_port.c:3352 console_emit_next_record kernel/printk/printk.c:2928 [inline] console_flush_all+0x867/0xfd0 kernel/printk/printk.c:2994 console_unlock+0x13b/0x4d0 kernel/printk/printk.c:3063 vprintk_emit+0x5a6/0x770 kernel/printk/printk.c:2345 _printk+0xd5/0x120 kernel/printk/printk.c:2370 register_console+0x722/0xce0 kernel/printk/printk.c:3596 univ8250_console_init+0x49/0x50 drivers/tty/serial/8250/8250_core.c:719 console_init+0x1b8/0x6f0 kernel/printk/printk.c:3742 start_kernel+0x2d3/0x500 init/main.c:1038 x86_64_start_reservations+0x2a/0x30 arch/x86/kernel/head64.c:507 x86_64_start_kernel+0x99/0xa0 arch/x86/kernel/head64.c:488 common_startup_64+0x13e/0x147 -> #0 (console_owner){-.-.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 console_lock_spinning_enable kernel/printk/printk.c:1870 [inline] console_emit_next_record kernel/printk/printk.c:2922 [inline] console_flush_all+0x810/0xfd0 kernel/printk/printk.c:2994 console_unlock+0x13b/0x4d0 kernel/printk/printk.c:3063 vprintk_emit+0x5a6/0x770 kernel/printk/printk.c:2345 _printk+0xd5/0x120 kernel/printk/printk.c:2370 __report_bug lib/bug.c:195 [inline] report_bug+0x346/0x500 lib/bug.c:219 handle_bug+0x3e/0x70 arch/x86/kernel/traps.c:239 exc_invalid_op+0x1a/0x50 arch/x86/kernel/traps.c:260 asm_exc_invalid_op+0x1a/0x20 arch/x86/include/asm/idtentry.h:621 uart_write+0x2b0/0x320 drivers/tty/serial/serial_core.c:625 n_hdlc_send_frames+0x354/0xa90 drivers/tty/n_hdlc.c:288 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd70 kernel/workqueue.c:3393 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&port_lock_key); lock(console_owner); lock(&port_lock_key); lock(console_owner); *** DEADLOCK *** 5 locks held by kworker/0:1/9: #0: ffff888015080948 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3206 [inline] #0: ffff888015080948 ((wq_completion)events){+.+.}-{0:0}, at: process_scheduled_works+0x90a/0x1830 kernel/workqueue.c:3312 #1: ffffc900000e7d00 ((work_completion)(&n_hdlc->write_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3207 [inline] #1: ffffc900000e7d00 ((work_completion)(&n_hdlc->write_work)){+.+.}-{0:0}, at: process_scheduled_works+0x945/0x1830 kernel/workqueue.c:3312 #2: ffffffff94ad1d18 (&port_lock_key){-.-.}-{2:2}, at: uart_port_lock_irqsave include/linux/serial_core.h:618 [inline] #2: ffffffff94ad1d18 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x10e/0x320 drivers/tty/serial/serial_core.c:624 #3: ffffffff8e20fa60 (console_lock){+.+.}-{0:0}, at: _printk+0xd5/0x120 kernel/printk/printk.c:2370 #4: ffffffff8e20f690 (console_srcu){....}-{0:0}, at: rcu_try_lock_acquire include/linux/rcupdate.h:334 [inline] #4: ffffffff8e20f690 (console_srcu){....}-{0:0}, at: srcu_read_lock_nmisafe include/linux/srcu.h:232 [inline] #4: ffffffff8e20f690 (console_srcu){....}-{0:0}, at: console_srcu_read_lock kernel/printk/printk.c:286 [inline] #4: ffffffff8e20f690 (console_srcu){....}-{0:0}, at: console_flush_all+0x152/0xfd0 kernel/printk/printk.c:2986 stack backtrace: CPU: 0 PID: 9 Comm: kworker/0:1 Not tainted 6.10.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Workqueue: events n_hdlc_tty_write_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 check_noncircular+0x36a/0x4a0 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+0x18e0/0x5900 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 console_lock_spinning_enable kernel/printk/printk.c:1870 [inline] console_emit_next_record kernel/printk/printk.c:2922 [inline] console_flush_all+0x810/0xfd0 kernel/printk/printk.c:2994 console_unlock+0x13b/0x4d0 kernel/printk/printk.c:3063 vprintk_emit+0x5a6/0x770 kernel/printk/printk.c:2345 _printk+0xd5/0x120 kernel/printk/printk.c:2370 __report_bug lib/bug.c:195 [inline] report_bug+0x346/0x500 lib/bug.c:219 handle_bug+0x3e/0x70 arch/x86/kernel/traps.c:239 exc_invalid_op+0x1a/0x50 arch/x86/kernel/traps.c:260 asm_exc_invalid_op+0x1a/0x20 arch/x86/include/asm/idtentry.h:621 RIP: 0010:uart_write+0x2b0/0x320 drivers/tty/serial/serial_core.c:625 Code: 74 08 48 89 df e8 10 c6 c1 fc 48 83 3b 00 74 74 e8 95 01 5c fc eb 97 e8 8e 01 5c fc 45 31 e4 eb 08 e8 84 01 5c fc 45 31 ed 90 <0f> 0b 90 45 84 e4 74 0a e8 73 01 5c fc 45 31 f6 eb 84 e8 69 01 5c RSP: 0000:ffffc900000e7ac0 EFLAGS: 00010046 RAX: ffffffff853a2572 RBX: dffffc0000000000 RCX: ffff8880172c0000 RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffc900000e79a0 RBP: ffff88801f9f0f48 R08: 0000000000000003 R09: fffff5200001cf34 R10: dffffc0000000000 R11: fffff5200001cf34 R12: 0000000000000000 R13: 0000000000000246 R14: ffff88801f9f0be8 R15: ffffffff94ad1d00 n_hdlc_send_frames+0x354/0xa90 drivers/tty/n_hdlc.c:288 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd70 kernel/workqueue.c:3393 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 WARNING: CPU: 0 PID: 9 at drivers/tty/serial/serial_core.c:625 uart_write+0x2b0/0x320 drivers/tty/serial/serial_core.c:625 Modules linked in: CPU: 0 PID: 9 Comm: kworker/0:1 Not tainted 6.10.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Workqueue: events n_hdlc_tty_write_work RIP: 0010:uart_write+0x2b0/0x320 drivers/tty/serial/serial_core.c:625 Code: 74 08 48 89 df e8 10 c6 c1 fc 48 83 3b 00 74 74 e8 95 01 5c fc eb 97 e8 8e 01 5c fc 45 31 e4 eb 08 e8 84 01 5c fc 45 31 ed 90 <0f> 0b 90 45 84 e4 74 0a e8 73 01 5c fc 45 31 f6 eb 84 e8 69 01 5c RSP: 0000:ffffc900000e7ac0 EFLAGS: 00010046 RAX: ffffffff853a2572 RBX: dffffc0000000000 RCX: ffff8880172c0000 RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffc900000e79a0 RBP: ffff88801f9f0f48 R08: 0000000000000003 R09: fffff5200001cf34 R10: dffffc0000000000 R11: fffff5200001cf34 R12: 0000000000000000 R13: 0000000000000246 R14: ffff88801f9f0be8 R15: ffffffff94ad1d00 FS: 0000000000000000(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2e536000 CR3: 0000000066ecc000 CR4: 00000000003526f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: n_hdlc_send_frames+0x354/0xa90 drivers/tty/n_hdlc.c:288 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd70 kernel/workqueue.c:3393 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244