panic: kernel diagnostic assertion "refs != ~0" failed: file "/syzkaller/managers/multicore/kernel/sys/kern/kern_synch.c", line 944 Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 441957 3301 0 0 0 1 syz-executor *121266 18965 0 0 0x4000000 0K syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff8343b582) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff833e7d34,ffffffff833f04dc,3b0,ffffffff833f0524) at __assert+0x29 refcnt_finalize(ffff80003c51b988,ffffffff8332fc97) at refcnt_finalize+0x1c8 sys/kern/kern_synch.c:945 pppx_if_destroy(ffff80002b8a3000,ffff80003c51b980) at pppx_if_destroy+0x3d sys/net/if_pppx.c:806 pppxclose(205b9a,1,2000,ffff80002a39e530) at pppxclose+0xa0 sys/net/if_pppx.c:553 spec_close(ffff80003c506840) at spec_close+0x412 VOP_CLOSE(fffffd805f5e9558,1,fffffd807f7d36e8,ffff80002a39e530) at VOP_CLOSE+0x133 sys/kern/vfs_vops.c:156 vn_closefile(fffffd806661a268,ffff80002a39e530) at vn_closefile+0x12b vn_close sys/kern/vfs_vnops.c:292 [inline] vn_closefile(fffffd806661a268,ffff80002a39e530) at vn_closefile+0x12b sys/kern/vfs_vnops.c:615 fdrop(fffffd806661a268,ffff80002a39e530) at fdrop+0x126 sys/kern/kern_descrip.c:1265 closef(fffffd806661a268,ffff80002a39e530) at closef+0x192 sys/kern/kern_descrip.c:1249 syscall(ffff80003c506aa0) at syscall+0xbc6 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c506aa0) at syscall+0xbc6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9e1611a3280, 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 944 ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff8343b582) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff833e7d34,ffffffff833f04dc,3b0,ffffffff833f0524) at __assert+0x29 refcnt_finalize(ffff80003c51b988,ffffffff8332fc97) at refcnt_finalize+0x1c8 sys/kern/kern_synch.c:945 pppx_if_destroy(ffff80002b8a3000,ffff80003c51b980) at pppx_if_destroy+0x3d sys/net/if_pppx.c:806 pppxclose(205b9a,1,2000,ffff80002a39e530) at pppxclose+0xa0 sys/net/if_pppx.c:553 spec_close(ffff80003c506840) at spec_close+0x412 VOP_CLOSE(fffffd805f5e9558,1,fffffd807f7d36e8,ffff80002a39e530) at VOP_CLOSE+0x133 sys/kern/vfs_vops.c:156 vn_closefile(fffffd806661a268,ffff80002a39e530) at vn_closefile+0x12b vn_close sys/kern/vfs_vnops.c:292 [inline] vn_closefile(fffffd806661a268,ffff80002a39e530) at vn_closefile+0x12b sys/kern/vfs_vnops.c:615 fdrop(fffffd806661a268,ffff80002a39e530) at fdrop+0x126 sys/kern/kern_descrip.c:1265 closef(fffffd806661a268,ffff80002a39e530) at closef+0x192 sys/kern/kern_descrip.c:1249 syscall(ffff80003c506aa0) at syscall+0xbc6 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c506aa0) at syscall+0xbc6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9e1611a3280, count: -13 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80003c506610 rbx 0xffffffff83884dc7 cpu_info_full_primary+0x2dc7 rdx 0xffff800001441c00 rcx 0xffff80002a39e530 rax 0xffffffff83883ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x212dee20007dca22 r11 0x164ee576db81037c r12 0xffffffff83884bc8 cpu_info_full_primary+0x2bc8 r13 0 r14 0 r15 0x1 rip 0xffffffff811241e5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80003c506600 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor) tid=121266 pid=18965 tcnt=3 stat=onproc flags process=0 proc=4000000 runpri=32, usrpri=86, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80002a39f460,0xffffffff83937048 process=0xffff80003b4c7010 user=0xffff80003c501000, vmspace=0xfffffd806bdd3ad0 estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 3301 441957 9777 0 7 0 syz-executor 3301 261432 9777 0 3 0x4000080 sbwait syz-executor 18965 276663 59421 0 2 0 syz-executor 18965 187071 59421 0 3 0x4000000 smrbar syz-executor *18965 121266 59421 0 7 0x4000000 syz-executor 97000 395735 90246 0 2 0 syz-executor 97000 316095 90246 0 3 0x4000080 msgwait syz-executor 97000 339531 90246 0 3 0x4000080 fsleep syz-executor 59656 47807 69298 0 3 0x80 nanoslp syz-executor 59656 178528 69298 0 3 0x4000080 sbwait syz-executor 59656 401231 69298 0 3 0x4000080 fsleep syz-executor 70717 314949 0 0 3 0x14200 acct acct 69298 40536 98183 0 3 0x82 nanoslp syz-executor 40645 29461 98183 0 3 0x82 wait syz-executor 9777 288411 98183 0 2 0x2 syz-executor 34012 97711 98183 0 3 0x82 piperd syz-executor 59421 30283 98183 0 3 0x82 nanoslp syz-executor 653 15028 98183 0 3 0x82 wait syz-executor 4515 97284 98183 0 3 0x82 nanoslp syz-executor 90246 234558 98183 0 3 0x82 nanoslp syz-executor 98183 130480 26727 0 2 0x2 syz-executor 26727 304516 22824 0 3 0x10008a sigsusp ksh 22824 504536 82848 0 3 0x98 kqread sshd-session 82848 468211 49377 0 3 0x92 kqread sshd-session 16546 426518 1 0 3 0x100083 ttyin getty 49377 228876 1 0 3 0x88 kqread sshd 46742 330917 90144 74 3 0x1100092 bpf pflogd 90144 220907 1 0 3 0x80 sbwait pflogd 25981 236035 7091 73 3 0x1100090 kqread syslogd 7091 177266 1 0 3 0x100082 sbwait syslogd 66647 156595 1 0 3 0x100080 kqread resolvd 61808 522298 35496 77 3 0x100092 kqread dhcpleased 25900 425999 35496 77 3 0x100092 kqread dhcpleased 35496 381205 1 0 3 0x80 kqread dhcpleased 37659 243773 0 0 2 0x40014200 smr 73002 35093 0 0 2 0x14200 zerothread 28104 348486 0 0 3 0x14200 aiodoned aiodoned 55672 50052 0 0 3 0x14200 syncer update 90536 243677 0 0 3 0x14200 cleaner cleaner 5980 276143 0 0 3 0x14200 reaper reaper 610 176723 0 0 3 0x14200 pgdaemon pagedaemon 55874 956 0 0 3 0x14200 bored viomb 429 413354 0 0 3 0x40014200 acpi0 acpi0 50507 190600 0 0 3 0x40014200 idle1 18369 518901 0 0 3 0x14200 bored softnet3 86035 89457 0 0 3 0x14200 bored softnet2 98918 205673 0 0 3 0x14200 bored softnet1 90375 243727 0 0 3 0x14200 bored softnet0 26683 503231 0 0 3 0x14200 bored systqmp 80024 404122 0 0 3 0x14200 bored systq 44875 445574 0 0 3 0x14200 tmoslp softclockmp 21193 94719 0 0 3 0x40014200 tmoslp softclock 49122 347483 0 0 3 0x40014200 idle0 1 289743 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 18965 (syz-executor) thread 0xffff80002a39e530 (121266) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff838ffb08) #0 witness_lock+0x5bb stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5bb sys/kern/subr_witness.c:1155 #1 vn_closefile+0x41 sys/kern/vfs_vnops.c:608 #2 fdrop+0x126 sys/kern/kern_descrip.c:1265 #3 closef+0x192 sys/kern/kern_descrip.c:1249 #4 syscall+0xbc6 mi_syscall sys/sys/syscall_mi.h:176 [inline] #4 syscall+0xbc6 sys/arch/amd64/amd64/trap.c:577 #5 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10218 11222K 11222K 166960K 11459 0 pcb 17 14K 16K 166960K 122 0 rtable 222 7K 7K 166960K 395 0 pf 40 18K 21K 166960K 72 0 ifaddr 47 7K 7K 166960K 54 0 ifgroup 65 2K 2K 166960K 77 0 sysctl 3 1K 1K 166960K 3 0 counters 70 37K 37K 166960K 74 0 ioctlops 0 0K 4K 166960K 1488 0 iov 0 0K 12K 166960K 8 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1347 85K 85K 166960K 1532 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 5 0 VM map 2 1K 1K 166960K 2 0 sem 10 0K 0K 166960K 10 0 dirhash 12 2K 2K 166960K 18 0 ACPI 1690 195K 286K 166960K 12468 0 file desc 17 61K 93K 166960K 278 0 sigio 0 0K 0K 166960K 8 0 proc 72 91K 128K 166960K 541 0 subproc 72 4K 4K 166960K 72 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 30 0 in_multi 90 6K 7K 166960K 106 0 ether_multi 1 0K 0K 166960K 1 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 79 360K 360K 166960K 79 0 exec 0 0K 1K 166960K 388 0 fusefs mount 1 32K 32K 166960K 1 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 237 73K 77K 166960K 4122 0 UVM aobj 7 2K 2K 166960K 8 0 pinsyscall 42 84K 106K 166960K 1356 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 7 0 NDP 14 0K 2K 166960K 32 0 temp 43 8635K 8727K 166960K 6060 0 kqueue 15 24K 28K 166960K 48 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 24 0 0 1 0 1 1 0 8 0 rtpcb 120 45 0 41 1 0 1 1 0 8 0 rtentry 112 123 0 22 4 0 4 4 0 8 0 unpcb 144 148 0 129 4 0 4 4 0 8 3 syncache 336 3 0 3 1 1 0 1 0 8 0 tcpcb 808 64 0 59 4 0 4 4 0 8 3 arp 120 20 0 1 1 0 1 1 0 8 0 inpcb 376 276 0 263 8 0 8 8 0 8 6 nd6 136 26 0 3 1 0 1 1 0 8 0 pkpcb 40 2 0 2 1 0 1 1 0 8 1 kcovpl 48 8 0 0 1 0 1 1 0 8 0 ppxss 1168 1 0 0 1 0 1 1 0 8 0 pppxif 1472 1 0 0 1 0 1 1 0 8 0 pffrent 40 1 0 1 1 0 1 1 0 8 1 pfosfp 40 1428 0 1005 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pftag 88 1 0 0 1 0 1 1 0 8 0 pfstitem 24 28 0 0 1 0 1 1 0 8 0 pfstkey 128 28 0 0 1 0 1 1 0 8 0 pfstate 376 28 0 0 3 0 3 3 0 8 0 pfrule 1344 24 0 18 2 1 1 2 0 8 0 art_heap8 4096 3 0 0 3 0 3 3 0 8 0 art_heap4 256 524 0 81 31 0 31 31 0 8 3 art_table 32 527 0 81 4 0 4 4 0 8 0 art_node 16 122 0 33 1 0 1 1 0 8 0 sysvmsgpl 40 2 0 1 1 0 1 1 0 8 0 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 112 8 0 0 1 0 1 1 0 8 0 shmpl 112 5 0 1 1 0 1 1 0 8 0 dirhash 1024 21 0 4 3 0 3 3 0 8 0 dino2pl 256 1897 0 382 95 0 95 95 0 8 0 ffsino 280 1897 0 382 109 0 109 109 0 8 0 nchpl 144 2266 0 577 63 0 63 63 0 8 0 uvmvnodes 80 2048 0 0 42 0 42 42 0 8 0 vnodes 216 2048 0 0 114 0 114 114 0 8 0 namei 1024 7811 0 7811 2 0 2 2 0 8 2 percpumem 16 51 0 2 1 0 1 1 0 8 0 kstatmem 264 32 0 4 2 0 2 2 0 8 0 scxspl 216 6958 0 6958 3 2 1 2 1 8 1 plimitpl 152 46 0 28 1 0 1 1 0 8 0 sigapl 424 577 0 527 7 0 7 7 0 8 1 futexpl 64 2332 0 2330 1 0 1 1 0 8 0 knotepl 120 310 0 0 10 0 10 10 0 8 0 kqueuepl 216 58 0 46 1 0 1 1 0 8 0 pipepl 328 117 0 90 3 0 3 3 0 8 0 fdescpl 504 558 0 527 5 0 5 5 0 8 1 filepl 152 2795 0 2564 13 0 13 13 0 8 3 lockfpl 104 60 0 58 1 0 1 1 0 8 0 lockfspl 48 26 0 24 1 0 1 1 0 8 0 sessionpl 144 22 0 13 1 0 1 1 0 8 0 pgrppl 48 31 0 14 1 0 1 1 0 8 0 ucredpl 104 424 0 411 1 0 1 1 0 8 0 zombiepl 144 530 0 527 1 0 1 1 0 8 0 processpl 1168 577 0 527 5 0 5 5 0 8 1 procpl 648 846 0 789 6 0 6 6 0 8 0 sockpl 688 473 0 437 12 1 11 12 0 8 7 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 110 0 0 14 0 14 14 0 8 0 mcl2k 2048 28 0 0 4 0 4 4 0 8 0 mtagpl 96 9 0 0 1 0 1 1 0 8 0 mbufpl 256 170 0 0 11 0 11 11 0 8 0 bufpl 280 2506 0 130 170 0 170 170 0 8 0 anonpl 24 112491 0 109042 50 4 46 46 0 184 20 amapchunkpl 152 12718 0 12192 25 0 25 25 0 158 3 amappl16 200 2180 0 2151 14 4 10 11 0 8 8 amappl15 192 25 0 25 1 1 0 1 0 8 0 amappl14 184 112 0 100 1 0 1 1 0 8 0 amappl13 176 10 0 10 1 1 0 1 0 8 0 amappl12 168 1197 0 1166 4 1 3 3 0 8 0 amappl11 160 75 0 60 1 0 1 1 0 8 0 amappl10 152 7 0 6 1 0 1 1 0 8 0 amappl9 144 242 0 242 2 2 0 1 0 8 0 amappl8 136 28 0 26 1 0 1 1 0 8 0 amappl7 128 131 0 119 1 0 1 1 0 8 0 amappl6 120 180 0 177 1 0 1 1 0 8 0 amappl5 112 123 0 114 1 0 1 1 0 8 0 amappl4 104 317 0 298 1 0 1 1 0 8 0 amappl3 96 2228 0 2109 4 0 4 4 0 8 0 amappl2 88 635 0 572 2 0 2 2 0 8 0 amappl1 80 8114 0 7542 14 0 14 14 0 8 1 amappl 88 3746 0 3565 5 0 5 5 0 92 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 253 0 253 1 1 0 1 0 8 0 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 7 0 1 1 0 1 1 0 8 0 uaddrrnd 24 558 0 527 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 558 0 527 1 0 1 1 0 8 0 vmmpekpl 168 6243 0 6212 2 0 2 2 0 8 0 vmmpepl 168 40430 0 38543 92 0 92 92 0 357 6 vmsppl 456 557 0 527 5 0 5 5 0 8 1 rwobjpl 64 16195 0 13196 50 0 50 50 0 8 1 pdppl 4096 1123 0 1054 103 32 71 87 0 8 2 pvpl 32 14195 0 0 115 0 115 115 0 265 0 pmappl 248 557 0 527 3 0 3 3 0 8 1 extentpl 40 55 0 38 1 0 1 1 0 8 0 phpool 112 286 0 35 8 0 8 8 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:437 panic(ffffffff8343b582) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff833e7d34,ffffffff833f04dc,3b0,ffffffff833f0524) at __assert+0x29 refcnt_finalize(ffff80003c51b988,ffffffff8332fc97) at refcnt_finalize+0x1c8 sys/kern/kern_synch.c:945 pppx_if_destroy(ffff80002b8a3000,ffff80003c51b980) at pppx_if_destroy+0x3d sys/net/if_pppx.c:806 pppxclose(205b9a,1,2000,ffff80002a39e530) at pppxclose+0xa0 sys/net/if_pppx.c:553 spec_close(ffff80003c506840) at spec_close+0x412 VOP_CLOSE(fffffd805f5e9558,1,fffffd807f7d36e8,ffff80002a39e530) at VOP_CLOSE+0x133 sys/kern/vfs_vops.c:156 vn_closefile(fffffd806661a268,ffff80002a39e530) at vn_closefile+0x12b vn_close sys/kern/vfs_vnops.c:292 [inline] vn_closefile(fffffd806661a268,ffff80002a39e530) at vn_closefile+0x12b sys/kern/vfs_vnops.c:615 fdrop(fffffd806661a268,ffff80002a39e530) at fdrop+0x126 sys/kern/kern_descrip.c:1265 closef(fffffd806661a268,ffff80002a39e530) at closef+0x192 sys/kern/kern_descrip.c:1249 syscall(ffff80003c506aa0) at syscall+0xbc6 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c506aa0) at syscall+0xbc6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9e1611a3280, count: -13 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x27: addq $0x8,%rsp x86_ipi_db(ffff800029aabff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 __mp_lock(ffffffff838ff900) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff838ff900) at __mp_lock+0x192 sys/kern/kern_lock.c:144 syscall(ffff800033cb2040) at syscall+0xae6 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff800033cb2040) at syscall+0xae6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x764bb8b4e6e0, count: 9 ddb{1}> trace x86_ipi_db(ffff800029aabff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 __mp_lock(ffffffff838ff900) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff838ff900) at __mp_lock+0x192 sys/kern/kern_lock.c:144 syscall(ffff800033cb2040) at syscall+0xae6 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff800033cb2040) at syscall+0xae6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x764bb8b4e6e0, count: -6