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 *109837 59011 0 0 0x4000000 0 syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834bf739) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fda5b,ffffffff8355cc81,3bf,ffffffff83535e65) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a7bf1d0,ffffffff834b1b63) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80002a7bf1c8) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a7c4028) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002a83d820) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffff7807ddee010,81,fffff78007ffd750,ffff80002a7c4028) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffff7806da17698,ffff80002a7c4028) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffff7806da17698,ffff80002a7c4028) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffff7806da17698,ffff80002a7c4028) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffff7806da17698,ffff80002a7c4028) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002a7c4028,ffff80002a83dae0,ffff80002a83da30) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff80002a83dae0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a83dae0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xd620d898860, 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(ffffffff834bf739) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fda5b,ffffffff8355cc81,3bf,ffffffff83535e65) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a7bf1d0,ffffffff834b1b63) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80002a7bf1c8) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a7c4028) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002a83d820) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffff7807ddee010,81,fffff78007ffd750,ffff80002a7c4028) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffff7806da17698,ffff80002a7c4028) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffff7806da17698,ffff80002a7c4028) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffff7806da17698,ffff80002a7c4028) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffff7806da17698,ffff80002a7c4028) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002a7c4028,ffff80002a83dae0,ffff80002a83da30) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff80002a83dae0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a83dae0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xd620d898860, count: -14 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80002a83d5f0 rbx 0x1 rdx 0 rcx 0 rax 0xffff80002a7c4028 r8 0x101010101010101 r9 0x8080808080808080 r10 0x6b6285c78ec15e99 r11 0xc7e1b86c875cd9b5 r12 0 r13 0 r14 0 r15 0x1 rip 0xffffffff82b5e635 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a83d5e0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb> show proc PROC (syz-executor) tid=109837 pid=59011 tcnt=4 stat=onproc flags process=0 proc=4000000 runpri=32, usrpri=51, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80002a7c5250,0xffff80002a7c54f8 process=0xffff80002a7c3b08 user=0xffff80002a838000, vmspace=0xfffff7807f22ab80 estcpu=1, cpticks=2, pctcpu=0.0, user=0, sys=2, intr=0 ddb> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 59011 9922 70613 0 2 0 0 syz-executor 59011 285236 70613 0 3 0 0x4000000 smrbar syz-executor *59011 109837 70613 0 7 0 0x4000000 syz-executor 59011 328765 70613 0 3 0 0x4000080 fsleep syz-executor 33443 221436 13358 0 2 0x2 0 syz-executor 43252 359097 13358 0 3 0x2 0x80 piperd syz-executor 42866 475593 13358 0 3 0x2 0x80 piperd syz-executor 52421 94192 13358 0 3 0x2 0x80 piperd syz-executor 32970 165144 13358 0 3 0x2 0x80 piperd syz-executor 74707 268932 0 0 3 0x14000 0x280 nfsidl nfsio 39387 388884 0 0 3 0x14000 0x280 nfsidl nfsio 89535 190986 0 0 3 0x14000 0x280 nfsidl nfsio 91486 287390 0 0 3 0x14000 0x280 nfsidl nfsio 60404 500844 0 0 3 0x14000 0x280 nfsidl nfsio 63233 504257 0 0 3 0x14000 0x280 nfsidl nfsio 25169 112432 0 0 3 0x14000 0x280 nfsidl nfsio 26072 324029 0 0 3 0x14000 0x280 nfsidl nfsio 55757 440232 0 0 3 0x14000 0x280 nfsidl nfsio 17975 70643 0 0 3 0x14000 0x280 nfsidl nfsio 24596 73039 0 0 3 0x14000 0x280 nfsidl nfsio 34326 11600 0 0 3 0x14000 0x280 nfsidl nfsio 11973 482223 0 0 3 0x14000 0x280 nfsidl nfsio 62380 156167 0 0 3 0x14000 0x280 nfsidl nfsio 80955 229476 0 0 3 0x14000 0x280 nfsidl nfsio 48782 377621 0 0 3 0x14000 0x280 nfsidl nfsio 67341 127344 0 0 3 0x14000 0x280 nfsidl nfsio 68941 302901 0 0 3 0x14000 0x280 nfsidl nfsio 94776 190237 0 0 3 0x14000 0x280 nfsidl nfsio 31891 83834 0 0 3 0x14000 0x280 nfsidl nfsio 45987 70294 13358 0 3 0x2 0x80 piperd syz-executor 70613 471561 13358 0 2 0x2 0xc80 syz-executor 544 488367 13358 0 3 0x2 0x80 piperd syz-executor 13358 445376 17688 0 2 0x2 0 syz-executor 17688 191538 8953 0 3 0x100002 0x88 sigsusp ksh 8953 454068 22098 0 3 0x10 0x88 kqread sshd-session 22098 360012 23252 0 3 0x12 0x80 kqread sshd-session 89558 40568 1 0 3 0x100003 0x80 ttyin getty 23252 224819 1 0 3 0 0x88 kqread sshd 81471 424862 82764 73 3 0x1100010 0x80 kqread syslogd 82764 9590 1 0 3 0x100002 0x80 sbwait syslogd-parent 96820 305298 1 0 3 0x100000 0x80 kqread resolvd 89289 396673 55404 77 3 0x100012 0x80 kqread dhcpleased 60075 128173 55404 77 3 0x100012 0x80 kqread dhcpleased 55404 443379 1 0 3 0 0x80 kqread dhcpleased 19667 165068 0 0 3 0x14000 0x200 bored smr 44226 378447 0 0 2 0x14000 0x200 zerothread 46512 335982 0 0 3 0x14000 0x200 aiodoned aiodoned 18567 404781 0 0 3 0x14000 0x200 syncer update 44588 128107 0 0 3 0x14000 0x200 cleaner cleaner 81384 225671 0 0 3 0x14000 0x200 reaper reaper 82782 278464 0 0 3 0x14000 0x200 pgdaemon pagedaemon 8937 34756 0 0 3 0x14000 0x200 bored viomb 14934 467043 0 0 3 0x14000 0x40000200 acpi0 acpi0 12016 160590 0 0 3 0x14000 0x200 bored softnet0 18585 452930 0 0 3 0x14000 0x200 bored systqmp 71744 91059 0 0 3 0x14000 0x200 bored systq 19243 497017 0 0 2 0x14000 0x40000200 softclock 91728 423929 0 0 3 0x14000 0x40000200 idle0 1 493791 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 12113K 12203K 166960K 12505 0 pcb 17 12K 12K 166960K 34 0 rtable 219 8K 9K 166960K 1967 0 pf 33 13K 17K 166960K 223 0 ifaddr 40 7K 8K 166960K 291 0 ifgroup 51 2K 2K 166960K 321 0 sysctl 1 1K 9K 166960K 7 0 counters 34 17K 18K 166960K 115 0 ioctlops 0 0K 4K 166960K 173 0 iov 0 0K 16K 166960K 6 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1366 86K 86K 166960K 2121 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 20 2K 2K 166960K 35 0 dirhash 12 2K 2K 166960K 15 0 ACPI 1692 195K 286K 166960K 12472 0 file desc 11 37K 93K 166960K 1140 0 sigio 0 0K 0K 166960K 8 0 proc 59 59K 108K 166960K 2015 0 subproc 64 4K 4K 166960K 550 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 16 0 in_multi 88 5K 6K 166960K 683 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 20 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 49 228K 228K 166960K 49 0 exec 0 0K 1K 166960K 1083 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 168 141K 152K 166960K 9074 0 UVM aobj 4 2K 4K 166960K 5 0 pinsyscall 32 64K 96K 166960K 3622 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 19 1K 2K 166960K 214 0 temp 33 9118K 9182K 166960K 26484 0 kqueue 14 22K 24K 166960K 57 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 148 0 145 1 0 1 1 0 8 0 rtentry 136 696 0 598 4 0 4 4 0 8 0 unpcb 144 131 0 116 1 0 1 1 0 8 0 syncache 336 7 0 7 1 0 1 1 0 8 1 tcpqe 32 2 0 2 1 0 1 1 0 8 1 tcpcb 736 56 0 50 1 0 1 1 0 8 0 arp 96 124 0 108 1 0 1 1 0 8 0 inpcb 328 393 0 384 2 0 2 2 0 8 1 nd6 112 183 0 162 1 0 1 1 0 8 0 pkpcb 40 132 0 132 1 0 1 1 0 8 1 kcovpl 48 61 0 54 1 0 1 1 0 8 0 ppxss 1072 28 0 27 1 0 1 1 0 8 0 pppxif 1416 1 0 0 1 0 1 1 0 8 0 pffrag 232 1 0 0 1 0 1 1 0 482 0 pffrnode 88 1 0 0 1 0 1 1 0 8 0 pffrent 40 8 0 7 1 0 1 1 0 8 0 pfrktable 1344 6 0 4 1 0 1 1 0 8 0 pfanchor 1288 2 0 1 1 0 1 1 0 8 0 pftag 88 2 0 0 1 0 1 1 0 8 0 pfrule 1360 12 0 7 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 2838 0 2424 31 2 29 31 0 8 0 art_table 40 2839 0 2424 6 0 6 6 0 8 1 art_node 32 695 0 607 1 0 1 1 0 8 0 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 72 31 0 13 1 0 1 1 0 8 0 shmpl 120 2 0 1 1 0 1 1 0 8 0 dirhash 1024 19 0 2 3 0 3 3 0 8 0 dino2pl 256 2134 0 533 101 0 101 101 0 8 0 ffsino 256 2134 0 533 101 0 101 101 0 8 0 nchpl 144 2584 0 638 73 0 73 73 0 8 0 vnodes 216 2856 0 0 159 0 159 159 0 8 0 namei 1024 14614 0 14614 3 0 3 3 0 8 3 pfiaddrpl 120 2 0 1 1 0 1 1 0 8 0 kstatmem 264 185 0 162 2 0 2 2 0 8 0 scxspl 216 8932 0 8932 8 0 8 8 1 8 8 plimitpl 152 162 0 146 1 0 1 1 0 8 0 sigapl 424 1342 0 1286 8 0 8 8 0 8 1 knotepl 120 6938 0 6894 6 0 6 6 0 8 3 kqueuepl 184 160 0 149 4 0 4 4 0 8 3 pipepl 304 296 0 269 3 0 3 3 0 8 0 fdescpl 448 1309 0 1286 5 0 5 5 0 8 1 filepl 120 4374 0 4177 11 0 11 11 0 8 4 lockfpl 104 111 0 108 1 0 1 1 0 8 0 lockfspl 48 41 0 38 1 0 1 1 0 8 0 sessionpl 144 81 0 73 1 0 1 1 0 8 0 pgrppl 48 143 0 127 1 0 1 1 0 8 0 ucredpl 104 217 0 205 1 0 1 1 0 8 0 zombiepl 144 1286 0 1286 1 0 1 1 0 8 1 processpl 1160 1342 0 1286 5 0 5 5 0 8 0 procpl 664 1761 0 1702 7 0 7 7 0 8 1 sosppl 176 2 0 2 1 0 1 1 0 8 1 sockpl 552 809 0 782 5 0 5 5 0 8 2 mcl64k 65536 4 0 4 1 0 1 1 0 8 1 mcl16k 16384 2 0 2 1 0 1 1 0 8 1 mcl12k 12288 2 0 2 1 0 1 1 0 8 1 mcl8k 8192 17 0 17 1 0 1 1 0 8 1 mcl4k 4096 2830 0 2775 15 0 15 15 0 8 7 mcl2k 2048 1243 0 1242 4 0 4 4 0 8 3 mextrefs 64 266 0 266 1 0 1 1 0 8 1 mtagpl 96 4 0 4 1 0 1 1 0 8 1 mbufpl 256 10560 0 10418 16 0 16 16 0 8 5 bufpl 272 2871 0 88 186 0 186 186 0 8 0 anonpl 24 148937 0 146296 44 0 44 44 0 187 20 amapchunkpl 152 25221 0 24932 34 0 34 34 0 158 20 amappl16 200 1477 0 1464 11 1 10 11 0 8 8 amappl15 192 15 0 15 1 0 1 1 0 8 1 amappl14 184 1078 0 1077 1 0 1 1 0 8 0 amappl13 176 247 0 237 1 0 1 1 0 8 0 amappl12 168 1759 0 1737 2 0 2 2 0 8 0 amappl11 160 4 0 4 1 0 1 1 0 8 1 amappl10 152 59 0 51 1 0 1 1 0 8 0 amappl9 144 282 0 282 1 0 1 1 0 8 1 amappl8 136 299 0 298 1 0 1 1 0 8 0 amappl7 128 246 0 235 1 0 1 1 0 8 0 amappl6 120 433 0 432 1 0 1 1 0 8 0 amappl5 112 342 0 336 1 0 1 1 0 8 0 amappl4 104 420 0 407 1 0 1 1 0 8 0 amappl3 96 5194 0 5121 4 0 4 4 0 8 0 amappl2 88 649 0 598 2 0 2 2 0 8 0 amappl1 80 17844 0 17329 13 0 13 13 0 8 1 amappl 88 7479 0 7373 5 0 5 5 0 92 1 uvmvnodes 80 108 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 6 0 6 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 4 0 1 1 0 1 1 0 8 0 uaddrrnd 24 1309 0 1286 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1309 0 1286 1 0 1 1 0 8 0 vmmpekpl 168 11290 0 11244 3 0 3 3 0 8 0 vmmpepl 168 92066 0 90658 84 0 84 84 0 357 15 vmsppl 368 1308 0 1286 4 0 4 4 0 8 1 rwobjpl 40 27457 0 26599 12 0 12 12 0 8 1 pdppl 4096 2624 0 2572 136 74 62 80 0 8 10 pvpl 32 468110 0 461333 104 0 104 104 0 265 30 pmappl 216 1308 0 1286 3 0 3 3 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 615 0 76 16 0 16 16 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(ffffffff834bf739) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fda5b,ffffffff8355cc81,3bf,ffffffff83535e65) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a7bf1d0,ffffffff834b1b63) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80002a7bf1c8) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a7c4028) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002a83d820) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffff7807ddee010,81,fffff78007ffd750,ffff80002a7c4028) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffff7806da17698,ffff80002a7c4028) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffff7806da17698,ffff80002a7c4028) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffff7806da17698,ffff80002a7c4028) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffff7806da17698,ffff80002a7c4028) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002a7c4028,ffff80002a83dae0,ffff80002a83da30) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff80002a83dae0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a83dae0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xd620d898860, 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(ffffffff834bf739) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fda5b,ffffffff8355cc81,3bf,ffffffff83535e65) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a7bf1d0,ffffffff834b1b63) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80002a7bf1c8) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a7c4028) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002a83d820) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffff7807ddee010,81,fffff78007ffd750,ffff80002a7c4028) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffff7806da17698,ffff80002a7c4028) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffff7806da17698,ffff80002a7c4028) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffff7806da17698,ffff80002a7c4028) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffff7806da17698,ffff80002a7c4028) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002a7c4028,ffff80002a83dae0,ffff80002a83da30) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff80002a83dae0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a83dae0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xd620d898860, count: -14