bisecting fixing commit since a5aa80588fcd5520ece36121c41b7d8e72245e33 building syzkaller on 55bf892687311014d42ea1be71517156219e7d9b testing commit a5aa80588fcd5520ece36121c41b7d8e72245e33 with gcc (GCC) 8.1.0 kernel signature: 7898cf8b538fc705a6d0eab342f3c46dcce72ed4 run #0: crashed: BUG: sleeping function called from invalid context in __do_page_fault run #1: crashed: BUG: sleeping function called from invalid context in corrupted run #2: crashed: BUG: sleeping function called from invalid context in __do_page_fault run #3: crashed: BUG: sleeping function called from invalid context in __do_page_fault run #4: crashed: BUG: sleeping function called from invalid context in __do_page_fault run #5: crashed: BUG: sleeping function called from invalid context in __do_page_fault run #6: crashed: BUG: sleeping function called from invalid context in __do_page_fault run #7: crashed: BUG: sleeping function called from invalid context in __do_page_fault run #8: crashed: BUG: sleeping function called from invalid context in __do_page_fault run #9: crashed: BUG: sleeping function called from invalid context in __do_page_fault testing current HEAD c7ecf3e3a71c216327980f26b1e895ce9b07ad31 testing commit c7ecf3e3a71c216327980f26b1e895ce9b07ad31 with gcc (GCC) 8.1.0 kernel signature: 295177761300b7f129d483aba4bf3867ac01a2ce all runs: crashed: BUG: sleeping function called from invalid context in __do_page_fault revisions tested: 2, total time: 25m12.450501473s (build: 17m46.943690263s, test: 6m32.135334066s) the crash still happens on HEAD commit msg: Linux 4.19.92 crash: BUG: sleeping function called from invalid context in __do_page_fault IPv6: ADDRCONF(NETDEV_CHANGE): hsr0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_team: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): team_slave_0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): team0: link becomes ready IPv6: ADDRCONF(NETDEV_UP): veth1_to_team: link is not ready BUG: sleeping function called from invalid context at arch/x86/mm/fault.c:1333 in_atomic(): 0, irqs_disabled(): 1, pid: 7124, name: syz-executor.5 4 locks held by syz-executor.5/7124: #0: 0000000009362bed (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x2d/0x40 drivers/tty/tty_ldsem.c:362 #1: 000000004eee3984 (&tty->termios_rwsem){++++}, at: tty_unthrottle+0x1b/0xe0 drivers/tty/tty_ioctl.c:136 #2: 0000000098d232f7 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1a/0x70 drivers/tty/tty_ldisc.c:293 #3: 00000000808eefda (&mm->mmap_sem){++++}, at: __do_page_fault+0x295/0xb20 arch/x86/mm/fault.c:1319 irq event stamp: 18 hardirqs last enabled at (17): [] do_syscall_64+0x21/0x4e0 arch/x86/entry/common.c:280 hardirqs last disabled at (18): [] queue_work_on+0x8c/0x180 kernel/workqueue.c:1483 softirqs last enabled at (0): [] copy_process.part.35+0x17e9/0x7330 kernel/fork.c:1830 softirqs last disabled at (0): [<0000000000000000>] (null) CPU: 1 PID: 7124 Comm: syz-executor.5 Not tainted 4.19.92-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+0x123/0x177 lib/dump_stack.c:118 ___might_sleep.cold.88+0x1bb/0x1f4 kernel/sched/core.c:6192 __might_sleep+0x95/0x190 kernel/sched/core.c:6145 IPv6: ADDRCONF(NETDEV_UP): vxcan1: link is not ready __do_page_fault+0x2b2/0xb20 arch/x86/mm/fault.c:1333 do_page_fault+0x64/0x3a7 arch/x86/mm/fault.c:1465 page_fault+0x1e/0x30 arch/x86/entry/entry_64.S:1204 RIP: 0010:test_and_set_bit arch/x86/include/asm/bitops.h:209 [inline] RIP: 0010:queue_work_on+0x8c/0x180 kernel/workqueue.c:1485 Code: 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 eb 00 00 00 48 83 3d b6 7b b2 06 00 0f 84 cd 00 00 00 fa 66 0f 1f 44 00 00 e8 e4 b7 26 00 49 0f ba 2c 24 00 41 bf 00 00 00 00 0f 83 93 00 00 00 f6 c7 02 RSP: 0018:ffff8880868879b8 EFLAGS: 00010092 RAX: 0000000000000007 RBX: 0000000000000282 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88809f6308c4 RBP: ffff8880868879e0 R08: ffff88809f630970 R09: 0000000000000002 R10: ffff88809f630950 R11: 0000000000000001 R12: 0000000000000050 R13: 0000000000000040 R14: ffff88812c3457c0 R15: ffff88808ae223c0 queue_work include/linux/workqueue.h:512 [inline] schedule_work include/linux/workqueue.h:570 [inline] slcan_write_wakeup+0x64/0x90 drivers/net/can/slcan.c:348 tty_wakeup+0xaf/0xe0 drivers/tty/tty_io.c:534 pty_unthrottle+0x32/0x50 drivers/tty/pty.c:95 tty_unthrottle+0x79/0xe0 drivers/tty/tty_ioctl.c:139 __tty_perform_flush+0x16a/0x1d0 drivers/tty/tty_ioctl.c:861 n_tty_ioctl_helper+0xb9/0x320 drivers/tty/tty_ioctl.c:937 n_tty_ioctl+0x2c/0x2d0 drivers/tty/n_tty.c:2464 tty_ioctl+0x4d0/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:0x459829 Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f9f2a790c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459829 RDX: 0000000000000000 RSI: 000000000000540b RDI: 0000000000000003 RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f9f2a7916d4 R13: 00000000004c3e0b R14: 00000000004d7dd0 R15: 00000000ffffffff BUG: unable to handle kernel NULL pointer dereference at 0000000000000050 PGD 872e8067 P4D 872e8067 PUD 872e9067 PMD 0 Oops: 0002 [#1] PREEMPT SMP KASAN CPU: 1 PID: 7124 Comm: syz-executor.5 Tainted: G W 4.19.92-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:test_and_set_bit arch/x86/include/asm/bitops.h:209 [inline] RIP: 0010:queue_work_on+0x8c/0x180 kernel/workqueue.c:1485 Code: 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 eb 00 00 00 48 83 3d b6 7b b2 06 00 0f 84 cd 00 00 00 fa 66 0f 1f 44 00 00 e8 e4 b7 26 00 49 0f ba 2c 24 00 41 bf 00 00 00 00 0f 83 93 00 00 00 f6 c7 02 RSP: 0018:ffff8880868879b8 EFLAGS: 00010092 RAX: 0000000000000007 RBX: 0000000000000282 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88809f6308c4 RBP: ffff8880868879e0 R08: ffff88809f630970 R09: 0000000000000002 R10: ffff88809f630950 R11: 0000000000000001 R12: 0000000000000050 R13: 0000000000000040 R14: ffff88812c3457c0 R15: ffff88808ae223c0 FS: 00007f9f2a791700(0000) GS:ffff8880aeb00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000050 CR3: 00000000a03ef000 CR4: 00000000001406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: queue_work include/linux/workqueue.h:512 [inline] schedule_work include/linux/workqueue.h:570 [inline] slcan_write_wakeup+0x64/0x90 drivers/net/can/slcan.c:348 tty_wakeup+0xaf/0xe0 drivers/tty/tty_io.c:534 pty_unthrottle+0x32/0x50 drivers/tty/pty.c:95 tty_unthrottle+0x79/0xe0 drivers/tty/tty_ioctl.c:139 __tty_perform_flush+0x16a/0x1d0 drivers/tty/tty_ioctl.c:861 n_tty_ioctl_helper+0xb9/0x320 drivers/tty/tty_ioctl.c:937 n_tty_ioctl+0x2c/0x2d0 drivers/tty/n_tty.c:2464 tty_ioctl+0x4d0/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:0x459829 Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f9f2a790c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459829 RDX: 0000000000000000 RSI: 000000000000540b RDI: 0000000000000003 RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f9f2a7916d4 R13: 00000000004c3e0b R14: 00000000004d7dd0 R15: 00000000ffffffff Modules linked in: CR2: 0000000000000050 ---[ end trace c2ad66449d6a79a8 ]--- RIP: 0010:test_and_set_bit arch/x86/include/asm/bitops.h:209 [inline] RIP: 0010:queue_work_on+0x8c/0x180 kernel/workqueue.c:1485 Code: 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 eb 00 00 00 48 83 3d b6 7b b2 06 00 0f 84 cd 00 00 00 fa 66 0f 1f 44 00 00 e8 e4 b7 26 00 49 0f ba 2c 24 00 41 bf 00 00 00 00 0f 83 93 00 00 00 f6 c7 02 RSP: 0018:ffff8880868879b8 EFLAGS: 00010092 RAX: 0000000000000007 RBX: 0000000000000282 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88809f6308c4 RBP: ffff8880868879e0 R08: ffff88809f630970 R09: 0000000000000002 R10: ffff88809f630950 R11: 0000000000000001 R12: 0000000000000050 R13: 0000000000000040 R14: ffff88812c3457c0 R15: ffff88808ae223c0 FS: 00007f9f2a791700(0000) GS:ffff8880aeb00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000050 CR3: 00000000a03ef000 CR4: 00000000001406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400