panic: kernel diagnostic assertion "refs != ~0" failed: file "/syzkaller/managers/main/kernel/sys/kern/kern_synch.c", line 959 Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *372918 54717 0 0 0x4000000 0 syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834c24a2) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fda6e,ffffffff835576f2,3bf,ffffffff8353045f) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a7cb758,ffffffff834b5eff) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80002a7cb750) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a76fa10) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002c8afbf0) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffffa806d548060,81,fffffa8007ffd4e0,ffff80002a76fa10) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffffa806c868d30,ffff80002a76fa10) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffffa806c868d30,ffff80002a76fa10) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffffa806c868d30,ffff80002a76fa10) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffffa806c868d30,ffff80002a76fa10) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002a76fa10,ffff80002c8afeb0,ffff80002c8afe00) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff80002c8afeb0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002c8afeb0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xb0146850370, count: 1 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> ddb> set $lines = 0 ddb> set $maxwidth = 0 ddb> show panic *cpu0: kernel diagnostic assertion "refs != ~0" failed: file "/syzkaller/managers/main/kernel/sys/kern/kern_synch.c", line 959 ddb> show kasan No such command ddb> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834c24a2) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fda6e,ffffffff835576f2,3bf,ffffffff8353045f) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a7cb758,ffffffff834b5eff) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80002a7cb750) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a76fa10) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002c8afbf0) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffffa806d548060,81,fffffa8007ffd4e0,ffff80002a76fa10) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffffa806c868d30,ffff80002a76fa10) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffffa806c868d30,ffff80002a76fa10) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffffa806c868d30,ffff80002a76fa10) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffffa806c868d30,ffff80002a76fa10) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002a76fa10,ffff80002c8afeb0,ffff80002c8afe00) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff80002c8afeb0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002c8afeb0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xb0146850370, count: -14 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80002c8af9c0 rbx 0x1 rdx 0 rcx 0 rax 0xffff80002a76fa10 r8 0x101010101010101 r9 0x8080808080808080 r10 0x166513158b17fd80 r11 0x253329c09ca3a3d2 r12 0 r13 0 r14 0 r15 0x1 rip 0xffffffff829e7665 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002c8af9b0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb> show proc PROC (syz-executor) tid=372918 pid=54717 tcnt=3 stat=onproc flags process=0 proc=4000000 runpri=76, usrpri=76, slppri=16, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80002a75d770,0xffffffff839ccb08 process=0xffff800045ffb678 user=0xffff80002c8aa000, vmspace=0xfffffa806d980740 estcpu=26, cpticks=0, pctcpu=0.0, user=0, sys=0, intr=0 ddb> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 71685 79618 72772 0 2 0x100000 0 sh 72772 135355 50217 0 3 0x100002 0x88 sigsusp sh 54717 467851 38161 0 2 0 0 syz-executor 54717 321727 38161 0 3 0 0x4000000 smrbar syz-executor *54717 372918 38161 0 7 0 0x4000000 syz-executor 50217 117501 8711 0 3 0x2 0x80 wait syz-executor 56659 51808 8711 0 3 0x2 0x80 piperd syz-executor 88043 196923 8711 0 3 0x2 0x80 piperd syz-executor 51680 136274 8711 0 3 0x2 0x80 piperd syz-executor 38161 382857 8711 0 3 0x2 0x80 nanoslp syz-executor 65028 104752 8711 0 3 0x2 0x80 piperd syz-executor 8711 450636 55278 0 3 0x2 0x80 wait syz-executor 55278 440989 5269 0 3 0x100002 0x88 sigsusp ksh 5269 354168 29011 0 3 0x10 0x88 kqread sshd-session 29011 498125 47211 0 3 0x12 0x80 kqread sshd-session 52645 173728 1 0 3 0x100003 0x80 ttyin getty 47211 332170 1 0 3 0 0x88 kqread sshd 963 347469 72405 73 2 0x1100010 0 syslogd 72405 8965 1 0 3 0x100002 0x80 sbwait syslogd-parent 35715 400668 1 0 3 0x100000 0x80 kqread resolvd 91788 333503 44838 77 3 0x100012 0x80 kqread dhcpleased 15045 317595 44838 77 3 0x100012 0x80 kqread dhcpleased 44838 418033 1 0 3 0 0x80 kqread dhcpleased 88354 361958 0 0 3 0x14000 0x200 bored smr 22867 42719 0 0 2 0x14000 0x200 zerothread 32301 37534 0 0 3 0x14000 0x200 aiodoned aiodoned 69143 82767 0 0 3 0x14000 0x200 syncer update 50164 501649 0 0 3 0x14000 0x200 cleaner cleaner 68645 513027 0 0 3 0x14000 0x200 reaper reaper 75189 351995 0 0 3 0x14000 0x200 pgdaemon pagedaemon 36678 29658 0 0 3 0x14000 0x200 bored viomb 84107 382247 0 0 3 0x14000 0x40000200 acpi0 acpi0 39207 172123 0 0 3 0x14000 0x200 bored softnet0 87040 272821 0 0 3 0x14000 0x200 bored systqmp 28666 158253 0 0 3 0x14000 0x200 bored systq 71819 312002 0 0 3 0x14000 0x40000200 tmoslp softclock 43261 206523 0 0 3 0x14000 0x40000200 idle0 1 244925 0 0 3 0x2 0x80 wait init 0 0 -1 0 3 0x10000 0x200 scheduler swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 11031 12103K 12187K 166960K 12182 0 pcb 17 12K 12K 166960K 29 0 rtable 230 7K 7K 166960K 498 0 pf 33 13K 16K 166960K 57 0 ifaddr 42 7K 7K 166960K 70 0 ifgroup 55 2K 2K 166960K 88 0 sysctl 1 1K 9K 166960K 6 0 counters 35 18K 18K 166960K 44 0 ioctlops 0 0K 4K 166960K 113 0 iov 0 0K 12K 166960K 2 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1297 82K 82K 166960K 1465 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 3 0 VM map 2 1K 1K 166960K 2 0 sem 8 0K 0K 166960K 11 0 dirhash 12 2K 2K 166960K 15 0 ACPI 1692 195K 286K 166960K 12472 0 file desc 13 45K 97K 166960K 268 0 sigio 0 0K 0K 166960K 4 0 proc 61 59K 124K 166960K 641 0 subproc 72 4K 4K 166960K 117 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 4 0 in_multi 90 6K 6K 166960K 145 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 6 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 43 201K 201K 166960K 43 0 exec 0 0K 1K 166960K 443 0 fusefs mount 1 32K 32K 166960K 1 0 tdb 3 0K 0K 166960K 3 0 VM swap 14 124K 124K 166960K 15 0 UVM amap 171 142K 151K 166960K 3892 0 UVM aobj 6 2K 2K 166960K 7 0 pinsyscall 34 68K 96K 166960K 1480 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 4 0 NDP 14 0K 2K 166960K 45 0 temp 35 9118K 9182K 166960K 8213 0 kqueue 14 22K 26K 166960K 45 0 SYN cache 2 16K 16K 166960K 2 0 ddb> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle rtpcb 120 50 0 47 1 0 1 1 0 8 0 rtentry 136 165 0 59 4 0 4 4 0 8 0 unpcb 144 102 0 87 2 0 2 2 0 8 1 syncache 336 6 0 6 1 0 1 1 0 8 1 tcpcb 736 28 0 24 2 0 2 2 0 8 1 arp 96 28 0 11 1 0 1 1 0 8 0 inpcb 328 126 0 119 2 0 2 2 0 8 1 nd6 112 38 0 15 1 0 1 1 0 8 0 pkpcb 40 1 0 1 1 0 1 1 0 8 1 kcovpl 48 13 0 5 1 0 1 1 0 8 0 ppxss 1072 3 0 2 1 0 1 1 0 8 0 pppxif 1416 1 0 0 1 0 1 1 0 8 0 pftag 88 1 0 0 1 0 1 1 0 8 0 pfqueue 320 1 0 1 1 0 1 1 0 8 1 pfrule 1360 2 0 2 1 0 1 1 0 8 1 art_heap8 4096 2 0 0 2 0 2 2 0 8 0 art_heap4 256 667 0 225 33 0 33 33 0 8 2 art_table 40 669 0 225 6 0 6 6 0 8 1 art_node 32 165 0 68 1 0 1 1 0 8 0 sysvmsgpl 40 1 0 0 1 0 1 1 0 8 0 semapl 72 8 0 2 1 0 1 1 0 8 0 shmpl 120 4 0 1 1 0 1 1 0 8 0 dirhash 1024 19 0 2 3 0 3 3 0 8 0 dino2pl 256 1715 0 238 93 0 93 93 0 8 0 ffsino 256 1715 0 238 93 0 93 93 0 8 0 nchpl 144 1991 0 282 64 0 64 64 0 8 0 vnodes 216 1867 0 0 104 0 104 104 0 8 0 namei 1024 7011 0 7011 3 0 3 3 0 8 3 kstatmem 264 43 0 18 2 0 2 2 0 8 0 scxspl 216 6717 0 6717 3 0 3 3 1 8 3 plimitpl 152 40 0 24 1 0 1 1 0 8 0 sigapl 424 545 0 507 6 0 6 6 0 8 1 knotepl 120 4852 0 4804 4 0 4 4 0 8 2 kqueuepl 184 85 0 74 3 0 3 3 0 8 2 pipepl 304 144 0 117 3 0 3 3 0 8 0 fdescpl 448 532 0 507 5 0 5 5 0 8 1 filepl 120 1898 0 1694 8 0 8 8 0 8 1 lockfpl 104 33 0 30 1 0 1 1 0 8 0 lockfspl 48 16 0 13 1 0 1 1 0 8 0 sessionpl 144 30 0 22 1 0 1 1 0 8 0 pgrppl 48 43 0 27 1 0 1 1 0 8 0 ucredpl 104 137 0 126 1 0 1 1 0 8 0 zombiepl 144 509 0 507 1 0 1 1 0 8 0 processpl 1160 545 0 507 4 0 4 4 0 8 0 procpl 664 659 0 619 5 0 5 5 0 8 0 sockpl 552 281 0 256 5 0 5 5 0 8 3 mcl64k 65536 10 0 10 1 0 1 1 0 8 1 mcl16k 16384 7 0 7 1 0 1 1 0 8 1 mcl12k 12288 1 0 1 1 0 1 1 0 8 1 mcl8k 8192 12 0 12 1 0 1 1 0 8 1 mcl4k 4096 2624 0 2570 13 0 13 13 0 8 5 mcl2k 2048 253 0 249 2 0 2 2 0 8 1 mextrefs 64 99 0 98 1 0 1 1 0 8 0 mtagpl 96 4 0 4 1 0 1 1 0 8 1 mbufpl 256 5310 0 5177 12 0 12 12 0 8 2 bufpl 272 2514 0 90 162 0 162 162 0 8 0 anonpl 24 96181 0 93486 42 0 42 42 0 187 19 amapchunkpl 152 11076 0 10772 24 0 24 24 0 158 9 amappl16 200 1533 0 1519 14 0 14 14 0 8 12 amappl15 192 4 0 4 1 0 1 1 0 8 1 amappl14 184 448 0 446 1 0 1 1 0 8 0 amappl13 176 142 0 132 1 0 1 1 0 8 0 amappl12 168 784 0 761 2 0 2 2 0 8 0 amappl11 160 7 0 6 1 0 1 1 0 8 0 amappl10 152 65 0 57 1 0 1 1 0 8 0 amappl9 144 335 0 334 1 0 1 1 0 8 0 amappl8 136 105 0 104 1 0 1 1 0 8 0 amappl7 128 150 0 140 1 0 1 1 0 8 0 amappl6 120 151 0 149 1 0 1 1 0 8 0 amappl5 112 151 0 145 1 0 1 1 0 8 0 amappl4 104 279 0 265 1 0 1 1 0 8 0 amappl3 96 2021 0 1946 3 0 3 3 0 8 0 amappl2 88 513 0 465 2 0 2 2 0 8 0 amappl1 80 10460 0 9943 12 0 12 12 0 8 0 amappl 88 3153 0 3043 4 0 4 4 0 92 0 uvmvnodes 80 101 0 0 3 0 3 3 0 8 0 dma4096 4096 1 0 1 1 0 1 1 0 8 1 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 7 0 7 1 0 1 1 0 8 1 dma128 128 253 0 253 1 0 1 1 0 8 1 dma64 64 6 0 6 1 0 1 1 0 8 1 dma32 32 7 0 7 1 0 1 1 0 8 1 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 72 6 0 1 1 0 1 1 0 8 0 uaddrrnd 24 532 0 507 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 532 0 507 1 0 1 1 0 8 0 vmmpekpl 168 5879 0 5836 3 0 3 3 0 8 0 vmmpepl 168 42974 0 41517 85 0 85 85 0 357 10 vmsppl 368 531 0 507 4 0 4 4 0 8 1 rwobjpl 40 15024 0 14155 12 0 12 12 0 8 1 pdppl 4096 1070 0 1014 92 24 68 82 0 8 12 pvpl 32 244811 0 237888 103 0 103 103 0 265 27 pmappl 216 531 0 507 3 0 3 3 0 8 1 extentpl 40 46 0 28 1 0 1 1 0 8 0 phpool 112 527 0 24 15 0 15 15 0 8 0 ddb> machine ddbcpu 0 No such command ddb> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834c24a2) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fda6e,ffffffff835576f2,3bf,ffffffff8353045f) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a7cb758,ffffffff834b5eff) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80002a7cb750) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a76fa10) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002c8afbf0) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffffa806d548060,81,fffffa8007ffd4e0,ffff80002a76fa10) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffffa806c868d30,ffff80002a76fa10) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffffa806c868d30,ffff80002a76fa10) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffffa806c868d30,ffff80002a76fa10) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffffa806c868d30,ffff80002a76fa10) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002a76fa10,ffff80002c8afeb0,ffff80002c8afe00) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff80002c8afeb0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002c8afeb0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xb0146850370, count: -14 ddb> machine ddbcpu 1 No such command ddb> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834c24a2) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fda6e,ffffffff835576f2,3bf,ffffffff8353045f) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a7cb758,ffffffff834b5eff) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80002a7cb750) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a76fa10) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002c8afbf0) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffffa806d548060,81,fffffa8007ffd4e0,ffff80002a76fa10) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffffa806c868d30,ffff80002a76fa10) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffffa806c868d30,ffff80002a76fa10) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffffa806c868d30,ffff80002a76fa10) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffffa806c868d30,ffff80002a76fa10) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002a76fa10,ffff80002c8afeb0,ffff80002c8afe00) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff80002c8afeb0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002c8afeb0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xb0146850370, count: -14