bisecting fixing commit since ac3af4beac439ebccd17746c9f2fd227e88107aa building syzkaller on 380dcc3e77597144cbaa24d86cc1cc0cc4e90cf1 testing commit ac3af4beac439ebccd17746c9f2fd227e88107aa with gcc (GCC) 8.4.1 20210217 kernel signature: c44744d20bea36c55ec77958af9344c2106cce1ff5514a9f575046e837d2590b all runs: crashed: BUG: sleeping function called from invalid context in do_con_write testing current HEAD 2965db2e004cf9c92b87c1f559e9812c0ae878c1 testing commit 2965db2e004cf9c92b87c1f559e9812c0ae878c1 with gcc (GCC) 8.4.1 20210217 kernel signature: 3b6a60bb84d4e5202f5eeb65a733136f81682ddc81487c9c50a0d4bfa1a4120f all runs: crashed: BUG: sleeping function called from invalid context in do_con_write revisions tested: 2, total time: 32m41.900562389s (build: 25m19.682120111s, test: 6m51.45077085s) the crash still happens on HEAD commit msg: Linux 4.19.188 crash: BUG: sleeping function called from invalid context in do_con_write IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready Bluetooth: hci5: command 0x0419 tx timeout Bluetooth: hci3: command 0x0419 tx timeout Bluetooth: hci4: command 0x0419 tx timeout BUG: sleeping function called from invalid context at drivers/tty/vt/vt.c:2581 in_atomic(): 1, irqs_disabled(): 1, pid: 10255, name: syz-executor.5 3 locks held by syz-executor.5/10255: #0: 0000000084f0ae63 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x2d/0x40 drivers/tty/tty_ldsem.c:362 #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: spin_lock_irq include/linux/spinlock.h:354 [inline] #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 #2: 0000000084f0ae63 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1a/0x70 drivers/tty/tty_ldisc.c:293 irq event stamp: 798 hardirqs last enabled at (797): [] do_syscall_64+0x21/0x4e0 arch/x86/entry/common.c:280 hardirqs last disabled at (798): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (798): [] _raw_spin_lock_irq+0x3c/0x90 kernel/locking/spinlock.c:160 softirqs last enabled at (154): [] netlink_create+0x22b/0x530 net/netlink/af_netlink.c:707 softirqs last disabled at (152): [] netlink_create+0x22b/0x530 net/netlink/af_netlink.c:707 Preemption disabled at: [] spin_lock_irq include/linux/spinlock.h:354 [inline] [] n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] [] n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 CPU: 0 PID: 10255 Comm: syz-executor.5 Not tainted 4.19.188-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x226 lib/dump_stack.c:118 ___might_sleep.cold.15+0x1f1/0x265 kernel/sched/core.c:6192 __might_sleep+0x95/0x190 kernel/sched/core.c:6145 do_con_write.part.13+0xaf/0x1aa0 drivers/tty/vt/vt.c:2581 do_con_write drivers/tty/vt/vt.c:2578 [inline] con_write+0x1f/0x80 drivers/tty/vt/vt.c:3145 n_hdlc_send_frames drivers/tty/n_hdlc.c:403 [inline] n_hdlc_send_frames+0x201/0x3d0 drivers/tty/n_hdlc.c:375 n_hdlc_tty_wakeup+0x7d/0x90 drivers/tty/n_hdlc.c:479 tty_wakeup+0xaf/0xe0 drivers/tty/tty_io.c:534 __start_tty.part.14+0xbf/0xe0 drivers/tty/tty_io.c:806 __start_tty+0x48/0x60 drivers/tty/tty_io.c:801 n_tty_ioctl_helper drivers/tty/tty_ioctl.c:917 [inline] n_tty_ioctl_helper+0x22f/0x320 drivers/tty/tty_ioctl.c:894 n_hdlc_tty_ioctl+0xc0/0x2d0 drivers/tty/n_hdlc.c:783 tty_ioctl+0x4d4/0x1290 drivers/tty/tty_io.c:2678 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0x196/0x10c0 fs/ioctl.c:688 ksys_ioctl+0x62/0x90 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6e/0xb0 fs/ioctl.c:710 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x466459 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb8678a6188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000466459 RDX: 0000000000000001 RSI: 000000000000540a RDI: 000000000000000c RBP: 00000000004bf9cb R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007ffc8216cc7f R14: 00007fb8678a6300 R15: 0000000000022000 BUG: sleeping function called from invalid context at drivers/tty/vt/vt.c:2581 in_atomic(): 1, irqs_disabled(): 1, pid: 10509, name: syz-executor.2 3 locks held by syz-executor.2/10509: #0: 0000000084f0ae63 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x2d/0x40 drivers/tty/tty_ldsem.c:362 #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: spin_lock_irq include/linux/spinlock.h:354 [inline] #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 #2: 0000000084f0ae63 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1a/0x70 drivers/tty/tty_ldisc.c:293 irq event stamp: 386 hardirqs last enabled at (385): [] do_syscall_64+0x21/0x4e0 arch/x86/entry/common.c:280 hardirqs last disabled at (386): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (386): [] _raw_spin_lock_irq+0x3c/0x90 kernel/locking/spinlock.c:160 softirqs last enabled at (0): [] copy_process.part.2+0x176b/0x7960 kernel/fork.c:1855 softirqs last disabled at (0): [<0000000000000000>] (null) Preemption disabled at: [] spin_lock_irq include/linux/spinlock.h:354 [inline] [] n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] [] n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 CPU: 1 PID: 10509 Comm: syz-executor.2 Tainted: G W 4.19.188-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x226 lib/dump_stack.c:118 ___might_sleep.cold.15+0x1f1/0x265 kernel/sched/core.c:6192 __might_sleep+0x95/0x190 kernel/sched/core.c:6145 do_con_write.part.13+0xaf/0x1aa0 drivers/tty/vt/vt.c:2581 do_con_write drivers/tty/vt/vt.c:2578 [inline] con_write+0x1f/0x80 drivers/tty/vt/vt.c:3145 n_hdlc_send_frames drivers/tty/n_hdlc.c:403 [inline] n_hdlc_send_frames+0x201/0x3d0 drivers/tty/n_hdlc.c:375 n_hdlc_tty_wakeup+0x7d/0x90 drivers/tty/n_hdlc.c:479 tty_wakeup+0xaf/0xe0 drivers/tty/tty_io.c:534 __start_tty.part.14+0xbf/0xe0 drivers/tty/tty_io.c:806 __start_tty+0x48/0x60 drivers/tty/tty_io.c:801 n_tty_ioctl_helper drivers/tty/tty_ioctl.c:917 [inline] n_tty_ioctl_helper+0x22f/0x320 drivers/tty/tty_ioctl.c:894 n_hdlc_tty_ioctl+0xc0/0x2d0 drivers/tty/n_hdlc.c:783 tty_ioctl+0x4d4/0x1290 drivers/tty/tty_io.c:2678 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0x196/0x10c0 fs/ioctl.c:688 ksys_ioctl+0x62/0x90 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6e/0xb0 fs/ioctl.c:710 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x466459 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f923787b188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000056c008 RCX: 0000000000466459 RDX: 0000000000000001 RSI: 000000000000540a RDI: 000000000000000b RBP: 00000000004bf9cb R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c008 R13: 00007ffddf067aaf R14: 00007f923787b300 R15: 0000000000022000 BUG: sleeping function called from invalid context at drivers/tty/vt/vt.c:2581 in_atomic(): 1, irqs_disabled(): 1, pid: 10802, name: syz-executor.5 3 locks held by syz-executor.5/10802: #0: 0000000084f0ae63 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x2d/0x40 drivers/tty/tty_ldsem.c:362 #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: spin_lock_irq include/linux/spinlock.h:354 [inline] #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 #2: 0000000084f0ae63 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1a/0x70 drivers/tty/tty_ldisc.c:293 irq event stamp: 1118 hardirqs last enabled at (1117): [] do_syscall_64+0x21/0x4e0 arch/x86/entry/common.c:280 hardirqs last disabled at (1118): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (1118): [] _raw_spin_lock_irq+0x3c/0x90 kernel/locking/spinlock.c:160 softirqs last enabled at (890): [] netlink_create+0x22b/0x530 net/netlink/af_netlink.c:707 softirqs last disabled at (888): [] netlink_create+0x22b/0x530 net/netlink/af_netlink.c:707 Preemption disabled at: [] spin_lock_irq include/linux/spinlock.h:354 [inline] [] n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] [] n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 CPU: 0 PID: 10802 Comm: syz-executor.5 Tainted: G W 4.19.188-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x226 lib/dump_stack.c:118 ___might_sleep.cold.15+0x1f1/0x265 kernel/sched/core.c:6192 __might_sleep+0x95/0x190 kernel/sched/core.c:6145 do_con_write.part.13+0xaf/0x1aa0 drivers/tty/vt/vt.c:2581 do_con_write drivers/tty/vt/vt.c:2578 [inline] con_write+0x1f/0x80 drivers/tty/vt/vt.c:3145 n_hdlc_send_frames drivers/tty/n_hdlc.c:403 [inline] n_hdlc_send_frames+0x201/0x3d0 drivers/tty/n_hdlc.c:375 n_hdlc_tty_wakeup+0x7d/0x90 drivers/tty/n_hdlc.c:479 tty_wakeup+0xaf/0xe0 drivers/tty/tty_io.c:534 __start_tty.part.14+0xbf/0xe0 drivers/tty/tty_io.c:806 __start_tty+0x48/0x60 drivers/tty/tty_io.c:801 n_tty_ioctl_helper drivers/tty/tty_ioctl.c:917 [inline] n_tty_ioctl_helper+0x22f/0x320 drivers/tty/tty_ioctl.c:894 n_hdlc_tty_ioctl+0xc0/0x2d0 drivers/tty/n_hdlc.c:783 tty_ioctl+0x4d4/0x1290 drivers/tty/tty_io.c:2678 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0x196/0x10c0 fs/ioctl.c:688 ksys_ioctl+0x62/0x90 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6e/0xb0 fs/ioctl.c:710 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x466459 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb8678a6188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000466459 RDX: 0000000000000001 RSI: 000000000000540a RDI: 000000000000000c RBP: 00000000004bf9cb R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007ffc8216cc7f R14: 00007fb8678a6300 R15: 0000000000022000 BUG: sleeping function called from invalid context at drivers/tty/vt/vt.c:2581 in_atomic(): 1, irqs_disabled(): 1, pid: 11158, name: syz-executor.3 3 locks held by syz-executor.3/11158: #0: 0000000084f0ae63 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x2d/0x40 drivers/tty/tty_ldsem.c:362 #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: spin_lock_irq include/linux/spinlock.h:354 [inline] #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 #2: 0000000084f0ae63 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1a/0x70 drivers/tty/tty_ldisc.c:293 irq event stamp: 416 hardirqs last enabled at (415): [] do_syscall_64+0x21/0x4e0 arch/x86/entry/common.c:280 hardirqs last disabled at (416): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (416): [] _raw_spin_lock_irq+0x3c/0x90 kernel/locking/spinlock.c:160 softirqs last enabled at (0): [] copy_process.part.2+0x176b/0x7960 kernel/fork.c:1855 softirqs last disabled at (0): [<0000000000000000>] (null) Preemption disabled at: [] spin_lock_irq include/linux/spinlock.h:354 [inline] [] n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] [] n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 CPU: 1 PID: 11158 Comm: syz-executor.3 Tainted: G W 4.19.188-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x226 lib/dump_stack.c:118 ___might_sleep.cold.15+0x1f1/0x265 kernel/sched/core.c:6192 __might_sleep+0x95/0x190 kernel/sched/core.c:6145 do_con_write.part.13+0xaf/0x1aa0 drivers/tty/vt/vt.c:2581 do_con_write drivers/tty/vt/vt.c:2578 [inline] con_write+0x1f/0x80 drivers/tty/vt/vt.c:3145 n_hdlc_send_frames drivers/tty/n_hdlc.c:403 [inline] n_hdlc_send_frames+0x201/0x3d0 drivers/tty/n_hdlc.c:375 n_hdlc_tty_wakeup+0x7d/0x90 drivers/tty/n_hdlc.c:479 tty_wakeup+0xaf/0xe0 drivers/tty/tty_io.c:534 __start_tty.part.14+0xbf/0xe0 drivers/tty/tty_io.c:806 __start_tty+0x48/0x60 drivers/tty/tty_io.c:801 n_tty_ioctl_helper drivers/tty/tty_ioctl.c:917 [inline] n_tty_ioctl_helper+0x22f/0x320 drivers/tty/tty_ioctl.c:894 n_hdlc_tty_ioctl+0xc0/0x2d0 drivers/tty/n_hdlc.c:783 tty_ioctl+0x4d4/0x1290 drivers/tty/tty_io.c:2678 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0x196/0x10c0 fs/ioctl.c:688 ksys_ioctl+0x62/0x90 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6e/0xb0 fs/ioctl.c:710 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x466459 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd4edfa4188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000056c008 RCX: 0000000000466459 RDX: 0000000000000001 RSI: 000000000000540a RDI: 000000000000000b RBP: 00000000004bf9cb R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c008 R13: 00007ffc86399fdf R14: 00007fd4edfa4300 R15: 0000000000022000 BUG: sleeping function called from invalid context at drivers/tty/vt/vt.c:2581 in_atomic(): 1, irqs_disabled(): 1, pid: 12856, name: syz-executor.1 3 locks held by syz-executor.1/12856: #0: 0000000084f0ae63 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x2d/0x40 drivers/tty/tty_ldsem.c:362 #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: spin_lock_irq include/linux/spinlock.h:354 [inline] #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 #2: 0000000084f0ae63 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1a/0x70 drivers/tty/tty_ldisc.c:293 irq event stamp: 730 hardirqs last enabled at (729): [] do_syscall_64+0x21/0x4e0 arch/x86/entry/common.c:280 hardirqs last disabled at (730): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (730): [] _raw_spin_lock_irq+0x3c/0x90 kernel/locking/spinlock.c:160 softirqs last enabled at (136): [] netlink_create+0x22b/0x530 net/netlink/af_netlink.c:707 softirqs last disabled at (134): [] netlink_create+0x22b/0x530 net/netlink/af_netlink.c:707 Preemption disabled at: [] spin_lock_irq include/linux/spinlock.h:354 [inline] [] n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] [] n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 CPU: 0 PID: 12856 Comm: syz-executor.1 Tainted: G W 4.19.188-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x226 lib/dump_stack.c:118 ___might_sleep.cold.15+0x1f1/0x265 kernel/sched/core.c:6192 __might_sleep+0x95/0x190 kernel/sched/core.c:6145 do_con_write.part.13+0xaf/0x1aa0 drivers/tty/vt/vt.c:2581 do_con_write drivers/tty/vt/vt.c:2578 [inline] con_write+0x1f/0x80 drivers/tty/vt/vt.c:3145 n_hdlc_send_frames drivers/tty/n_hdlc.c:403 [inline] n_hdlc_send_frames+0x201/0x3d0 drivers/tty/n_hdlc.c:375 n_hdlc_tty_wakeup+0x7d/0x90 drivers/tty/n_hdlc.c:479 tty_wakeup+0xaf/0xe0 drivers/tty/tty_io.c:534 __start_tty.part.14+0xbf/0xe0 drivers/tty/tty_io.c:806 __start_tty+0x48/0x60 drivers/tty/tty_io.c:801 n_tty_ioctl_helper drivers/tty/tty_ioctl.c:917 [inline] n_tty_ioctl_helper+0x22f/0x320 drivers/tty/tty_ioctl.c:894 n_hdlc_tty_ioctl+0xc0/0x2d0 drivers/tty/n_hdlc.c:783 tty_ioctl+0x4d4/0x1290 drivers/tty/tty_io.c:2678 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0x196/0x10c0 fs/ioctl.c:688 ksys_ioctl+0x62/0x90 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6e/0xb0 fs/ioctl.c:710 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x466459 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f02b3a08188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000466459 RDX: 0000000000000001 RSI: 000000000000540a RDI: 000000000000000c RBP: 00000000004bf9cb R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007ffc8bb8851f R14: 00007f02b3a08300 R15: 0000000000022000 BUG: sleeping function called from invalid context at drivers/tty/vt/vt.c:2581 in_atomic(): 1, irqs_disabled(): 1, pid: 13122, name: syz-executor.0 3 locks held by syz-executor.0/13122: #0: 0000000084f0ae63 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x2d/0x40 drivers/tty/tty_ldsem.c:362 #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: spin_lock_irq include/linux/spinlock.h:354 [inline] #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] #1: 00000000222e2149 (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 #2: 0000000084f0ae63 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1a/0x70 drivers/tty/tty_ldisc.c:293 irq event stamp: 776 hardirqs last enabled at (775): [] do_syscall_64+0x21/0x4e0 arch/x86/entry/common.c:280 hardirqs last disabled at (776): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (776): [] _raw_spin_lock_irq+0x3c/0x90 kernel/locking/spinlock.c:160 softirqs last enabled at (210): [] netlink_create+0x22b/0x530 net/netlink/af_netlink.c:707 softirqs last disabled at (208): [] netlink_create+0x22b/0x530 net/netlink/af_netlink.c:707 Preemption disabled at: [] spin_lock_irq include/linux/spinlock.h:354 [inline] [] n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] [] n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 CPU: 0 PID: 13122 Comm: syz-executor.0 Tainted: G W 4.19.188-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x226 lib/dump_stack.c:118 ___might_sleep.cold.15+0x1f1/0x265 kernel/sched/core.c:6192 __might_sleep+0x95/0x190 kernel/sched/core.c:6145 do_con_write.part.13+0xaf/0x1aa0 drivers/tty/vt/vt.c:2581 do_con_write drivers/tty/vt/vt.c:2578 [inline] con_write+0x1f/0x80 drivers/tty/vt/vt.c:3145