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 db_enter() at db_enter+37 panic(ffffffff833943a7) at panic+485 __assert(ffffffff833d16ba,ffffffff833e4470,3b9,ffffffff8340e057) at __assert+41 refcnt_finalize(ffff80003c46a370,ffffffff83384e88) at refcnt_finalize+475 pppx_if_destroy(0,ffff80003c46a368) at pppx_if_destroy+61 pppxclose(285b9a,41,2000,ffff80002ffda7f0) at pppxclose+160 spec_close(ffff80002a2d86f0) at spec_close+1047 VOP_CLOSE(fffffd8066e35378,41,fffffd80097fb618,ffff80002ffda7f0) at VOP_CLOSE+306 vn_closefile(fffffd805b5ad9f0,ffff80002ffda7f0) at vn_closefile+299 fdrop(fffffd805b5ad9f0,ffff80002ffda7f0) at fdrop+289 closef(fffffd805b5ad9f0,ffff80002ffda7f0) at closef+402 fdfree(ffff80002ffda7f0) at fdfree+278 exit1(ffff80002ffda7f0,0,0,1) at exit1+1398 sys_exit(ffff80002ffda7f0,ffff80002a2d8a60,ffff80002a2d89b0) at sys_exit+26 end trace frame: 0xffff80002a2d8a50, count: 0 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(ffffffff833943a7) at panic+485 __assert(ffffffff833d16ba,ffffffff833e4470,3b9,ffffffff8340e057) at __assert+41 refcnt_finalize(ffff80003c46a370,ffffffff83384e88) at refcnt_finalize+475 pppx_if_destroy(0,ffff80003c46a368) at pppx_if_destroy+61 pppxclose(285b9a,41,2000,ffff80002ffda7f0) at pppxclose+160 spec_close(ffff80002a2d86f0) at spec_close+1047 VOP_CLOSE(fffffd8066e35378,41,fffffd80097fb618,ffff80002ffda7f0) at VOP_CLOSE+306 vn_closefile(fffffd805b5ad9f0,ffff80002ffda7f0) at vn_closefile+299 fdrop(fffffd805b5ad9f0,ffff80002ffda7f0) at fdrop+289 closef(fffffd805b5ad9f0,ffff80002ffda7f0) at closef+402 fdfree(ffff80002ffda7f0) at fdfree+278 exit1(ffff80002ffda7f0,0,0,1) at exit1+1398 sys_exit(ffff80002ffda7f0,ffff80002a2d8a60,ffff80002a2d89b0) at sys_exit+26 syscall(ffff80002a2d8a60) at syscall+2839 Xsyscall() at Xsyscall+296 end of kernel end trace frame: 0x7baef1a88de0, count: -16 ddb{0}> show registers rdi 0 rsi 1 rbp 18446603336928822464 rbx 18446744071621283295 cpu_info_full_primary+11743 rdx 0 rcx 18446603337026349040 rax 18446744071621279728 cpu_info_full_primary+8176 r8 72340172838076673 r9 9259542123273814144 r10 9283782564312478313 r11 16931942814333559220 r12 18446744071621282784 cpu_info_full_primary+11232 r13 0 r14 0 r15 1 rip 18446744071579008149 db_enter+37 cs 8 rflags 582 rsp 18446603336928822448 ss 16 db_enter+37: addq $8,%rsp ddb{0}> show proc PROC (syz-executor) tid=205864 pid=23172 tcnt=0 stat=onproc flags process=1008 proc=2000 runpri=32, usrpri=86, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0xffff80002ffda7f0 scnt=-1 ecnt=1 forw=0xffffffffffffffff, list=0xffff80002ffdad20,0xffff8000fffee028 process=0xffff80002a3cdcf8 user=0xffff80002a2d3000, vmspace=0xfffffd806c1fc7c0 estcpu=36, cpticks=4, pctcpu=0.0, user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 90208 250363 85734 0 2 0 syz-executor 90208 101233 85734 0 2 0x4000000 syz-executor 88780 175209 18018 0 2 0 syz-executor 65488 306367 98370 0 2 0xc80 syz-executor 65488 443749 98370 0 2 0x4000000 syz-executor 66698 281810 6262 0 2 0 syz-executor 66698 187399 6262 0 3 0x4000080 fsleep syz-executor 66698 381161 6262 0 2 0x4000000 syz-executor 44297 281575 35814 0 2 0x400000 syz-executor 44297 392042 35814 0 2 0x4400000 syz-executor 44297 443350 35814 0 2 0x4400000 syz-executor 19824 179875 40121 0 2 0 syz-executor 19824 241874 40121 0 3 0x4000080 fsleep syz-executor 6262 441905 40033 0 2 0xc82 syz-executor 83847 155417 1 0 3 0x100083 ttyin getty 53263 292856 0 0 3 0x14200 acct acct 71279 300444 40033 0 2 0xc82 syz-executor 18018 205703 40033 0 2 0x2 syz-executor 3192 376402 40033 0 2 0x2 syz-executor 98370 444858 40033 0 2 0xc82 syz-executor 35814 9677 40033 0 2 0xc82 syz-executor 93427 412154 97356 0 3 0x100082 sbwait arp 97356 57327 1 0 3 0x10008a sigsusp sh 40121 347555 40033 0 2 0xc82 syz-executor 85734 474125 40033 0 2 0xc82 syz-executor 40033 361083 74114 0 3 0x82 kqread syz-executor 74114 270790 75028 0 3 0x10008a sigsusp ksh 75028 492388 95880 0 3 0x98 kqread sshd-session 95880 351391 71986 0 3 0x92 kqread sshd-session 71986 419527 1 0 3 0x88 kqread sshd 10980 352992 8766 74 3 0x1100092 bpf pflogd 8766 292914 1 0 3 0x80 sbwait pflogd 87093 202637 42411 73 3 0x1100090 kqread syslogd 42411 403342 1 0 3 0x100082 sbwait syslogd 3079 249224 1 0 3 0x100080 kqread resolvd 34614 242440 44238 77 2 0x100012 dhcpleased 30525 480041 44238 77 3 0x100092 kqread dhcpleased 44238 453502 1 0 3 0x80 kqread dhcpleased 51171 145021 0 0 3 0x14200 bored smr 94371 314739 0 0 2 0x14200 zerothread 98429 250403 0 0 3 0x14200 aiodoned aiodoned 57109 165176 0 0 3 0x14200 syncer update 17769 500243 0 0 3 0x14200 cleaner cleaner 71315 77437 0 0 3 0x14200 reaper reaper 58568 336047 0 0 3 0x14200 pgdaemon pagedaemon 78620 482083 0 0 3 0x14200 bored viomb 27772 117068 0 0 3 0x40014200 acpi0 acpi0 47401 516326 0 0 7 0x40014200 idle1 79947 12809 0 0 3 0x14200 bored softnet1 81911 497373 0 0 2 0x14200 softnet0 31933 182203 0 0 3 0x14200 smrbar systqmp 40977 62191 0 0 3 0x14200 syncxs systq 95371 307999 0 0 3 0x14200 tmoslp softclockmp 81605 361726 0 0 3 0x40014200 tmoslp softclock 30767 45576 0 0 3 0x40014200 idle0 1 236407 0 0 3 0x82 wait init 0 0 -1 0 3 0x10010200 scheduler swapper ddb{0}> show all locks Process 81911 (softnet0) thread 0xffff8000ffffe000 (497373) Process 31933 (systqmp) thread 0xffff8000ffffe298 (182203) Process 40977 (systq) thread 0xffff8000ffffe530 (62191) ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10245 11040K 12105K 166960K 13995 0 pcb 17 16K 18K 166960K 708 0 rtable 219 13K 13K 166960K 841 0 pf 41 19K 67486K 166960K 296 0 ifaddr 38 7K 7K 166960K 198 0 ifgroup 62 2K 3K 166960K 378 0 sysctl 4 1K 9K 166960K 21 0 counters 72 37K 38K 166960K 374 0 ioctlops 0 0K 4K 166960K 2477 0 iov 0 0K 24K 166960K 130 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1447 91K 91K 166960K 3640 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 9K 166960K 33 0 VM map 2 1K 1K 166960K 2 0 sem 27 21K 21K 166960K 74 0 dirhash 12 2K 2K 166960K 60 0 ACPI 1692 195K 286K 166960K 12470 0 file desc 19 69K 248K 166960K 2573 0 sigio 0 0K 0K 166960K 253 0 proc 76 131K 163K 166960K 978 0 subproc 81 5K 5K 166960K 144 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 1 0K 0K 166960K 433 0 in_multi 67 5K 6K 166960K 283 0 ether_multi 1 0K 0K 166960K 42 0 mrt 33 2K 2K 166960K 63 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 247 1102K 1102K 166960K 247 0 exec 0 0K 1K 166960K 912 0 fusefs mount 1 32K 32K 166960K 1 0 pfkey data 0 0K 0K 166960K 5 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 248 162K 189K 166960K 24761 0 UVM aobj 37 6K 6K 166960K 39 0 pinsyscall 45 90K 105K 166960K 3855 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 1K 166960K 169 0 NDP 13 0K 1K 166960K 137 0 temp 83 8660K 8909K 166960K 136956 0 kqueue 16 22K 30K 166960K 474 0 SYN cache 2 8K 16K 166960K 3 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle vscsiccb 40 1 0 0 2 1 1 1 0 8 0 plcache 128 26 0 0 1 0 1 1 0 8 0 rtpcb 120 374 0 370 4 3 1 3 0 8 0 rtentry 176 261 0 184 5 0 5 5 0 8 0 unpcb 144 1670 0 1652 15 14 1 4 0 8 0 syncache 336 10 0 10 4 4 0 1 0 8 0 tcpqe 32 3 0 3 3 3 0 1 0 8 0 tcpcb 736 944 0 939 25 24 1 10 0 8 0 arp 136 40 0 25 1 0 1 1 0 8 0 inpcb 328 3347 0 3338 37 35 2 10 0 8 0 nd6 152 47 0 28 1 0 1 1 0 8 0 pkpcb 40 23 0 23 6 6 0 1 0 8 0 kcovpl 48 16 0 7 1 0 1 1 0 8 0 mppekey 1024 1 0 1 1 1 0 1 0 8 0 ppxss 1192 104 0 103 4 3 1 1 0 8 0 pppxif 1504 20 0 19 6 5 1 1 0 8 0 pfstscr 40 1 0 1 1 1 0 1 0 8 0 pffrag 232 23 0 12 1 0 1 1 0 482 0 pffrnode 88 21 0 10 1 0 1 1 0 8 0 pffrent 40 39 0 27 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 pfrktable 1344 4 0 4 3 3 0 1 0 8 0 pfstitem 24 143 0 82 1 0 1 1 0 8 0 pfstkey 128 145 0 84 3 0 3 3 0 8 0 pfstate 384 144 0 83 7 0 7 7 0 8 0 pfrule 1344 58 0 52 2 1 1 2 0 8 0 rttmr 136 2 0 2 2 2 0 1 0 8 0 art_heap8 4096 6 0 2 6 2 4 5 0 8 0 art_heap4 256 1177 0 840 32 9 23 28 0 8 0 art_table 40 1183 0 842 5 0 5 5 0 8 0 art_node 32 258 0 189 1 0 1 1 0 8 0 sysvmsgpl 40 17 0 6 3 2 1 1 0 8 0 semupl 112 2 0 2 2 2 0 1 0 8 0 semapl 112 66 0 41 1 0 1 1 0 8 0 shmpl 112 36 0 2 1 0 1 1 0 8 0 dirhash 1024 49 0 32 3 0 3 3 0 8 0 dino2pl 256 6442 0 4920 96 0 96 96 0 8 0 ffsino 296 6442 0 4920 119 1 118 118 0 8 0 nchpl 144 9987 0 8258 65 0 65 65 0 8 0 rtmask 32 23 0 23 7 7 0 1 0 8 0 vnodes 216 5926 0 0 330 0 330 330 0 8 0 namei 1024 36295 0 36295 5 4 1 2 0 8 1 percpumem 16 202 0 151 1 0 1 1 0 8 0 kstatmem 264 222 0 190 5 2 3 3 0 8 0 acpiwqpl 32 2 0 2 1 0 1 1 1 8 1 scsiplug 72 8 0 8 5 5 0 1 0 8 0 scxspl 216 64421 0 64420 13 12 1 8 1 8 0 plimitpl 152 581 0 562 1 0 1 1 0 8 0 sigapl 424 2841 0 2791 7 1 6 7 0 8 0 knotepl 120 630 0 0 18 0 18 18 0 8 0 kqueuepl 224 1228 0 1215 12 11 1 5 0 8 0 pipepl 344 675 0 645 19 15 4 9 0 8 0 fdescpl 528 2815 0 2782 3 0 3 3 0 8 0 filepl 160 21369 0 21130 42 30 12 19 0 8 0 lockfpl 104 1497 0 1487 5 4 1 3 0 8 0 lockfspl 48 453 0 444 1 0 1 1 0 8 0 sessionpl 144 34 0 25 1 0 1 1 0 8 0 pgrppl 48 176 0 158 1 0 1 1 0 8 0 ucredpl 104 3832 0 3818 1 0 1 1 0 8 0 zombiepl 144 2999 0 2998 4 3 1 1 0 8 0 processpl 1232 2841 0 2791 5 0 5 5 0 8 0 procpl 664 6571 0 6514 7 1 6 7 0 8 0 sosppl 176 20 0 20 4 4 0 1 0 8 0 sockpl 752 5552 0 5521 53 49 4 17 0 8 0 mcl64k 65536 5 0 0 1 0 1 1 0 8 0 mcl16k 16384 6 0 0 1 0 1 1 0 8 0 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl9k 9216 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 115 0 0 15 1 14 15 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 67 0 0 6 0 6 6 0 8 0 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 1362 0 0 82 0 82 82 0 8 0 bufpl 280 24833 0 18696 439 0 439 439 0 8 0 anonpl 32 16522 0 0 133 0 133 133 0 246 0 amapchunkpl 152 85525 0 84982 60 31 29 36 0 158 0 amappl16 200 9975 0 9722 79 54 25 35 0 8 0 amappl15 192 8 0 8 2 2 0 1 0 8 0 amappl14 184 23 0 23 2 2 0 1 0 8 0 amappl13 176 508 0 506 1 0 1 1 0 8 0 amappl12 168 3228 0 3183 3 0 3 3 0 8 0 amappl11 160 5 0 5 1 1 0 1 0 8 0 amappl10 152 55 0 39 1 0 1 1 0 8 0 amappl9 144 252 0 250 1 0 1 1 0 8 0 amappl8 136 25 0 22 1 0 1 1 0 8 0 amappl7 128 107 0 105 1 0 1 1 0 8 0 amappl6 120 367 0 351 1 0 1 1 0 8 0 amappl5 112 79 0 68 1 0 1 1 0 8 0 amappl4 104 475 0 441 1 0 1 1 0 8 0 amappl3 96 14863 0 14776 6 3 3 4 0 8 0 amappl2 88 2946 0 2867 2 0 2 2 0 8 0 amappl1 80 20252 0 19627 17 3 14 15 0 8 0 amappl 88 23454 0 23289 5 0 5 5 0 92 0 uvmvnodes 80 5926 0 0 121 0 121 121 0 8 0 dma65536 65536 3 0 3 2 2 0 1 0 8 0 dma32768 32768 2 0 2 2 2 0 1 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 257 0 256 5 4 1 1 0 8 0 dma64 64 40 0 40 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 38 0 2 1 0 1 1 0 8 0 uaddrrnd 24 2815 0 2782 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2815 0 2782 1 0 1 1 0 8 0 vmmpekpl 168 21791 0 21728 4 0 4 4 0 8 0 vmmpepl 168 182530 0 180296 152 42 110 119 0 357 0 vmsppl 488 2814 0 2782 5 0 5 5 0 8 0 rwobjpl 80 53297 0 46139 157 5 152 155 0 8 0 pdppl 4096 5638 0 5564 122 46 76 86 0 8 2 pvpl 32 23767 0 0 192 0 192 192 0 265 0 pmappl 256 2814 0 2782 3 0 3 3 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 410 0 97 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(ffffffff833943a7) at panic+485 __assert(ffffffff833d16ba,ffffffff833e4470,3b9,ffffffff8340e057) at __assert+41 refcnt_finalize(ffff80003c46a370,ffffffff83384e88) at refcnt_finalize+475 pppx_if_destroy(0,ffff80003c46a368) at pppx_if_destroy+61 pppxclose(285b9a,41,2000,ffff80002ffda7f0) at pppxclose+160 spec_close(ffff80002a2d86f0) at spec_close+1047 VOP_CLOSE(fffffd8066e35378,41,fffffd80097fb618,ffff80002ffda7f0) at VOP_CLOSE+306 vn_closefile(fffffd805b5ad9f0,ffff80002ffda7f0) at vn_closefile+299 fdrop(fffffd805b5ad9f0,ffff80002ffda7f0) at fdrop+289 closef(fffffd805b5ad9f0,ffff80002ffda7f0) at closef+402 fdfree(ffff80002ffda7f0) at fdfree+278 exit1(ffff80002ffda7f0,0,0,1) at exit1+1398 sys_exit(ffff80002ffda7f0,ffff80002a2d8a60,ffff80002a2d89b0) at sys_exit+26 syscall(ffff80002a2d8a60) at syscall+2839 Xsyscall() at Xsyscall+296 end of kernel end trace frame: 0x7baef1a88de0, count: -16 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