panic: kernel diagnostic assertion "refs != ~0" failed: file "/syzkaller/managers/multicore/kernel/sys/kern/kern_synch.c", line 953 Stopped at db_enter+37: addq $8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *310040 9668 0 0 0x4000000 0K syz-executor db_enter() at db_enter+37 panic(ffffffff83392c3a) at panic+485 __assert(ffffffff833d22c8,ffffffff833e4762,3b9,ffffffff8340e361) at __assert+41 refcnt_finalize(ffff80003c42ef10,ffffffff83388d71) at refcnt_finalize+475 pppx_if_destroy(ffff80002a3d4000,ffff80003c42ef08) at pppx_if_destroy+61 pppxclose(285b9a,41,2000,ffff80003c4e3a28) at pppxclose+160 spec_close(ffff80003c4e95e0) at spec_close+1047 VOP_CLOSE(fffffd807741a138,41,fffffd80097fb4e0,ffff80003c4e3a28) at VOP_CLOSE+306 vn_closefile(fffffd8066c9a438,ffff80003c4e3a28) at vn_closefile+299 fdrop(fffffd8066c9a438,ffff80003c4e3a28) at fdrop+289 closef(fffffd8066c9a438,ffff80003c4e3a28) at closef+402 syscall(ffff80003c4e9840) at syscall+3028 Xsyscall() at Xsyscall+296 end of kernel end trace frame: 0xc0836054f0, count: 2 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 "refs != ~0" failed: file "/syzkaller/managers/multicore/kernel/sys/kern/kern_synch.c", line 953 ddb{0}> trace db_enter() at db_enter+37 panic(ffffffff83392c3a) at panic+485 __assert(ffffffff833d22c8,ffffffff833e4762,3b9,ffffffff8340e361) at __assert+41 refcnt_finalize(ffff80003c42ef10,ffffffff83388d71) at refcnt_finalize+475 pppx_if_destroy(ffff80002a3d4000,ffff80003c42ef08) at pppx_if_destroy+61 pppxclose(285b9a,41,2000,ffff80003c4e3a28) at pppxclose+160 spec_close(ffff80003c4e95e0) at spec_close+1047 VOP_CLOSE(fffffd807741a138,41,fffffd80097fb4e0,ffff80003c4e3a28) at VOP_CLOSE+306 vn_closefile(fffffd8066c9a438,ffff80003c4e3a28) at vn_closefile+299 fdrop(fffffd8066c9a438,ffff80003c4e3a28) at fdrop+289 closef(fffffd8066c9a438,ffff80003c4e3a28) at closef+402 syscall(ffff80003c4e9840) at syscall+3028 Xsyscall() at Xsyscall+296 end of kernel end trace frame: 0xc0836054f0, count: -13 ddb{0}> show registers rdi 0 rsi 1 rbp 18446603337232978864 rbx 18446744071620808159 cpu_info_full_primary+11743 rdx 18446603336242530304 rcx 18446603337232955944 rax 18446744071620804592 cpu_info_full_primary+8176 r8 72340172838076673 r9 9259542123273814144 r10 15630269775690537534 r11 15534733331059784324 r12 18446744071620807648 cpu_info_full_primary+11232 r13 0 r14 0 r15 1 rip 18446744071596580773 db_enter+37 cs 8 rflags 582 rsp 18446603337232978848 ss 16 db_enter+37: addq $8,%rsp ddb{0}> show proc PROC (syz-executor) tid=310040 pid=9668 tcnt=3 stat=onproc flags process=0 proc=4000000 runpri=32, usrpri=50, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80003c4e22d0,0xffff8000ffffc7e0 process=0xffff80003c4bd838 user=0xffff80003c4e4000, vmspace=0xfffffd806c1047c0 estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 9668 184212 49359 0 2 0 syz-executor * 9668 310040 49359 0 7 0x4000000 syz-executor 9668 295002 49359 0 2 0x4000000 syz-executor 97339 238732 36992 60929 2 0x10 syz-executor 97339 340743 36992 60929 3 0x4000090 fsleep syz-executor 97339 131501 36992 60929 3 0x4000090 fsleep syz-executor 97339 296766 36992 60929 3 0x4000090 fsleep syz-executor 43405 178056 82207 0 2 0xc80 syz-executor 43405 329308 82207 0 3 0x4000080 kqread syz-executor 43405 174721 82207 0 3 0x4000080 fsleep syz-executor 75757 361098 0 0 3 0x14200 acct acct 24621 425627 47202 0 3 0x82 wait syz-executor 90922 487686 1 0 3 0x80 nanoslp init 16494 511340 0 0 3 0x14280 nfsidl nfsio 84113 505207 0 0 3 0x14280 nfsidl nfsio 1265 298202 0 0 3 0x14280 nfsidl nfsio 8803 135126 0 0 3 0x14280 nfsidl nfsio 9060 484184 0 0 3 0x14280 nfsidl nfsio 449 495262 0 0 3 0x14280 nfsidl nfsio 33711 2008 0 0 3 0x14280 nfsidl nfsio 4870 35689 0 0 3 0x14280 nfsidl nfsio 20149 299935 0 0 3 0x14280 nfsidl nfsio 40146 6592 0 0 3 0x14280 nfsidl nfsio 34581 419265 0 0 3 0x14280 nfsidl nfsio 74859 393908 0 0 3 0x14280 nfsidl nfsio 55103 275569 0 0 3 0x14280 nfsidl nfsio 5169 401087 0 0 3 0x14280 nfsidl nfsio 25199 9329 0 0 3 0x14280 nfsidl nfsio 86022 472226 0 0 3 0x14280 nfsidl nfsio 71794 503941 0 0 3 0x14280 nfsidl nfsio 19270 134901 0 0 3 0x14280 nfsidl nfsio 3797 445171 0 0 3 0x14280 nfsidl nfsio 68707 435328 0 0 3 0x14280 nfsidl nfsio 57494 369503 47202 0 2 0x10000002 syz-executor 36992 289725 47202 0 2 0xc82 syz-executor 21967 22463 47202 0 2 0xc82 syz-executor 68557 25307 47202 0 2 0xc82 syz-executor 82207 197489 47202 0 2 0xc82 syz-executor 17808 93666 47202 0 2 0x2 syz-executor 49359 494723 47202 0 2 0xc82 syz-executor 47202 263247 16099 0 2 0x2 syz-executor 16099 8902 40936 0 3 0x10008a sigsusp ksh 40936 341508 45755 0 3 0x98 kqread sshd-session 45755 103255 17707 0 3 0x92 kqread sshd-session 17707 367939 1 0 3 0x88 kqread sshd 74103 418506 7673 74 3 0x1100092 bpf pflogd 7673 204950 1 0 3 0x80 sbwait pflogd 79155 386519 32047 73 3 0x1100090 kqread syslogd 32047 396767 1 0 3 0x100082 sbwait syslogd 72972 455767 1 0 3 0x100080 kqread resolvd 48428 503629 77234 77 2 0x100012 dhcpleased 27839 306828 77234 77 3 0x100092 kqread dhcpleased 77234 304550 1 0 3 0x80 kqread dhcpleased 39924 121171 0 0 3 0x14200 bored smr 90614 310455 0 0 2 0x14200 zerothread 99828 164005 0 0 3 0x14200 aiodoned aiodoned 63634 106078 0 0 3 0x14200 syncer update 95847 516512 0 0 3 0x14200 cleaner cleaner 98532 415746 0 0 3 0x14200 reaper reaper 20818 50121 0 0 3 0x14200 pgdaemon pagedaemon 30622 68412 0 0 3 0x14200 bored viomb 6704 64145 0 0 3 0x40014200 acpi0 acpi0 28546 232349 0 0 7 0x40014200 idle1 89505 356624 0 0 3 0x14200 bored softnet1 38951 65784 0 0 3 0x14200 bored softnet0 40834 270410 0 0 3 0x14200 smrbar systqmp 37230 16233 0 0 3 0x14200 bored systq 23689 361230 0 0 3 0x14200 tmoslp softclockmp 72207 211924 0 0 3 0x40014200 tmoslp softclock 39327 379657 0 0 3 0x40014200 idle0 1 80202 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 9668 (syz-executor) thread 0xffff80003c4e3a28 (310040) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff838af678) #0 witness_lock+1521 #1 __mp_acquire_count+88 #2 sleep_finish+728 #3 msleep_nsec+306 #4 taskq_do_barrier+659 #5 ifiq_destroy+218 #6 if_detach+2102 #7 pppx_if_destroy+145 #8 pppxclose+160 #9 spec_close+1047 #10 VOP_CLOSE+306 #11 vn_closefile+299 #12 fdrop+289 #13 closef+402 #14 syscall+3028 #15 Xsyscall+296 Process 17808 (syz-executor) thread 0xffff8000ffffdc90 (93666) exclusive rrwlock inode r = 0 (0xfffffd806e0cb358) #0 witness_lock+1521 #1 rw_do_enter_write+1049 #2 rrw_enter+198 #3 VOP_LOCK+163 #4 vn_lock+164 #5 vget+674 #6 ufs_ihashget+389 #7 ffs_vget+140 #8 ufs_lookup+6710 #9 VOP_LOOKUP+110 #10 vfs_lookup+2362 #11 namei+1994 #12 dounlinkat+193 #13 syscall+2839 #14 Xsyscall+296 exclusive rrwlock inode r = 0 (0xfffffd806d05e1f8) #0 witness_lock+1521 #1 rw_do_enter_write+1049 #2 rrw_enter+198 #3 VOP_LOCK+163 #4 vn_lock+164 #5 vfs_lookup+284 #6 namei+1994 #7 dounlinkat+193 #8 syscall+2839 #9 Xsyscall+296 Process 40834 (systqmp) thread 0xffff8000ffffe7c8 (270410) shared rwlock systqmp r = 0 (0xffffffff8387ef18) #0 witness_lock+1521 #1 taskq_thread+298 #2 proc_trampoline+16 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10214 11033K 11902K 166960K 12568 0 pcb 18 18K 20K 166960K 550 0 rtable 208 9K 10K 166960K 527 0 pf 38 18K 20K 166960K 117 0 ifaddr 38 6K 7K 166960K 96 0 ifgroup 55 2K 2K 166960K 129 0 sysctl 4 1K 9K 166960K 15 0 counters 70 37K 38K 166960K 318 0 ioctlops 0 0K 4K 166960K 1864 0 iov 0 0K 28K 166960K 59 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1429 90K 90K 166960K 2157 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 9 0 VM map 2 1K 1K 166960K 2 0 sem 12 0K 0K 166960K 32 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1692 195K 286K 166960K 12470 0 file desc 16 57K 240K 166960K 1042 0 sigio 0 0K 0K 166960K 31 0 proc 66 115K 180K 166960K 650 0 subproc 72 4K 4K 166960K 81 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 178 0 in_multi 80 6K 7K 166960K 197 0 ether_multi 1 0K 0K 166960K 5 0 mrt 0 0K 0K 166960K 5 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 115 519K 519K 166960K 115 0 exec 0 0K 1K 166960K 501 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 253 156K 178K 166960K 11181 0 UVM aobj 77 3K 3K 166960K 77 0 pinsyscall 40 80K 104K 166960K 2195 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 174 0 NDP 13 0K 2K 166960K 68 0 temp 68 8654K 8725K 166960K 85166 0 kqueue 15 24K 30K 166960K 196 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 207 0 204 3 2 1 3 0 8 0 rtentry 176 164 0 80 6 0 6 6 0 8 0 unpcb 144 1065 0 1047 8 4 4 6 0 8 3 syncache 336 9 0 9 1 0 1 1 0 8 1 tcpqe 32 1 0 1 1 1 0 1 0 8 0 tcpcb 736 322 0 317 5 1 4 4 0 8 3 arp 136 21 0 2 1 0 1 1 0 8 0 inpcb 328 1709 0 1700 21 14 7 12 0 8 5 nd6 152 37 0 23 1 0 1 1 0 8 0 pkpcb 40 7 0 7 3 2 1 1 0 8 1 kcovpl 48 9 0 1 1 0 1 1 0 8 0 ppxss 1192 120 0 119 1 0 1 1 0 8 0 pppxif 1504 5 0 4 2 1 1 1 0 8 0 pffrag 232 15 0 9 1 0 1 1 0 482 0 pffrnode 88 14 0 8 1 0 1 1 0 8 0 pffrent 40 59 0 53 1 0 1 1 0 8 0 pfosfp 40 1428 0 1005 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 72 0 24 1 0 1 1 0 8 0 pfstkey 128 75 0 29 2 0 2 2 0 8 0 pfstate 384 74 0 27 6 0 6 6 0 8 0 pfrule 1344 22 0 16 2 1 1 2 0 8 0 rttmr 136 1 0 1 1 1 0 1 0 8 0 art_heap8 4096 2 0 0 2 0 2 2 0 8 0 art_heap4 256 747 0 370 29 3 26 29 0 8 0 art_table 40 749 0 370 5 0 5 5 0 8 0 art_node 32 163 0 83 1 0 1 1 0 8 0 sysvmsgpl 40 13 0 6 1 0 1 1 0 8 0 semupl 112 2 0 2 2 2 0 1 0 8 0 semapl 112 29 0 19 1 0 1 1 0 8 0 shmpl 112 74 0 0 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 3192 0 1686 96 0 96 96 0 8 0 ffsino 296 3192 0 1686 118 0 118 118 0 8 0 nchpl 144 4632 0 2928 64 0 64 64 0 8 0 rtmask 32 16 0 16 2 1 1 1 0 8 1 vnodes 216 3747 0 0 209 0 209 209 0 8 0 namei 1024 15582 0 15582 2 1 1 2 0 8 1 percpumem 16 174 0 124 1 0 1 1 0 8 0 kstatmem 264 88 0 62 4 1 3 3 0 8 1 acpiwqpl 32 2 0 2 1 0 1 1 1 8 1 scsiplug 72 5 0 5 2 1 1 1 0 8 1 scxspl 216 20997 0 20997 10 8 2 8 1 8 2 plimitpl 152 299 0 281 1 0 1 1 0 8 0 sigapl 424 1350 0 1282 8 0 8 8 0 8 0 knotepl 120 527 0 0 16 0 16 16 0 8 0 kqueuepl 224 469 0 457 5 4 1 5 0 8 0 pipepl 344 273 0 246 9 6 3 9 0 8 0 fdescpl 528 1313 0 1283 3 0 3 3 0 8 0 filepl 160 9391 0 9170 19 6 13 19 0 8 1 lockfpl 104 387 0 385 2 0 2 2 0 8 1 lockfspl 48 136 0 134 1 0 1 1 0 8 0 sessionpl 144 29 0 21 1 0 1 1 0 8 0 pgrppl 48 115 0 99 1 0 1 1 0 8 0 ucredpl 104 1245 0 1231 1 0 1 1 0 8 0 zombiepl 144 1286 0 1282 1 0 1 1 0 8 0 processpl 1232 1350 0 1282 6 0 6 6 0 8 0 procpl 664 2640 0 2565 8 0 8 8 0 8 0 sosppl 176 9 0 9 2 1 1 1 0 8 1 sockpl 752 3021 0 2991 44 33 11 20 0 8 7 mcl64k 65536 13 0 0 2 0 2 2 0 8 0 mcl16k 16384 8 0 0 1 0 1 1 0 8 0 mcl12k 12288 3 0 0 1 0 1 1 0 8 0 mcl9k 9216 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 112 0 0 14 0 14 14 0 8 0 mcl2k 2048 22 0 0 3 0 3 3 0 8 0 mtagpl 96 2 0 0 1 0 1 1 0 8 0 mbufpl 256 1846 0 0 116 0 116 116 0 8 0 bufpl 280 7431 0 1294 439 0 439 439 0 8 0 anonpl 32 20247 0 0 164 0 164 164 0 246 0 amapchunkpl 152 36442 0 35824 34 2 32 34 0 158 2 amappl16 200 4854 0 4285 47 4 43 43 0 8 0 amappl15 192 6 0 6 1 1 0 1 0 8 0 amappl14 184 6 0 5 2 1 1 1 0 8 0 amappl13 176 438 0 437 1 0 1 1 0 8 0 amappl12 168 1692 0 1653 3 0 3 3 0 8 0 amappl11 160 10 0 10 2 1 1 1 0 8 1 amappl10 152 108 0 94 1 0 1 1 0 8 0 amappl9 144 249 0 248 1 0 1 1 0 8 0 amappl8 136 26 0 23 1 0 1 1 0 8 0 amappl7 128 104 0 103 1 0 1 1 0 8 0 amappl6 120 314 0 300 1 0 1 1 0 8 0 amappl5 112 97 0 86 1 0 1 1 0 8 0 amappl4 104 461 0 434 1 0 1 1 0 8 0 amappl3 96 6296 0 6201 4 1 3 3 0 8 0 amappl2 88 1448 0 1374 2 0 2 2 0 8 0 amappl1 80 13823 0 13259 14 0 14 14 0 8 0 amappl 88 10253 0 10075 5 0 5 5 0 92 0 uvmvnodes 80 3747 0 0 77 0 77 77 0 8 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma128 128 255 0 255 3 2 1 1 0 8 1 dma64 64 6 0 6 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 72 76 0 0 2 0 2 2 0 8 0 uaddrrnd 24 1313 0 1283 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1313 0 1283 1 0 1 1 0 8 0 vmmpekpl 168 12086 0 12033 3 0 3 3 0 8 0 vmmpepl 168 90425 0 88015 122 2 120 120 0 357 3 vmsppl 488 1312 0 1283 5 0 5 5 0 8 0 rwobjpl 80 30089 0 24825 108 0 108 108 0 8 0 pdppl 4096 2633 0 2566 103 32 71 85 0 8 4 pvpl 32 29108 0 0 236 1 235 235 0 265 0 pmappl 256 1312 0 1283 3 0 3 3 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 384 0 39 10 0 10 10 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+37 panic(ffffffff83392c3a) at panic+485 __assert(ffffffff833d22c8,ffffffff833e4762,3b9,ffffffff8340e361) at __assert+41 refcnt_finalize(ffff80003c42ef10,ffffffff83388d71) at refcnt_finalize+475 pppx_if_destroy(ffff80002a3d4000,ffff80003c42ef08) at pppx_if_destroy+61 pppxclose(285b9a,41,2000,ffff80003c4e3a28) at pppxclose+160 spec_close(ffff80003c4e95e0) at spec_close+1047 VOP_CLOSE(fffffd807741a138,41,fffffd80097fb4e0,ffff80003c4e3a28) at VOP_CLOSE+306 vn_closefile(fffffd8066c9a438,ffff80003c4e3a28) at vn_closefile+299 fdrop(fffffd8066c9a438,ffff80003c4e3a28) at fdrop+289 closef(fffffd8066c9a438,ffff80003c4e3a28) at closef+402 syscall(ffff80003c4e9840) at syscall+3028 Xsyscall() at Xsyscall+296 end of kernel end trace frame: 0xc0836054f0, count: -13 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+39: addq $8,%rsp x86_ipi_db(ffff8000299edff0) at x86_ipi_db+39 x86_ipi_handler() at x86_ipi_handler+217 Xresume_lapic_ipi() at Xresume_lapic_ipi+39 acpicpu_idle() at acpicpu_idle+1111 sched_idle(ffff8000299edff0) at sched_idle+913 end trace frame: 0x0, count: 10 ddb{1}> trace x86_ipi_db(ffff8000299edff0) at x86_ipi_db+39 x86_ipi_handler() at x86_ipi_handler+217 Xresume_lapic_ipi() at Xresume_lapic_ipi+39 acpicpu_idle() at acpicpu_idle+1111 sched_idle(ffff8000299edff0) at sched_idle+913 end trace frame: 0x0, count: -5