====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ kworker/1:1/42 is trying to acquire lock: ffff88801b68a0b8 (&buf->lock){+.+.}-{4:4}, at: tty_buffer_flush+0x74/0x2b0 drivers/tty/tty_buffer.c:229 but task is already holding lock: ffffffff8e752740 (console_lock){+.+.}-{0:0}, at: class_console_lock_constructor include/linux/console.h:728 [inline] ffffffff8e752740 (console_lock){+.+.}-{0:0}, at: vc_SAK+0x28/0x220 drivers/tty/vt/vt_ioctl.c:985 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (console_lock){+.+.}-{0:0}: console_lock+0x76/0x90 kernel/printk/printk.c:2845 class_console_lock_constructor include/linux/console.h:728 [inline] con_flush_chars+0x6c/0x80 drivers/tty/vt/vt.c:3627 __receive_buf drivers/tty/n_tty.c:1620 [inline] n_tty_receive_buf_common+0xca5/0x1300 drivers/tty/n_tty.c:1715 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+0x24a/0x6e0 drivers/tty/tty_buffer.c:495 process_one_work+0x949/0x1650 kernel/workqueue.c:3279 process_scheduled_works kernel/workqueue.c:3362 [inline] worker_thread+0xb46/0x1140 kernel/workqueue.c:3443 kthread+0x388/0x470 kernel/kthread.c:467 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #1 (&tty->termios_rwsem){++++}-{4:4}: down_read+0x47/0x2e0 kernel/locking/rwsem.c:1537 class_rwsem_read_constructor include/linux/rwsem.h:259 [inline] n_tty_receive_buf_common+0x84/0x1300 drivers/tty/n_tty.c:1678 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+0x24a/0x6e0 drivers/tty/tty_buffer.c:495 process_one_work+0x949/0x1650 kernel/workqueue.c:3279 process_scheduled_works kernel/workqueue.c:3362 [inline] worker_thread+0xb46/0x1140 kernel/workqueue.c:3443 kthread+0x388/0x470 kernel/kthread.c:467 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #0 (&buf->lock){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x15a5/0x2cf0 kernel/locking/lockdep.c:5237 lock_acquire+0xf0/0x2e0 kernel/locking/lockdep.c:5868 __mutex_lock_common kernel/locking/mutex.c:614 [inline] __mutex_lock+0x19f/0x1300 kernel/locking/mutex.c:776 tty_buffer_flush+0x74/0x2b0 drivers/tty/tty_buffer.c:229 tty_ldisc_flush+0x6b/0xc0 drivers/tty/tty_ldisc.c:388 __do_SAK+0xf2/0x6e0 drivers/tty/tty_io.c:3025 vc_SAK+0x78/0x220 drivers/tty/vt/vt_ioctl.c:994 process_one_work+0x949/0x1650 kernel/workqueue.c:3279 process_scheduled_works kernel/workqueue.c:3362 [inline] worker_thread+0xb46/0x1140 kernel/workqueue.c:3443 kthread+0x388/0x470 kernel/kthread.c:467 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 other info that might help us debug this: Chain exists of: &buf->lock --> &tty->termios_rwsem --> console_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(console_lock); lock(&tty->termios_rwsem); lock(console_lock); lock(&buf->lock); *** DEADLOCK *** 4 locks held by kworker/1:1/42: #0: ffff88801b06b548 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x855/0x1650 kernel/workqueue.c:3254 #1: ffffc90000b27c40 ((work_completion)(&vc_cons[currcons].SAK_work)){+.+.}-{0:0}, at: process_one_work+0x87c/0x1650 kernel/workqueue.c:3255 #2: ffffffff8e752740 (console_lock){+.+.}-{0:0}, at: class_console_lock_constructor include/linux/console.h:728 [inline] #2: ffffffff8e752740 (console_lock){+.+.}-{0:0}, at: vc_SAK+0x28/0x220 drivers/tty/vt/vt_ioctl.c:985 #3: ffff8880339200a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref drivers/tty/tty_ldisc.c:263 [inline] #3: ffff8880339200a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_flush+0x20/0xc0 drivers/tty/tty_ldisc.c:386 stack backtrace: CPU: 1 UID: 0 PID: 42 Comm: kworker/1:1 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/24/2026 Workqueue: events vc_SAK Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e1/0x300 kernel/locking/lockdep.c:2043 check_noncircular+0x12e/0x150 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x15a5/0x2cf0 kernel/locking/lockdep.c:5237 lock_acquire+0xf0/0x2e0 kernel/locking/lockdep.c:5868 __mutex_lock_common kernel/locking/mutex.c:614 [inline] __mutex_lock+0x19f/0x1300 kernel/locking/mutex.c:776 tty_buffer_flush+0x74/0x2b0 drivers/tty/tty_buffer.c:229 tty_ldisc_flush+0x6b/0xc0 drivers/tty/tty_ldisc.c:388 __do_SAK+0xf2/0x6e0 drivers/tty/tty_io.c:3025 vc_SAK+0x78/0x220 drivers/tty/vt/vt_ioctl.c:994 process_one_work+0x949/0x1650 kernel/workqueue.c:3279 process_scheduled_works kernel/workqueue.c:3362 [inline] worker_thread+0xb46/0x1140 kernel/workqueue.c:3443 kthread+0x388/0x470 kernel/kthread.c:467 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 tty tty1: SAK: killed process 6481 (syz.0.16): by fd#3 tty tty1: SAK: killed process 6482 (syz.0.16): by fd#3 tty tty1: SAK: killed process 6496 (syz.0.23): by fd#3 tty tty1: SAK: killed process 6497 (syz.0.23): by fd#3 tty tty1: SAK: killed process 6504 (syz.0.27): by fd#3 tty tty1: SAK: killed process 6505 (syz.0.27): by fd#3 tty tty1: SAK: killed process 6598 (syz.0.74): by fd#3 tty tty1: SAK: killed process 6599 (syz.0.74): by fd#3 tty tty1: SAK: killed process 6608 (syz.0.79): by fd#3 tty tty1: SAK: killed process 6609 (syz.0.79): by fd#3 tty tty1: SAK: killed process 6618 (syz.0.84): by fd#3 tty tty1: SAK: killed process 6619 (syz.0.84): by fd#3 tty tty1: SAK: killed process 6620 (syz.0.85): by fd#3 tty tty1: SAK: killed process 6621 (syz.0.85): by fd#3 tty tty1: SAK: killed process 6630 (syz.0.90): by fd#3 tty tty1: SAK: killed process 6631 (syz.0.90): by fd#3 tty tty1: SAK: killed process 6648 (syz.0.99): by fd#3 tty tty1: SAK: killed process 6649 (syz.0.99): by fd#3 tty tty1: SAK: killed process 6650 (syz.0.100): by fd#3 tty tty1: SAK: killed process 6651 (syz.0.100): by fd#3 tty tty1: SAK: killed process 6658 (syz.0.104): by fd#3 tty tty1: SAK: killed process 6659 (syz.0.104): by fd#3 tty tty1: SAK: killed process 6660 (syz.0.105): by fd#3 tty tty1: SAK: killed process 6661 (syz.0.105): by fd#3 tty tty1: SAK: killed process 6674 (syz.0.112): by fd#3 tty tty1: SAK: killed process 6675 (syz.0.112): by fd#3 tty tty1: SAK: killed process 6676 (syz.0.113): by fd#3 tty tty1: SAK: killed process 6677 (syz.0.113): by fd#3 tty tty1: SAK: killed process 6688 (syz.0.119): by fd#3 tty tty1: SAK: killed process 6689 (syz.0.119): by fd#3 tty tty1: SAK: killed process 6692 (syz.0.121): by fd#3 tty tty1: SAK: killed process 6693 (syz.0.121): by fd#3 tty tty1: SAK: killed process 6718 (syz.0.134): by fd#3 tty tty1: SAK: killed process 6719 (syz.0.134): by fd#3 tty tty1: SAK: killed process 6806 (syz.0.178): by fd#3 tty tty1: SAK: killed process 6807 (syz.0.178): by fd#3 tty tty1: SAK: killed process 6828 (syz.0.189): by fd#3 tty tty1: SAK: killed process 6829 (syz.0.189): by fd#3 tty tty1: SAK: killed process 6832 (syz.0.191): by fd#3 tty tty1: SAK: killed process 6833 (syz.0.191): by fd#3 tty tty1: SAK: killed process 6834 (syz.0.192): by fd#3 tty tty1: SAK: killed process 6835 (syz.0.192): by fd#3 tty tty1: SAK: killed process 6836 (syz.0.193): by fd#3 tty tty1: SAK: killed process 6837 (syz.0.193): by fd#3 tty tty1: SAK: killed process 6844 (syz.0.197): by fd#3 tty tty1: SAK: killed process 6845 (syz.0.197): by fd#3 tty tty1: SAK: killed process 6856 (syz.0.203): by fd#3 tty tty1: SAK: killed process 6857 (syz.0.203): by fd#3 tty tty1: SAK: killed process 6860 (syz.0.205): by fd#3 tty tty1: SAK: killed process 6861 (syz.0.205): by fd#3 tty tty1: SAK: killed process 6868 (syz.0.209): by fd#3 tty tty1: SAK: killed process 6869 (syz.0.209): by fd#3 tty tty1: SAK: killed process 6980 (syz.0.265): by fd#3 tty tty1: SAK: killed process 6981 (syz.0.265): by fd#3 tty tty1: SAK: killed process 7072 (syz.0.311): by fd#3 tty tty1: SAK: killed process 7073 (syz.0.311): by fd#3 tty tty1: SAK: killed process 7074 (syz.0.312): by fd#3 tty tty1: SAK: killed process 7075 (syz.0.312): by fd#3 tty tty1: SAK: killed process 7076 (syz.0.313): by fd#3 tty tty1: SAK: killed process 7077 (syz.0.313): by fd#3 tty tty1: SAK: killed process 7092 (syz.0.321): by fd#3 tty tty1: SAK: killed process 7093 (syz.0.321): by fd#3 tty tty1: SAK: killed process 7094 (syz.0.322): by fd#3 tty tty1: SAK: killed process 7095 (syz.0.322): by fd#3 tty tty1: SAK: killed process 7100 (syz.0.325): by fd#3 tty tty1: SAK: killed process 7101 (syz.0.325): by fd#3 tty tty1: SAK: killed process 7108 (syz.0.329): by fd#3 tty tty1: SAK: killed process 7109 (syz.0.329): by fd#3 tty tty1: SAK: killed process 7118 (syz.0.334): by fd#3 tty tty1: SAK: killed process 7119 (syz.0.334): by fd#3 tty tty1: SAK: killed process 7120 (syz.0.335): by fd#3 tty tty1: SAK: killed process 7121 (syz.0.335): by fd#3 tty tty1: SAK: killed process 7144 (syz.0.347): by fd#3 tty tty1: SAK: killed process 7145 (syz.0.347): by fd#3 tty tty1: SAK: killed process 7188 (syz.0.369): by fd#3 tty tty1: SAK: killed process 7189 (syz.0.369): by fd#3 tty tty1: SAK: killed process 7204 (syz.0.377): by fd#3 tty tty1: SAK: killed process 7205 (syz.0.377): by fd#3 tty tty1: SAK: killed process 7208 (syz.0.379): by fd#3 tty tty1: SAK: killed process 7209 (syz.0.379): by fd#3 tty tty1: SAK: killed process 7210 (syz.0.380): by fd#3 tty tty1: SAK: killed process 7211 (syz.0.380): by fd#3 tty tty1: SAK: killed process 7232 (syz.0.391): by fd#3 tty tty1: SAK: killed process 7233 (syz.0.391): by fd#3 tty tty1: SAK: killed process 7234 (syz.0.392): by fd#3 tty tty1: SAK: killed process 7235 (syz.0.392): by fd#3 tty tty1: SAK: killed process 7236 (syz.0.393): by fd#3 tty tty1: SAK: killed process 7237 (syz.0.393): by fd#3 tty tty1: SAK: killed process 7238 (syz.0.394): by fd#3 tty tty1: SAK: killed process 7239 (syz.0.394): by fd#3