*** Guest State *** CR0: actual=0x0000000080000031, shadow=0x00000000e0000031, gh_mask=fffffffffffffff7 CR4: actual=0x0000000000002060, shadow=0x0000000000002020, gh_mask=ffffffffffffe871 CR3 = 0x0000000000002000 RSP = 0x0000000000000000 RIP = 0x0000000000009000 BUG: sleeping function called from invalid context at drivers/tty/vt/vt.c:2599 RFLAGS=0x00000002 DR7 = 0x0000000000000400 in_atomic(): 1, irqs_disabled(): 1, pid: 11583, name: syz-executor.5 3 locks held by syz-executor.5/11583: #0: 0000000074f24b21 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:272 #1: 0000000093447f4e (&(&tty->flow_lock)->rlock){....}, at: spin_lock_irq include/linux/spinlock.h:354 [inline] #1: 0000000093447f4e (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper+0xcc/0x3a0 drivers/tty/tty_ioctl.c:914 Sysenter RSP=0000000000000000 CS:RIP=0050:0000000000000000 #2: 0000000074f24b21 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:293 irq event stamp: 250 hardirqs last enabled at (249): [] do_syscall_64+0x21/0x620 arch/x86/entry/common.c:280 hardirqs last disabled at (250): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (250): [] _raw_spin_lock_irq+0x35/0x80 kernel/locking/spinlock.c:160 softirqs last enabled at (0): [] copy_process.part.0+0x15b9/0x8260 kernel/fork.c:1856 softirqs last disabled at (0): [<0000000000000000>] (null) Preemption disabled at: [<0000000000000000>] (null) CPU: 1 PID: 11583 Comm: syz-executor.5 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 ___might_sleep.cold+0x235/0x250 kernel/sched/core.c:6192 do_con_write+0x116/0x1d90 drivers/tty/vt/vt.c:2599 CS: sel=0x0050, attr=0x0a09b, limit=0xffffffff, base=0x0000000000000000 DS: sel=0x0058, attr=0x0c093, limit=0xffffffff, base=0x0000000000000000 con_write+0x22/0xb0 drivers/tty/vt/vt.c:3163 n_hdlc_send_frames+0x278/0x470 drivers/tty/n_hdlc.c:403 n_hdlc_tty_wakeup+0xa0/0xc0 drivers/tty/n_hdlc.c:479 tty_wakeup+0xd4/0x110 drivers/tty/tty_io.c:534 __start_tty drivers/tty/tty_io.c:806 [inline] __start_tty+0x116/0x150 drivers/tty/tty_io.c:799 n_tty_ioctl_helper+0x348/0x3a0 drivers/tty/tty_ioctl.c:917 SS: sel=0x0058, attr=0x0c093, limit=0xffffffff, base=0x0000000000000000 n_hdlc_tty_ioctl+0x102/0x350 drivers/tty/n_hdlc.c:783 tty_ioctl+0x65d/0x1630 drivers/tty/tty_io.c:2678 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688 ES: sel=0x0058, attr=0x0c093, limit=0xffffffff, base=0x0000000000000000 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705 FS: sel=0x0058, attr=0x0c093, limit=0xffffffff, base=0x0000000000000000 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f37e5c57639 GS: sel=0x0058, attr=0x0c093, limit=0xffffffff, base=0x0000000000000000 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f37e41ca168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f37e5d77f80 RCX: 00007f37e5c57639 RDX: 0000000000000001 RSI: 000000000000540a RDI: 0000000000000003 RBP: 00007f37e5cb2ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc86f5d27f R14: 00007f37e41ca300 R15: 0000000000022000 BUG: scheduling while atomic: syz-executor.5/11583/0x00000002 GDTR: limit=0x0000ffff, base=0x0000000000001000 3 locks held by syz-executor.5/11583: #0: 0000000074f24b21 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:272 #1: 0000000093447f4e (&(&tty->flow_lock)->rlock){+.+.}, at: spin_lock_irq include/linux/spinlock.h:354 [inline] #1: 0000000093447f4e (&(&tty->flow_lock)->rlock){+.+.}, at: n_tty_ioctl_helper+0xcc/0x3a0 drivers/tty/tty_ioctl.c:914 #2: 0000000074f24b21 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:293 LDTR: sel=0x0008, attr=0x04082, limit=0x000007ff, base=0x0000000000001800 Modules linked in: Preemption disabled at: [<0000000000000000>] (null) ---------------- Code disassembly (best guess), 1 bytes skipped: 0: ff c3 inc %ebx 2: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 9: 00 00 00 c: 0f 1f 40 00 nopl 0x0(%rax) 10: 48 89 f8 mov %rdi,%rax 13: 48 89 f7 mov %rsi,%rdi 16: 48 89 d6 mov %rdx,%rsi 19: 48 89 ca mov %rcx,%rdx 1c: 4d 89 c2 mov %r8,%r10 1f: 4d 89 c8 mov %r9,%r8 22: 4c 8b 4c 24 08 mov 0x8(%rsp),%r9 27: 0f 05 syscall * 29: 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax <-- trapping instruction 2f: 73 01 jae 0x32 31: c3 retq 32: 48 c7 c1 b8 ff ff ff mov $0xffffffffffffffb8,%rcx 39: f7 d8 neg %eax 3b: 64 89 01 mov %eax,%fs:(%rcx) 3e: 48 rex.W