BUG: sleeping function called from invalid context at drivers/tty/vt/vt.c:2245 in_atomic(): 1, irqs_disabled(): 1, pid: 7995, name: syz-executor424 3 locks held by syz-executor424/7995: #0: (&tty->ldisc_sem){++++}, at: [] tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:284 #1: (&tty->atomic_write_lock){+.+.}, at: [] tty_write_lock drivers/tty/tty_io.c:885 [inline] #1: (&tty->atomic_write_lock){+.+.}, at: [] do_tty_write drivers/tty/tty_io.c:908 [inline] #1: (&tty->atomic_write_lock){+.+.}, at: [] tty_write+0x22d/0x740 drivers/tty/tty_io.c:1043 #2: (&(&gsm->tx_lock)->rlock){....}, at: [] gsmld_write+0x5e/0x120 drivers/tty/n_gsm.c:2545 irq event stamp: 14024 hardirqs last enabled at (14023): [] do_syscall_64+0x4c/0x640 arch/x86/entry/common.c:280 hardirqs last disabled at (14024): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (14024): [] _raw_spin_lock_irqsave+0x66/0xc0 kernel/locking/spinlock.c:160 softirqs last enabled at (12104): [] __do_softirq+0x68b/0x9ff kernel/softirq.c:314 softirqs last disabled at (11975): [] invoke_softirq kernel/softirq.c:368 [inline] softirqs last disabled at (11975): [] irq_exit+0x193/0x240 kernel/softirq.c:409 Preemption disabled at: [< (null)>] (null) CPU: 1 PID: 7995 Comm: syz-executor424 Not tainted 4.14.301-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 ___might_sleep.cold+0x235/0x250 kernel/sched/core.c:6041 do_con_write+0xd0/0x19b0 drivers/tty/vt/vt.c:2245 con_write+0x21/0xa0 drivers/tty/vt/vt.c:2822 gsmld_write+0xbb/0x120 drivers/tty/n_gsm.c:2548 do_tty_write drivers/tty/tty_io.c:959 [inline] tty_write+0x410/0x740 drivers/tty/tty_io.c:1043 __vfs_write+0xe4/0x630 fs/read_write.c:480 vfs_write+0x17f/0x4d0 fs/read_write.c:544 SYSC_write fs/read_write.c:590 [inline] SyS_write+0xf2/0x210 fs/read_write.c:582 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 RIP: 0033:0x7f664fcd72a9 RSP: 002b:00007fff834e2678 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f664fcd72a9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 00007f664fc9b130 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000000e R11: 0000000000000246 R12: 00007f664fc9b1c0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000