bisecting fixing commit since ad326970d25cc85128cd22d62398751ad072efff building syzkaller on ff4a3345a1b2a40ff1b8b983153d0b1fcc72f1c5 testing commit ad326970d25cc85128cd22d62398751ad072efff compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: b2a44f284b4a602efec6e911bcb397a546688ee8db617576887761c58666eb8f all runs: crashed: BUG: unable to handle kernel NULL pointer dereference in rhashtable_free_and_destroy testing current HEAD b172b44fcb1771e083aad806fa96f3f60e2ddfac testing commit b172b44fcb1771e083aad806fa96f3f60e2ddfac compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 8dbab371933c76168e3a8be9e76633345350384e91180834bf5612f62f48a3ee run #0: crashed: BUG: unable to handle kernel NULL pointer dereference in rhashtable_free_and_destroy run #1: crashed: BUG: unable to handle kernel NULL pointer dereference in rhashtable_free_and_destroy run #2: crashed: BUG: unable to handle kernel NULL pointer dereference in rhashtable_free_and_destroy run #3: crashed: BUG: unable to handle kernel NULL pointer dereference in rhashtable_free_and_destroy run #4: crashed: BUG: unable to handle kernel NULL pointer dereference in rhashtable_free_and_destroy run #5: crashed: BUG: unable to handle kernel NULL pointer dereference in rhashtable_free_and_destroy run #6: crashed: BUG: unable to handle kernel NULL pointer dereference in rhashtable_free_and_destroy run #7: crashed: BUG: unable to handle kernel NULL pointer dereference in rhashtable_free_and_destroy run #8: crashed: BUG: unable to handle kernel NULL pointer dereference in rhashtable_free_and_destroy run #9: crashed: BUG: sleeping function called from invalid context in __do_page_fault revisions tested: 2, total time: 28m48.197167809s (build: 21m10.407540672s, test: 7m8.253786904s) the crash still happens on HEAD commit msg: Linux 4.19.206 crash: BUG: sleeping function called from invalid context in __do_page_fault RAX: ffffffffffffffda RBX: 000000000055bf00 RCX: 0000000000465849 RDX: 0000000000000000 RSI: 00000000200006c0 RDI: 0000000000000003 RBP: 00007f1e7ad5c1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007ffc8bb7980f R14: 00007f1e7ad5c300 R15: 0000000000022000 BUG: sleeping function called from invalid context at arch/x86/mm/fault.c:1355 in_atomic(): 0, irqs_disabled(): 1, pid: 7800, name: syz-executor.0 4 locks held by syz-executor.0/7800: #0: 000000006f5ef628 (cb_lock){++++}, at: genl_rcv+0x14/0x40 net/netlink/genetlink.c:637 #1: 0000000092f66cd7 (genl_mutex){+.+.}, at: genl_lock net/netlink/genetlink.c:33 [inline] #1: 0000000092f66cd7 (genl_mutex){+.+.}, at: genl_rcv_msg+0x10e/0x140 net/netlink/genetlink.c:625 #2: 00000000e2013651 (rtnl_mutex){+.+.}, at: rtnl_lock+0x12/0x20 net/core/rtnetlink.c:77 #3: 00000000ca3bd422 (&mm->mmap_sem){++++}, at: __do_page_fault+0x2de/0xb30 arch/x86/mm/fault.c:1341 irq event stamp: 4328 hardirqs last enabled at (4327): [] kfree+0x116/0x220 mm/slab.c:3823 hardirqs last disabled at (4328): [] try_to_grab_pending+0xaf/0x5f0 kernel/workqueue.c:1213 softirqs last enabled at (3604): [] __do_softirq+0x62d/0x919 kernel/softirq.c:318 softirqs last disabled at (3499): [] invoke_softirq kernel/softirq.c:372 [inline] softirqs last disabled at (3499): [] irq_exit+0x17f/0x1c0 kernel/softirq.c:412 CPU: 1 PID: 7800 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 ___might_sleep.cold.15+0x1f1/0x265 kernel/sched/core.c:6192 __might_sleep+0x95/0x190 kernel/sched/core.c:6145 __do_page_fault+0x2fb/0xb30 arch/x86/mm/fault.c:1355 do_page_fault+0x64/0x3b0 arch/x86/mm/fault.c:1487 page_fault+0x1e/0x30 arch/x86/entry/entry_64.S:1205 RIP: 0010:test_and_set_bit arch/x86/include/asm/bitops.h:209 [inline] RIP: 0010:try_to_grab_pending+0xb8/0x5f0 kernel/workqueue.c:1229 Code: 00 00 00 00 fc ff df 4c 89 e2 48 c1 ea 03 80 3c 02 00 0f 85 0f 04 00 00 4d 89 34 24 e8 c1 6d 26 00 45 84 ed 0f 85 54 01 00 00 48 0f ba 2b 00 72 11 31 c0 48 83 c4 10 5b 41 5c 41 5d 41 5e 41 RSP: 0018:ffff8881c9f7f048 EFLAGS: 00010046 RAX: 0000000000000007 RBX: 0000000000000080 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8881d0d3ed0c RBP: ffff8881c9f7f080 R08: ffff8881d0d3edb8 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff8881c9f7f0b8 R13: 0000000000000000 R14: 0000000000000282 R15: 0000000000000080 __cancel_work_timer+0x9b/0x430 kernel/workqueue.c:2972 cancel_work_sync+0xb/0x10 kernel/workqueue.c:3049 rhashtable_free_and_destroy+0x25/0x690 lib/rhashtable.c:1145 mesh_table_free net/mac80211/mesh_pathtbl.c:73 [inline] mesh_pathtbl_unregister+0x43/0xa0 net/mac80211/mesh_pathtbl.c:825 ieee80211_mesh_teardown_sdata+0x15/0x20 net/mac80211/mesh.c:1478 ieee80211_teardown_sdata+0x5b/0x70 net/mac80211/iface.c:1122 ieee80211_uninit+0x10/0x20 net/mac80211/iface.c:1127 rollback_registered_many+0x828/0xb50 net/core/dev.c:8210 rollback_registered+0xdc/0x190 net/core/dev.c:8238 unregister_netdevice_queue+0x186/0x240 net/core/dev.c:9305 unregister_netdevice include/linux/netdevice.h:2615 [inline] ieee80211_if_remove+0x1db/0x2d0 net/mac80211/iface.c:1920 ieee80211_del_iface+0xd/0x20 net/mac80211/cfg.c:144 rdev_del_virtual_intf net/wireless/rdev-ops.h:57 [inline] cfg80211_destroy_ifaces+0xe3/0x540 net/wireless/core.c:317 nl80211_new_interface+0xa2/0x1380 net/wireless/nl80211.c:3225 genl_family_rcv_msg+0x599/0x1000 net/netlink/genetlink.c:602 genl_rcv_msg+0xa7/0x140 net/netlink/genetlink.c:627 netlink_rcv_skb+0x13e/0x3d0 net/netlink/af_netlink.c:2457 genl_rcv+0x23/0x40 net/netlink/genetlink.c:638 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x443/0x660 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x667/0xc60 net/netlink/af_netlink.c:1911 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:661 ___sys_sendmsg+0x647/0x950 net/socket.c:2227 __sys_sendmsg+0xd9/0x180 net/socket.c:2265 __do_sys_sendmsg net/socket.c:2274 [inline] __se_sys_sendmsg net/socket.c:2272 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2272 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x465849 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:00007f1e7ad5c188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000055bf00 RCX: 0000000000465849 RDX: 0000000000000000 RSI: 00000000200006c0 RDI: 0000000000000003 RBP: 00007f1e7ad5c1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007ffc8bb7980f R14: 00007f1e7ad5c300 R15: 0000000000022000 BUG: unable to handle kernel NULL pointer dereference at 0000000000000080 PGD 1ee324067 P4D 1ee324067 PUD 1f2ed1067 PMD 0 Oops: 0002 [#1] PREEMPT SMP KASAN CPU: 1 PID: 7800 Comm: syz-executor.0 Tainted: G W 4.19.206-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:try_to_grab_pending+0xb8/0x5f0 kernel/workqueue.c:1229 Code: 00 00 00 00 fc ff df 4c 89 e2 48 c1 ea 03 80 3c 02 00 0f 85 0f 04 00 00 4d 89 34 24 e8 c1 6d 26 00 45 84 ed 0f 85 54 01 00 00 48 0f ba 2b 00 72 11 31 c0 48 83 c4 10 5b 41 5c 41 5d 41 5e 41 RSP: 0018:ffff8881c9f7f048 EFLAGS: 00010046 RAX: 0000000000000007 RBX: 0000000000000080 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8881d0d3ed0c RBP: ffff8881c9f7f080 R08: ffff8881d0d3edb8 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff8881c9f7f0b8 R13: 0000000000000000 R14: 0000000000000282 R15: 0000000000000080 FS: 00007f1e7ad5c700(0000) GS:ffff8881f6700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000080 CR3: 00000001e848c004 CR4: 00000000001606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __cancel_work_timer+0x9b/0x430 kernel/workqueue.c:2972 cancel_work_sync+0xb/0x10 kernel/workqueue.c:3049 rhashtable_free_and_destroy+0x25/0x690 lib/rhashtable.c:1145 mesh_table_free net/mac80211/mesh_pathtbl.c:73 [inline] mesh_pathtbl_unregister+0x43/0xa0 net/mac80211/mesh_pathtbl.c:825 ieee80211_mesh_teardown_sdata+0x15/0x20 net/mac80211/mesh.c:1478 ieee80211_teardown_sdata+0x5b/0x70 net/mac80211/iface.c:1122 ieee80211_uninit+0x10/0x20 net/mac80211/iface.c:1127 rollback_registered_many+0x828/0xb50 net/core/dev.c:8210 rollback_registered+0xdc/0x190 net/core/dev.c:8238 unregister_netdevice_queue+0x186/0x240 net/core/dev.c:9305 unregister_netdevice include/linux/netdevice.h:2615 [inline] ieee80211_if_remove+0x1db/0x2d0 net/mac80211/iface.c:1920 ieee80211_del_iface+0xd/0x20 net/mac80211/cfg.c:144 rdev_del_virtual_intf net/wireless/rdev-ops.h:57 [inline] cfg80211_destroy_ifaces+0xe3/0x540 net/wireless/core.c:317 nl80211_new_interface+0xa2/0x1380 net/wireless/nl80211.c:3225 genl_family_rcv_msg+0x599/0x1000 net/netlink/genetlink.c:602 genl_rcv_msg+0xa7/0x140 net/netlink/genetlink.c:627 netlink_rcv_skb+0x13e/0x3d0 net/netlink/af_netlink.c:2457 genl_rcv+0x23/0x40 net/netlink/genetlink.c:638 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x443/0x660 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x667/0xc60 net/netlink/af_netlink.c:1911 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:661 ___sys_sendmsg+0x647/0x950 net/socket.c:2227 __sys_sendmsg+0xd9/0x180 net/socket.c:2265 __do_sys_sendmsg net/socket.c:2274 [inline] __se_sys_sendmsg net/socket.c:2272 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2272 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x465849 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:00007f1e7ad5c188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000055bf00 RCX: 0000000000465849 RDX: 0000000000000000 RSI: 00000000200006c0 RDI: 0000000000000003 RBP: 00007f1e7ad5c1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007ffc8bb7980f R14: 00007f1e7ad5c300 R15: 0000000000022000 Modules linked in: CR2: 0000000000000080 ---[ end trace 55b24e0e9c66e402 ]--- RIP: 0010:test_and_set_bit arch/x86/include/asm/bitops.h:209 [inline] RIP: 0010:try_to_grab_pending+0xb8/0x5f0 kernel/workqueue.c:1229 Code: 00 00 00 00 fc ff df 4c 89 e2 48 c1 ea 03 80 3c 02 00 0f 85 0f 04 00 00 4d 89 34 24 e8 c1 6d 26 00 45 84 ed 0f 85 54 01 00 00 48 0f ba 2b 00 72 11 31 c0 48 83 c4 10 5b 41 5c 41 5d 41 5e 41 RSP: 0018:ffff8881c9f7f048 EFLAGS: 00010046 RAX: 0000000000000007 RBX: 0000000000000080 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8881d0d3ed0c RBP: ffff8881c9f7f080 R08: ffff8881d0d3edb8 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff8881c9f7f0b8 R13: 0000000000000000 R14: 0000000000000282 R15: 0000000000000080 FS: 00007f1e7ad5c700(0000) GS:ffff8881f6700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000080 CR3: 00000001e848c004 CR4: 00000000001606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess), 6 bytes skipped: 0: df 4c 89 e2 fisttps -0x1e(%rcx,%rcx,4) 4: 48 c1 ea 03 shr $0x3,%rdx 8: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) c: 0f 85 0f 04 00 00 jne 0x421 12: 4d 89 34 24 mov %r14,(%r12) 16: e8 c1 6d 26 00 callq 0x266ddc 1b: 45 84 ed test %r13b,%r13b 1e: 0f 85 54 01 00 00 jne 0x178 * 24: f0 48 0f ba 2b 00 lock btsq $0x0,(%rbx) <-- trapping instruction 2a: 72 11 jb 0x3d 2c: 31 c0 xor %eax,%eax 2e: 48 83 c4 10 add $0x10,%rsp 32: 5b pop %rbx 33: 41 5c pop %r12 35: 41 5d pop %r13 37: 41 5e pop %r14 39: 41 rex.B