BUG: sleeping function called from invalid context at drivers/tty/vt/vt.c:2228 in_atomic(): 1, irqs_disabled(): 1, pid: 7974, name: syz-executor853 3 locks held by syz-executor853/7974: #0: (&tty->ldisc_sem){++++}, at: [] tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:284 #1: (&(&tty->flow_lock)->rlock){....}, at: [] spin_lock_irq include/linux/spinlock.h:342 [inline] #1: (&(&tty->flow_lock)->rlock){....}, at: [] n_tty_ioctl_helper+0xa0/0x350 drivers/tty/tty_ioctl.c:913 #2: (&tty->ldisc_sem){++++}, at: [] tty_ldisc_ref+0x1b/0x80 drivers/tty/tty_ldisc.c:305 irq event stamp: 6850 hardirqs last enabled at (6849): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (6849): [] _raw_spin_unlock_irqrestore+0x79/0xe0 kernel/locking/spinlock.c:192 hardirqs last disabled at (6850): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (6850): [] _raw_spin_lock_irq+0x35/0x80 kernel/locking/spinlock.c:168 softirqs last enabled at (6594): [] spin_unlock_bh include/linux/spinlock.h:362 [inline] softirqs last enabled at (6594): [] peernet2id+0x60/0x70 net/core/net_namespace.c:245 softirqs last disabled at (6592): [] spin_lock_bh include/linux/spinlock.h:322 [inline] softirqs last disabled at (6592): [] peernet2id+0x20/0x70 net/core/net_namespace.c:243 Preemption disabled at: [< (null)>] (null) CPU: 1 PID: 7974 Comm: syz-executor853 Not tainted 4.14.241-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 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:6038 do_con_write+0xd0/0x19b0 drivers/tty/vt/vt.c:2228 con_write+0x21/0xa0 drivers/tty/vt/vt.c:2805 n_hdlc_send_frames+0x241/0x410 drivers/tty/n_hdlc.c:404 n_hdlc_tty_wakeup+0x95/0xb0 drivers/tty/n_hdlc.c:480 tty_wakeup+0xc3/0xf0 drivers/tty/tty_io.c:533 __start_tty drivers/tty/tty_io.c:805 [inline] __start_tty+0x10b/0x140 drivers/tty/tty_io.c:798 n_tty_ioctl_helper+0x2f8/0x350 drivers/tty/tty_ioctl.c:916 n_hdlc_tty_ioctl+0xd4/0x300 drivers/tty/n_hdlc.c:784 tty_ioctl+0x5af/0x13c0 drivers/tty/tty_io.c:2670 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x43f159 RSP: 002b:00007fff429c9d88 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000400488 RCX: 000000000043f159 RDX: 0000000000000001 RSI: 000000000000540a RDI: 0000000000000003 RBP: 0000000000402fe0 R08: 0000000000400488 R09: 0000000000400488