bisecting fixing commit since eb575cd5d7f60241d016fdd13a9e86d962093c9b building syzkaller on aba2b2fb3544d9e42991237c13d8cada421deda5 testing commit eb575cd5d7f60241d016fdd13a9e86d962093c9b compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 89de7e55d2cab6ba44a1f82c65dcf0377cd09f4d70bd7243b1ff82f920d7b91c run #0: crashed: BUG: sleeping function called from invalid context in do_con_write run #1: crashed: BUG: sleeping function called from invalid context in do_con_write run #2: crashed: BUG: sleeping function called from invalid context in do_con_write run #3: crashed: BUG: sleeping function called from invalid context in do_con_write run #4: crashed: BUG: sleeping function called from invalid context in do_con_write run #5: crashed: BUG: sleeping function called from invalid context in do_con_write run #6: crashed: BUG: sleeping function called from invalid context in do_con_write run #7: crashed: BUG: sleeping function called from invalid context in do_con_write run #8: crashed: BUG: sleeping function called from invalid context in do_con_write run #9: crashed: BUG: sleeping function called from invalid context in corrupted run #10: crashed: BUG: sleeping function called from invalid context in do_con_write run #11: crashed: BUG: sleeping function called from invalid context in do_con_write run #12: crashed: BUG: sleeping function called from invalid context in do_con_write run #13: crashed: BUG: sleeping function called from invalid context in do_con_write run #14: crashed: BUG: sleeping function called from invalid context in do_con_write run #15: crashed: BUG: sleeping function called from invalid context in do_con_write run #16: crashed: BUG: sleeping function called from invalid context in do_con_write run #17: crashed: BUG: sleeping function called from invalid context in do_con_write run #18: crashed: BUG: sleeping function called from invalid context in do_con_write run #19: crashed: BUG: sleeping function called from invalid context in do_con_write testing current HEAD c2276d585654e8d573366c29c565043ec36adf63 testing commit c2276d585654e8d573366c29c565043ec36adf63 compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: c67c5ecb038b05b0d9de184e61c6aecf00aec488d8fbf8f85d94e9e78ee99faf all runs: crashed: BUG: sleeping function called from invalid context in do_con_write revisions tested: 2, total time: 27m32.153971591s (build: 20m15.716876406s, test: 6m48.137597073s) the crash still happens on HEAD commit msg: Linux 4.19.208 crash: BUG: sleeping function called from invalid context in do_con_write IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready BUG: sleeping function called from invalid context at drivers/tty/vt/vt.c:2582 in_atomic(): 1, irqs_disabled(): 1, pid: 9854, name: syz-executor.2 3 locks held by syz-executor.2/9854: #0: 0000000034dc2348 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x2d/0x40 drivers/tty/tty_ldsem.c:362 #1: 0000000099936287 (&(&tty->flow_lock)->rlock){....}, at: spin_lock_irq include/linux/spinlock.h:354 [inline] #1: 0000000099936287 (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] #1: 0000000099936287 (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 #2: 0000000034dc2348 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1a/0x70 drivers/tty/tty_ldisc.c:293 irq event stamp: 682 hardirqs last enabled at (681): [] do_syscall_64+0x21/0x4e0 arch/x86/entry/common.c:280 hardirqs last disabled at (682): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (682): [] _raw_spin_lock_irq+0x3c/0x90 kernel/locking/spinlock.c:160 softirqs last enabled at (502): [] __do_softirq+0x62d/0x919 kernel/softirq.c:318 softirqs last disabled at (495): [] invoke_softirq kernel/softirq.c:372 [inline] softirqs last disabled at (495): [] irq_exit+0x17f/0x1c0 kernel/softirq.c:412 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 IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready CPU: 0 PID: 9854 Comm: syz-executor.2 Not tainted 4.19.208-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:2582 do_con_write drivers/tty/vt/vt.c:2579 [inline] con_write+0x1f/0x80 drivers/tty/vt/vt.c:3146 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/0x1300 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:0x4665d9 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:00007f9aeec94188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665d9 RDX: 0000000000000001 RSI: 000000000000540a RDI: 0000000000000003 RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffc8e476b6f R14: 00007f9aeec94300 R15: 0000000000022000 BUG: scheduling while atomic: syz-executor.2/9854/0x00000002 3 locks held by syz-executor.2/9854: #0: 0000000034dc2348 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x2d/0x40 drivers/tty/tty_ldsem.c:362 #1: 0000000099936287 (&(&tty->flow_lock)->rlock){+.+.}, at: spin_lock_irq include/linux/spinlock.h:354 [inline] #1: 0000000099936287 (&(&tty->flow_lock)->rlock){+.+.}, at: n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] #1: 0000000099936287 (&(&tty->flow_lock)->rlock){+.+.}, at: n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 #2: 0000000034dc2348 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1a/0x70 drivers/tty/tty_ldisc.c:293 Modules linked in: 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