bisecting fixing commit since eb575cd5d7f60241d016fdd13a9e86d962093c9b building syzkaller on aba2b2fb3544d9e42991237c13d8cada421deda5 testing commit eb575cd5d7f60241d016fdd13a9e86d962093c9b compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 2b25472b7679de7cb4b3c3d556fe4805f14f72aafb91d3098478148680fb91aa 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 corrupted 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 do_con_write 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 b172b44fcb1771e083aad806fa96f3f60e2ddfac testing commit b172b44fcb1771e083aad806fa96f3f60e2ddfac compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 199b64cce8d9d64026b07c7fadf9f619434b02f02570777bed8799439763cb91 all runs: crashed: BUG: sleeping function called from invalid context in do_con_write revisions tested: 2, total time: 27m44.502203633s (build: 20m38.518190366s, test: 6m39.380563734s) the crash still happens on HEAD commit msg: Linux 4.19.206 crash: BUG: sleeping function called from invalid context in do_con_write IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 BUG: sleeping function called from invalid context at drivers/tty/vt/vt.c:2582 IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready in_atomic(): 1, irqs_disabled(): 1, pid: 9881, name: syz-executor.0 wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 3 locks held by syz-executor.0/9881: #0: 000000000a7f2336 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x2d/0x40 drivers/tty/tty_ldsem.c:362 #1: 00000000ea96c07e (&(&tty->flow_lock)->rlock){....}, at: spin_lock_irq include/linux/spinlock.h:354 [inline] #1: 00000000ea96c07e (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] #1: 00000000ea96c07e (&(&tty->flow_lock)->rlock){....}, at: n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 #2: 000000000a7f2336 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1a/0x70 drivers/tty/tty_ldisc.c:293 irq event stamp: 968 hardirqs last enabled at (967): [] do_syscall_64+0x21/0x4e0 arch/x86/entry/common.c:280 hardirqs last disabled at (968): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (968): [] _raw_spin_lock_irq+0x3c/0x90 kernel/locking/spinlock.c:160 softirqs last enabled at (688): [] spin_unlock_bh include/linux/spinlock.h:374 [inline] softirqs last enabled at (688): [] peernet2id+0x8b/0xc0 net/core/net_namespace.c:266 softirqs last disabled at (686): [] spin_lock_bh include/linux/spinlock.h:334 [inline] softirqs last disabled at (686): [] peernet2id+0x6d/0xc0 net/core/net_namespace.c:264 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): wlan1: link is not ready CPU: 1 PID: 9881 Comm: syz-executor.0 Not tainted 4.19.206-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 wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 ___might_sleep.cold.15+0x1f1/0x265 kernel/sched/core.c:6192 IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready __might_sleep+0x95/0x190 kernel/sched/core.c:6145 wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 do_con_write.part.13+0xaf/0x1aa0 drivers/tty/vt/vt.c:2582 IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready 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/0x1290 drivers/tty/tty_io.c:2678 wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0x196/0x10c0 fs/ioctl.c:688 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready 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 wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 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:00007f31bcb7c188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 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: 00007ffe3ab030df R14: 00007f31bcb7c300 R15: 0000000000022000 BUG: scheduling while atomic: syz-executor.0/9881/0x00000002 IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready 3 locks held by syz-executor.0/9881: #0: 000000000a7f2336 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x2d/0x40 drivers/tty/tty_ldsem.c:362 IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready #1: 00000000ea96c07e (&(&tty->flow_lock)->rlock){+.+.}, at: spin_lock_irq include/linux/spinlock.h:354 [inline] #1: 00000000ea96c07e (&(&tty->flow_lock)->rlock){+.+.}, at: n_tty_ioctl_helper drivers/tty/tty_ioctl.c:914 [inline] #1: 00000000ea96c07e (&(&tty->flow_lock)->rlock){+.+.}, at: n_tty_ioctl_helper+0x18f/0x320 drivers/tty/tty_ioctl.c:894 #2: 000000000a7f2336 (&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