BUG: sleeping function called from invalid context at kernel/printk/printk.c:2565 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 3635, name: syz-executor421 preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 3 locks held by syz-executor421/3635: #0: ffff88807c352098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x26/0x80 drivers/tty/tty_ldisc.c:244 #1: ffff88807c352130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_write_lock drivers/tty/tty_io.c:944 [inline] #1: ffff88807c352130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: do_tty_write drivers/tty/tty_io.c:967 [inline] #1: ffff88807c352130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: file_tty_write.constprop.0+0x251/0x890 drivers/tty/tty_io.c:1089 #2: ffff888145bae3e0 (&gsm->tx_lock){....}-{2:2}, at: gsmld_write+0x62/0x140 drivers/tty/n_gsm.c:3056 irq event stamp: 5012 hardirqs last enabled at (5011): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (5011): [] _raw_spin_unlock_irq+0x23/0x50 kernel/locking/spinlock.c:202 hardirqs last disabled at (5012): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (5012): [] _raw_spin_lock_irqsave+0x52/0x60 kernel/locking/spinlock.c:162 softirqs last enabled at (4866): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last enabled at (4866): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 softirqs last disabled at (4833): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last disabled at (4833): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 Preemption disabled at: [<0000000000000000>] 0x0 CPU: 1 PID: 3635 Comm: syz-executor421 Not tainted 6.1.0-rc7-syzkaller-00122-g355479c70a48 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 __might_resched.cold+0x222/0x26b kernel/sched/core.c:9908 console_lock+0x1b/0x80 kernel/printk/printk.c:2565 do_con_write+0x10f/0x1e40 drivers/tty/vt/vt.c:2908 con_write+0x25/0x40 drivers/tty/vt/vt.c:3295 gsmld_write+0xcf/0x140 drivers/tty/n_gsm.c:3059 do_tty_write drivers/tty/tty_io.c:1018 [inline] file_tty_write.constprop.0+0x452/0x890 drivers/tty/tty_io.c:1089 call_write_iter include/linux/fs.h:2199 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9ed/0xdd0 fs/read_write.c:584 ksys_write+0x12b/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fdaa9b33289 Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffe8da67ab8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fdaa9b33289