====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Tainted: G L ------------------------------------------------------ kworker/1:8/23311 is trying to acquire lock: ffff88801d0b20b8 (&buf->lock){+.+.}-{4:4}, at: tty_buffer_flush+0x72/0x310 drivers/tty/tty_buffer.c:236 but task is already holding lock: ffffffff8fdd8880 (console_lock){+.+.}-{0:0}, at: class_console_lock_constructor include/linux/console.h:749 [inline] ffffffff8fdd8880 (console_lock){+.+.}-{0:0}, at: vc_SAK+0x13/0x320 drivers/tty/vt/vt_ioctl.c:989 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (console_lock){+.+.}-{0:0}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 console_lock+0x7a/0xa0 kernel/printk/printk.c:2896 class_console_lock_constructor include/linux/console.h:749 [inline] con_flush_chars+0x66/0x90 drivers/tty/vt/vt.c:3733 n_tty_write+0xc26/0x1160 drivers/tty/n_tty.c:2382 iterate_tty_write drivers/tty/tty_io.c:1008 [inline] file_tty_write.isra.0+0x4d2/0x890 drivers/tty/tty_io.c:1056 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x6af/0x1050 fs/read_write.c:687 ksys_write+0x12a/0x250 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&tty->termios_rwsem){++++}-{4:4}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 down_write+0x8b/0x1f0 kernel/locking/rwsem.c:1631 class_rwsem_write_constructor include/linux/rwsem.h:270 [inline] n_tty_flush_buffer+0x25/0x1b0 drivers/tty/n_tty.c:349 tty_buffer_flush+0x239/0x310 drivers/tty/tty_buffer.c:248 tty_ldisc_flush+0x68/0xf0 drivers/tty/tty_ldisc.c:388 tty_port_close_start+0x306/0x500 drivers/tty/tty_port.c:677 tty_port_close+0x26/0x180 drivers/tty/tty_port.c:732 tty_release+0x40e/0x1300 drivers/tty/tty_io.c:1720 __fput+0x400/0xb60 fs/file_table.c:512 task_work_run+0x150/0x240 kernel/task_work.c:233 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0x8da/0x2a50 kernel/exit.c:986 do_group_exit+0xd5/0x2a0 kernel/exit.c:1129 __do_sys_exit_group kernel/exit.c:1140 [inline] __se_sys_exit_group kernel/exit.c:1138 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1138 x64_sys_call+0x1567/0x1570 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&buf->lock){+.+.}-{4:4}: check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3209 check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x1528/0x1f40 kernel/locking/lockdep.c:5288 lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x1a4/0x1bd0 kernel/locking/mutex.c:821 tty_buffer_flush+0x72/0x310 drivers/tty/tty_buffer.c:236 tty_ldisc_flush+0x68/0xf0 drivers/tty/tty_ldisc.c:388 __do_SAK+0x368/0x480 drivers/tty/tty_io.c:3015 vc_SAK+0x7f/0x320 drivers/tty/vt/vt_ioctl.c:998 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396 process_scheduled_works kernel/workqueue.c:3479 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 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 *** locks held by kworker/1:8/23311: 4, last CPU#1: #0: ffff88801d05b140 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x1466/0x1b10 kernel/workqueue.c:3371 #1: ffffc900051afd08 ((work_completion)(&vc_cons[currcons].SAK_work)){+.+.}-{0:0}, at: process_one_work+0xa2c/0x1b10 kernel/workqueue.c:3372 #2: ffffffff8fdd8880 (console_lock){+.+.}-{0:0}, at: class_console_lock_constructor include/linux/console.h:749 [inline] #2: ffffffff8fdd8880 (console_lock){+.+.}-{0:0}, at: vc_SAK+0x13/0x320 drivers/tty/vt/vt_ioctl.c:989 #3: ffff88802e8480a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref drivers/tty/tty_ldisc.c:263 [inline] #3: ffff88802e8480a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_flush+0x1c/0xf0 drivers/tty/tty_ldisc.c:386 stack backtrace: CPU: 1 UID: 0 PID: 23311 Comm: kworker/1:8 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026 Workqueue: events vc_SAK Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_circular_bug.cold+0x178/0x1be kernel/locking/lockdep.c:2087 check_noncircular+0x146/0x160 kernel/locking/lockdep.c:2219 check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3209 check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x1528/0x1f40 kernel/locking/lockdep.c:5288 lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x1a4/0x1bd0 kernel/locking/mutex.c:821 tty_buffer_flush+0x72/0x310 drivers/tty/tty_buffer.c:236 tty_ldisc_flush+0x68/0xf0 drivers/tty/tty_ldisc.c:388 __do_SAK+0x368/0x480 drivers/tty/tty_io.c:3015 vc_SAK+0x7f/0x320 drivers/tty/vt/vt_ioctl.c:998 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396 process_scheduled_works kernel/workqueue.c:3479 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245