panic: kernel diagnostic assertion "kd_lookup(kd->kd_unit) == NULL" failed: file "/syzkaller/managers/multicore/kernel/sys/dev/kcov.c", line 306
Stopped at db_enter+0x25: addq $0x8,%rsp
TID PID UID PRFLAGS PFLAGS CPU COMMAND
* 3612 84429 0 0 0x4000000 0K syz-executor
db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438
panic(ffffffff83466a0b) at panic+0x1e5 sys/kern/subr_prf.c:198
__assert(ffffffff83413bf2,ffffffff8335262f,132,ffffffff833f1155) at __assert+0x29 sys/kern/subr_prf.c:-1
kcovopen(113d4,1,2000,ffff8000fffe27e0) at kcovopen+0x14f kd_lookup sys/dev/kcov.c:478 [inline]
kcovopen(113d4,1,2000,ffff8000fffe27e0) at kcovopen+0x14f sys/dev/kcov.c:306
spec_open_clone(ffff80002a30feb8) at spec_open_clone+0x287 sys/kern/spec_vnops.c:722
spec_open(ffff80002a30feb8) at spec_open+0x329 sys/kern/spec_vnops.c:148
VOP_OPEN(fffffd8072b13018,1,fffffd80097fb7b8,ffff8000fffe27e0) at VOP_OPEN+0x8b sys/kern/vfs_vops.c:138
vn_open(ffff80002a310108,1,0) at vn_open+0x708 sys/kern/vfs_vnops.c:177
doopenat(ffff8000fffe27e0,ffffff9c,200000000080,0,0,ffff80002a3102b0) at doopenat+0x32e sys/kern/vfs_syscalls.c:1137
syscall(ffff80002a310360) at syscall+0xbc6 mi_syscall sys/sys/syscall_mi.h:176 [inline]
syscall(ffff80002a310360) at syscall+0xbc6 sys/arch/amd64/amd64/trap.c:579
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x8b923d4abb0, count: 4
https://www.openbsd.org/ddb.html describes the minimum info required in bug
reports. Insufficient info makes it difficult to find and fix bugs.
ddb{0}>
ddb{0}> set $lines = 0
ddb{0}> set $maxwidth = 0
ddb{0}> show panic
*cpu0: kernel diagnostic assertion "kd_lookup(kd->kd_unit) == NULL" failed: file "/syzkaller/managers/multicore/kernel/sys/dev/kcov.c", line 306
ddb{0}> trace
db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438
panic(ffffffff83466a0b) at panic+0x1e5 sys/kern/subr_prf.c:198
__assert(ffffffff83413bf2,ffffffff8335262f,132,ffffffff833f1155) at __assert+0x29 sys/kern/subr_prf.c:-1
kcovopen(113d4,1,2000,ffff8000fffe27e0) at kcovopen+0x14f kd_lookup sys/dev/kcov.c:478 [inline]
kcovopen(113d4,1,2000,ffff8000fffe27e0) at kcovopen+0x14f sys/dev/kcov.c:306
spec_open_clone(ffff80002a30feb8) at spec_open_clone+0x287 sys/kern/spec_vnops.c:722
spec_open(ffff80002a30feb8) at spec_open+0x329 sys/kern/spec_vnops.c:148
VOP_OPEN(fffffd8072b13018,1,fffffd80097fb7b8,ffff8000fffe27e0) at VOP_OPEN+0x8b sys/kern/vfs_vops.c:138
vn_open(ffff80002a310108,1,0) at vn_open+0x708 sys/kern/vfs_vnops.c:177
doopenat(ffff8000fffe27e0,ffffff9c,200000000080,0,0,ffff80002a3102b0) at doopenat+0x32e sys/kern/vfs_syscalls.c:1137
syscall(ffff80002a310360) at syscall+0xbc6 mi_syscall sys/sys/syscall_mi.h:176 [inline]
syscall(ffff80002a310360) at syscall+0xbc6 sys/arch/amd64/amd64/trap.c:579
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x8b923d4abb0, count: -11
ddb{0}> show registers
rdi 0
rsi 0x1
rbp 0xffff80002a30fc90
rbx 0xffffffff8382bdd7 cpu_info_full_primary+0x2dd7
rdx 0xffff800001475680
rcx 0xffff8000fffe27e0
rax 0xffffffff8382aff0 cpu_info_full_primary+0x1ff0
r8 0x101010101010101
r9 0x8080808080808080
r10 0xafe31ff5f0e9f739
r11 0x6fc8c68a7a1670c0
r12 0xffffffff8382bbd8 cpu_info_full_primary+0x2bd8
r13 0
r14 0
r15 0x1
rip 0xffffffff81757c05 db_enter+0x25
cs 0x8
rflags 0x246
rsp 0xffff80002a30fc80
ss 0x10
db_enter+0x25: addq $0x8,%rsp
ddb{0}> show proc
PROC (syz-executor) tid=3612 pid=84429 tcnt=5 stat=onproc
flags process=0 proc=4000000<THREAD>
runpri=86, usrpri=86, slppri=32, nice=20
wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0
forw=0xffffffffffffffff, list=0xffff8000fffeacf8,0xffffffff83922c10
process=0xffff8000ffff7a28 user=0xffff80002a30b000, vmspace=0xfffffd800b026960
estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0
ddb{0}> ps
PID TID PPID UID S FLAGS WAIT COMMAND
84429 332891 64609 0 2 0 syz-executor
84429 163317 64609 0 3 0x4000080 ttyopn syz-executor
84429 427533 64609 0 3 0x4000080 ttyopn syz-executor
84429 96679 64609 0 3 0x4000080 ttyopn syz-executor
*84429 3612 64609 0 7 0x4000000 syz-executor
91792 426681 53632 0 2 0 syz-executor
91792 446415 53632 0 3 0x4000080 ttyopn syz-executor
91792 268276 53632 0 3 0x4000080 ttyopn syz-executor
91792 499330 53632 0 3 0x4000080 ttyopn syz-executor
91792 92196 53632 0 3 0x4000080 fsleep syz-executor
77652 205204 0 0 3 0x14200 acct acct
88056 22428 1 0 3 0x100083 ttyin getty
6283 450098 9990 0 3 0x82 nanoslp syz-executor
64650 296722 9990 0 3 0x2 biowait syz-executor
53632 456597 9990 0 3 0x82 nanoslp syz-executor
16870 153722 0 0 3 0x14200 bored sosplice
94177 519795 9990 0 2 0x2 syz-executor
8756 180926 9990 0 3 0x82 piperd syz-executor
48752 161888 9990 0 2 0x2 syz-executor
33161 69013 9990 0 3 0x82 piperd syz-executor
64609 485753 9990 0 3 0x82 nanoslp syz-executor
9990 54474 43259 0 3 0x82 nanoslp syz-executor
43259 191156 1370 0 3 0x10008a sigsusp ksh
1370 462176 71331 0 3 0x98 kqread sshd-session
71331 340936 82491 0 3 0x92 kqread sshd-session
82491 177423 1 0 3 0x88 kqread sshd
10997 446802 98702 74 3 0x1100092 bpf pflogd
98702 465576 1 0 3 0x80 sbwait pflogd
69598 283984 25617 73 3 0x1100090 kqread syslogd
25617 12662 1 0 3 0x100082 sbwait syslogd
152 518239 1 0 3 0x100080 kqread resolvd
80583 448814 47616 77 3 0x100092 kqread dhcpleased
11761 475301 47616 77 3 0x100092 kqread dhcpleased
47616 417806 1 0 3 0x80 kqread dhcpleased
46472 348623 0 0 3 0x14200 bored smr
77407 485880 0 0 2 0x14200 zerothread
23276 240256 0 0 3 0x14200 aiodoned aiodoned
13810 15233 0 0 3 0x14200 syncer update
31543 466343 0 0 3 0x14200 cleaner cleaner
46684 82877 0 0 3 0x14200 reaper reaper
6767 48446 0 0 3 0x14200 pgdaemon pagedaemon
14951 163138 0 0 3 0x14200 bored viomb
70166 64943 0 0 3 0x40014200 acpi0 acpi0
57459 376898 0 0 7 0x40014200 idle1
69726 273515 0 0 3 0x14200 bored softnet3
85785 485618 0 0 3 0x14200 bored softnet2
99276 416404 0 0 3 0x14200 bored softnet1
86339 359752 0 0 3 0x14200 bored softnet0
62176 93521 0 0 3 0x14200 bored systqmp
5544 396013 0 0 3 0x14200 bored systq
94622 196286 0 0 3 0x14200 tmoslp softclockmp
31073 471880 0 0 3 0x40014200 tmoslp softclock
50979 23921 0 0 3 0x40014200 idle0
1 356796 0 0 3 0x82 wait init
0 0 -1 0 3 0x10010200 scheduler swapper
ddb{0}> show all locks
CPU 0:
exclusive mutex /syzkaller/managers/multicore/kernel/sys/dev/kcov.c:129 r = 0 (0xffffffff8383af00)
#0 witness_lock+0x5bb stacktrace_save sys/sys/stacktrace.h:37 [inline]
#0 witness_lock+0x5bb sys/kern/subr_witness.c:1160
#1 mtx_enter_try+0x1ad sys/kern/kern_lock.c:298
#2 mtx_enter+0x62 sys/kern/kern_lock.c:255
#3 kcovopen+0x63 sys/dev/kcov.c:306
#4 spec_open_clone+0x287 sys/kern/spec_vnops.c:722
#5 spec_open+0x329 sys/kern/spec_vnops.c:148
#6 VOP_OPEN+0x8b sys/kern/vfs_vops.c:138
#7 vn_open+0x708 sys/kern/vfs_vnops.c:177
#8 doopenat+0x32e sys/kern/vfs_syscalls.c:1137
#9 syscall+0xbc6 mi_syscall sys/sys/syscall_mi.h:176 [inline]
#9 syscall+0xbc6 sys/arch/amd64/amd64/trap.c:579
#10 Xsyscall+0x128
Process 84429 (syz-executor) thread 0xffff8000fffe27e0 (3612)
Process 64650 (syz-executor) thread 0xffff8000fffe2f90 (296722)
Process 94177 (syz-executor) thread 0xffff8000ffff07d0 (519795)
Process 48752 (syz-executor) thread 0xffff8000ffff02b0 (161888)
ddb{0}> show malloc
Type InUse MemUse HighUse Limit Requests Type Lim
devbuf 10204 11042K 11475K 166960K 14317 0
pcb 19 12K 12K 166960K 316 0
rtable 84 10K 12K 166960K 752 0
pf 28 16K 82K 166960K 263 0
ifaddr 15 2K 7K 166960K 169 0
ifgroup 35 1K 2K 166960K 296 0
sysctl 4 1K 9K 166960K 14 0
counters 58 35K 37K 166960K 350 0
ioctlops 0 0K 4K 166960K 1756 0
iov 0 0K 24K 166960K 68 0
mount 1 1K 1K 166960K 1 0
log 0 0K 0K 166960K 4 0
vnodes 1348 85K 85K 166960K 3151 0
UFS quota 1 32K 32K 166960K 1 0
UFS mount 5 36K 36K 166960K 5 0
shm 2 48K 60K 166960K 25 0
VM map 2 1K 1K 166960K 2 0
sem 18 37K 37K 166960K 36 0
dirhash 18 3K 3K 166960K 81 0
ACPI 1692 195K 286K 166960K 12470 0
file desc 15 53K 98K 166960K 3312 0
sigio 0 0K 0K 166960K 35 0
proc 73 91K 140K 166960K 780 0
subproc 74 4K 4K 166960K 113 0
NFS srvsock 1 0K 0K 166960K 1 0
NFS daemon 1 16K 16K 166960K 1 0
ip_moptions 0 0K 0K 166960K 187 0
in_multi 13 1K 7K 166960K 234 0
ether_multi 1 0K 0K 166960K 20 0
mrt 2 0K 0K 166960K 56 0
ISOFS mount 1 32K 32K 166960K 1 0
MSDOSFS mount 1 16K 16K 166960K 1 0
ttys 97 440K 440K 166960K 97 0
exec 0 0K 1K 166960K 541 0
fusefs mount 1 32K 32K 166960K 1 0
pfkey data 0 0K 0K 166960K 1 0
tdb 3 0K 0K 166960K 3 0
VM swap 8 62K 64K 166960K 10 0
UVM amap 223 160K 168K 166960K 28781 0
UVM aobj 36 2K 4K 166960K 40 0
pinsyscall 40 80K 100K 166960K 4527 0
memdesc 1 4K 4K 166960K 1 0
crypto data 1 1K 1K 166960K 1 0
ip6_options 0 0K 0K 166960K 109 0
NDP 7 0K 2K 166960K 114 0
temp 57 8690K 8799K 166960K 88238 0
kqueue 13 20K 30K 166960K 274 0
SYN cache 2 16K 16K 166960K 2 0
ddb{0}> show all pools
Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle
plcache 128 26 0 0 1 0 1 1 0 8 0
rtpcb 120 100 0 97 1 0 1 1 0 8 0
rtentry 176 246 0 229 6 2 4 6 0 8 0
unpcb 144 589 0 572 2 1 1 2 0 8 0
syncache 336 5 0 5 2 2 0 1 0 8 0
tcpcb 736 396 0 391 1 0 1 1 0 8 0
arp 128 40 0 36 1 0 1 1 0 8 0
inpcb 328 1396 0 1386 5 3 2 2 0 8 0
nd6 144 40 0 38 1 0 1 1 0 8 0
pkpcb 40 7 0 7 3 3 0 1 0 8 0
kcovpl 48 12 0 4 1 0 1 1 0 8 0
mppekey 1024 1 0 1 1 1 0 1 0 8 0
ppxss 1192 108 0 108 3 2 1 1 0 8 1
pppxif 1504 19 0 19 3 3 0 1 0 8 0
pffrag 232 11 0 10 2 1 1 1 0 482 0
pffrnode 88 9 0 8 2 1 1 1 0 8 0
pffrent 40 17 0 15 2 1 1 1 0 8 0
pfosfp 40 1430 0 1006 5 0 5 5 0 8 0
pfosfpen 112 1430 0 714 21 0 21 21 0 8 0
pfrktable 1344 2 0 0 1 0 1 1 0 8 0
pfanchor 1288 1 0 1 1 1 0 1 0 8 0
pftag 88 3 0 0 1 0 1 1 0 8 0
pfstitem 24 162 0 129 1 0 1 1 0 8 0
pfstkey 128 162 0 129 4 0 4 4 0 8 0
pfstate 384 162 0 129 11 1 10 11 0 8 0
pfrule 1344 51 0 35 3 1 2 2 0 8 0
rttmr 136 16 0 16 3 3 0 1 0 8 0
art_heap8 4096 3 0 1 3 1 2 3 0 8 0
art_heap4 256 1138 0 1042 30 19 11 29 0 8 1
art_table 32 1141 0 1043 4 2 2 4 0 8 0
art_node 16 239 0 228 1 0 1 1 0 8 0
sysvmsgpl 40 12 0 8 1 0 1 1 0 8 0
semupl 112 2 0 2 2 2 0 1 0 8 0
semapl 112 28 0 12 1 0 1 1 0 8 0
shmpl 112 37 0 4 1 0 1 1 0 8 0
dirhash 1024 64 0 43 3 0 3 3 0 8 0
dino2pl 256 6228 0 4714 96 0 96 96 0 8 0
ffsino 288 6228 0 4714 109 0 109 109 0 8 0
nchpl 144 9862 0 9300 63 38 25 63 0 8 0
rtmask 32 27 0 27 4 3 1 1 0 8 1
uvmvnodes 80 3125 0 0 64 0 64 64 0 8 0
vnodes 216 3125 0 0 174 0 174 174 0 8 0
namei 1024 25629 0 25629 2 1 1 1 0 8 1
percpumem 16 190 0 146 1 0 1 1 0 8 0
kstatmem 264 182 0 164 3 1 2 3 0 8 0
acpiwqpl 32 1 0 1 1 0 1 1 1 8 1
scsiplug 72 12 0 12 8 8 0 1 0 8 0
scxspl 216 32165 0 32164 12 11 1 8 1 8 0
plimitpl 152 183 0 166 1 0 1 1 0 8 0
sigapl 424 3614 0 3565 8 2 6 7 0 8 0
knotepl 120 562 0 0 16 0 16 16 0 8 0
kqueuepl 224 414 0 405 2 1 1 2 0 8 0
pipepl 336 188 0 161 4 1 3 3 0 8 0
fdescpl 520 3588 0 3559 3 0 3 3 0 8 0
filepl 160 10228 0 10010 10 0 10 10 0 8 0
lockfpl 104 523 0 521 1 0 1 1 0 8 0
lockfspl 48 226 0 224 1 0 1 1 0 8 0
sessionpl 144 31 0 22 1 0 1 1 0 8 0
pgrppl 48 57 0 40 1 0 1 1 0 8 0
ucredpl 104 1304 0 1290 1 0 1 1 0 8 0
zombiepl 144 4462 0 4461 3 2 1 1 0 8 0
processpl 1240 3614 0 3565 6 1 5 5 0 8 0
procpl 656 7651 0 7594 7 1 6 6 0 8 0
srpgc 96 29 0 29 7 7 0 1 0 8 0
sosppl 168 40 0 40 4 4 0 1 0 8 0
sockpl 728 2110 0 2079 7 3 4 5 0 8 0
mcl64k 65536 5 0 0 1 0 1 1 0 8 0
mcl16k 16384 3 0 0 1 0 1 1 0 8 0
mcl12k 12288 5 0 0 1 0 1 1 0 8 0
mcl9k 9216 6 0 0 1 0 1 1 0 8 0
mcl8k 8192 13 0 0 2 0 2 2 0 8 0
mcl4k 4096 109 0 0 14 0 14 14 0 8 0
mcl2k2 2112 2 0 0 1 0 1 1 0 8 0
mcl2k 2048 15 0 0 2 0 2 2 0 8 0
mtagpl 96 53 0 0 2 0 2 2 0 8 0
mbufpl 256 1191 0 0 74 0 74 74 0 8 0
bufpl 280 9381 0 3239 439 0 439 439 0 8 0
anonpl 32 10641 0 0 86 0 86 86 0 246 0
amapchunkpl 152 97237 0 96793 51 28 23 30 0 158 0
amappl16 200 6564 0 6528 54 51 3 25 0 8 0
amappl15 192 11 0 11 2 2 0 1 0 8 0
amappl14 184 128 0 116 1 0 1 1 0 8 0
amappl13 176 6 0 6 1 1 0 1 0 8 0
amappl12 168 4309 0 4282 3 1 2 2 0 8 0
amappl11 160 52 0 38 1 0 1 1 0 8 0
amappl10 152 17 0 15 2 1 1 1 0 8 0
amappl9 144 314 0 314 2 2 0 1 0 8 0
amappl8 136 58 0 55 1 0 1 1 0 8 0
amappl7 128 121 0 109 1 0 1 1 0 8 0
amappl6 120 216 0 213 2 1 1 1 0 8 0
amappl5 112 150 0 140 1 0 1 1 0 8 0
amappl4 104 339 0 319 1 0 1 1 0 8 0
amappl3 96 21676 0 21583 5 1 4 4 0 8 0
amappl2 88 708 0 645 2 0 2 2 0 8 0
amappl1 80 22177 0 21591 16 2 14 14 0 8 0
amappl 88 27772 0 27622 6 1 5 5 0 92 0
dma65536 65536 1 0 1 1 1 0 1 0 8 0
dma16384 16384 1 0 1 1 1 0 1 0 8 0
dma4096 4096 2 0 2 2 2 0 1 0 8 0
dma1024 1024 2 0 1 1 0 1 1 0 8 0
dma512 512 1 0 1 1 1 0 1 0 8 0
dma256 256 7 0 7 2 2 0 1 0 8 0
dma128 128 259 0 259 6 6 0 1 0 8 0
dma64 64 8 0 8 3 3 0 1 0 8 0
dma32 32 7 0 7 1 1 0 1 0 8 0
dma16 16 19 0 18 1 0 1 1 0 8 0
aobjpl 72 39 0 4 1 0 1 1 0 8 0
uaddrrnd 24 3588 0 3559 1 0 1 1 0 8 0
uaddrbest 32 2 0 0 1 0 1 1 0 8 0
uaddr 24 3588 0 3559 1 0 1 1 0 8 0
vmmpekpl 168 24800 0 24744 3 0 3 3 0 8 0
vmmpepl 168 214039 0 212206 123 32 91 106 0 357 0
vmsppl 480 3587 0 3559 7 3 4 5 0 8 0
rwobjpl 72 50663 0 46576 85 9 76 79 0 8 0
pdppl 4096 7183 0 7118 115 44 71 85 0 8 6
pvpl 32 18731 0 0 153 2 151 151 0 265 0
pmappl 256 3587 0 3559 4 1 3 3 0 8 0
extentpl 40 45 0 27 1 0 1 1 0 8 0
phpool 112 472 0 77 12 0 12 12 0 8 0
ddb{0}> machine ddbcpu 0
Invalid cpu 0
ddb{0}> trace
db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438
panic(ffffffff83466a0b) at panic+0x1e5 sys/kern/subr_prf.c:198
__assert(ffffffff83413bf2,ffffffff8335262f,132,ffffffff833f1155) at __assert+0x29 sys/kern/subr_prf.c:-1
kcovopen(113d4,1,2000,ffff8000fffe27e0) at kcovopen+0x14f kd_lookup sys/dev/kcov.c:478 [inline]
kcovopen(113d4,1,2000,ffff8000fffe27e0) at kcovopen+0x14f sys/dev/kcov.c:306
spec_open_clone(ffff80002a30feb8) at spec_open_clone+0x287 sys/kern/spec_vnops.c:722
spec_open(ffff80002a30feb8) at spec_open+0x329 sys/kern/spec_vnops.c:148
VOP_OPEN(fffffd8072b13018,1,fffffd80097fb7b8,ffff8000fffe27e0) at VOP_OPEN+0x8b sys/kern/vfs_vops.c:138
vn_open(ffff80002a310108,1,0) at vn_open+0x708 sys/kern/vfs_vnops.c:177
doopenat(ffff8000fffe27e0,ffffff9c,200000000080,0,0,ffff80002a3102b0) at doopenat+0x32e sys/kern/vfs_syscalls.c:1137
syscall(ffff80002a310360) at syscall+0xbc6 mi_syscall sys/sys/syscall_mi.h:176 [inline]
syscall(ffff80002a310360) at syscall+0xbc6 sys/arch/amd64/amd64/trap.c:579
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x8b923d4abb0, count: -11
ddb{0}> machine ddbcpu 1