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 *143411 904 0 0 0x4000000 0 syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834915ef) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834d0712,ffffffff83531146,3bf,ffffffff8350a2ed) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a7dac48,ffffffff834865c4) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(ffff8000348c8000,ffff80002a7dac40) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(205b92,1,2000,ffff80002ccae560) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff8000310d3660) at spec_close+0x417 sys/kern/spec_vnops.c:-1 VOP_CLOSE(ffffee8072f2b6f0,1,ffffee8007ffd478,ffff80002ccae560) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(ffffee806d630100,ffff80002ccae560) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(ffffee806d630100,ffff80002ccae560) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(ffffee806d630100,ffff80002ccae560) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(ffffee806d630100,ffff80002ccae560) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002ccae560,ffff8000310d3920,ffff8000310d3870) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff8000310d3920) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff8000310d3920) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x2cfd355b740, 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(ffffffff834915ef) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834d0712,ffffffff83531146,3bf,ffffffff8350a2ed) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a7dac48,ffffffff834865c4) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(ffff8000348c8000,ffff80002a7dac40) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(205b92,1,2000,ffff80002ccae560) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff8000310d3660) at spec_close+0x417 sys/kern/spec_vnops.c:-1 VOP_CLOSE(ffffee8072f2b6f0,1,ffffee8007ffd478,ffff80002ccae560) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(ffffee806d630100,ffff80002ccae560) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(ffffee806d630100,ffff80002ccae560) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(ffffee806d630100,ffff80002ccae560) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(ffffee806d630100,ffff80002ccae560) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002ccae560,ffff8000310d3920,ffff8000310d3870) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff8000310d3920) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff8000310d3920) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x2cfd355b740, count: -14 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff8000310d3430 rbx 0 rdx 0xffff8000015e1780 rcx 0 rax 0xffff80002ccae560 r8 0x101010101010101 r9 0x8080808080808080 r10 0xe31aa543d25cdfa5 r11 0x4f76ff05aeeb66c1 r12 0 r13 0 r14 0 r15 0x1 rip 0xffffffff82ffcad5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff8000310d3420 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb> show proc PROC (syz-executor) tid=143411 pid=904 tcnt=3 stat=onproc flags process=0 proc=4000000 runpri=50, usrpri=50, slppri=17, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80002ccae7f8,0xffffffff83a53250 process=0xffff800031135fd8 user=0xffff8000310ce000, vmspace=0xffffee806d2d5748 estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 47775 6644 71255 0 2 0 0 syz-executor 47775 397859 71255 0 3 0 0x4000080 kqread syz-executor 48811 406486 98940 0 2 0 0 syz-executor 48811 249 98940 0 3 0 0x4000080 fsleep syz-executor 32754 176211 59823 0 2 0 0 syz-executor 32754 414098 59823 0 3 0 0x4000080 netacc syz-executor 904 39446 88970 0 2 0 0 syz-executor 904 387892 88970 0 3 0 0x4000000 smrbar syz-executor * 904 143411 88970 0 7 0 0x4000000 syz-executor 88904 152041 54729 0 2 0 0 syz-executor 41714 141655 91001 0 2 0x2 0 syz-executor 53463 456848 0 0 3 0x14000 0x280 nfsidl nfsio 60990 188331 0 0 3 0x14000 0x280 nfsidl nfsio 90518 155245 0 0 3 0x14000 0x280 nfsidl nfsio 99997 401981 0 0 3 0x14000 0x280 nfsidl nfsio 41825 403748 0 0 3 0x14000 0x280 nfsidl nfsio 39634 329645 0 0 3 0x14000 0x280 nfsidl nfsio 99030 88775 0 0 3 0x14000 0x280 nfsidl nfsio 44269 35156 0 0 3 0x14000 0x280 nfsidl nfsio 13272 469981 0 0 3 0x14000 0x280 nfsidl nfsio 28678 502699 0 0 3 0x14000 0x280 nfsidl nfsio 59465 140189 0 0 3 0x14000 0x280 nfsidl nfsio 89489 242366 0 0 3 0x14000 0x280 nfsidl nfsio 13807 249522 0 0 3 0x14000 0x280 nfsidl nfsio 91700 475825 0 0 3 0x14000 0x280 nfsidl nfsio 5078 47972 0 0 3 0x14000 0x280 nfsidl nfsio 47906 298539 0 0 3 0x14000 0x280 nfsidl nfsio 73381 355474 0 0 3 0x14000 0x280 nfsidl nfsio 78052 5705 0 0 3 0x14000 0x280 nfsidl nfsio 11843 1707 0 0 3 0x14000 0x280 nfsidl nfsio 37912 55773 0 0 3 0x14000 0x280 nfsidl nfsio 54729 255360 91001 0 2 0x2 0xc80 syz-executor 85808 302201 6107 0 2 0 0 syz-executor 85808 363026 6107 0 3 0 0x4000080 fsleep syz-executor 85808 34175 6107 0 2 0 0x4000000 syz-executor 6107 96456 91001 0 3 0x2 0x80 nanoslp syz-executor 59823 207151 91001 0 2 0x2 0xc80 syz-executor 88970 449837 91001 0 3 0x2 0x80 nanoslp syz-executor 56969 350792 91001 0 3 0x2 0x80 piperd syz-executor 98940 519291 91001 0 2 0x2 0xc80 syz-executor 71255 339083 91001 0 3 0x2 0x80 nanoslp syz-executor 91001 64757 55106 0 2 0x2 0 syz-executor 55106 361618 6235 0 3 0x100002 0x88 sigsusp ksh 6235 445173 21601 0 3 0x10 0x88 kqread sshd-session 21601 74966 66623 0 3 0x12 0x80 kqread sshd-session 5902 17514 1 0 3 0x100003 0x80 ttyin getty 66623 183166 1 0 3 0 0x88 kqread sshd 30941 387433 95856 73 3 0x1100010 0x80 kqread syslogd 95856 85022 1 0 3 0x100002 0x80 sbwait syslogd 94350 405055 1 0 3 0x100000 0x80 kqread resolvd 58696 94310 37155 77 3 0x100012 0x80 kqread dhcpleased 66516 188036 37155 77 3 0x100012 0x80 kqread dhcpleased 37155 240996 1 0 3 0 0x80 kqread dhcpleased 67964 127751 0 0 3 0x14000 0x200 bored smr 58907 257949 0 0 2 0x14000 0x200 zerothread 20364 267403 0 0 3 0x14000 0x200 aiodoned aiodoned 52519 445563 0 0 3 0x14000 0x200 syncer update 74014 13324 0 0 3 0x14000 0x200 cleaner cleaner 98012 222776 0 0 3 0x14000 0x200 reaper reaper 98910 131401 0 0 3 0x14000 0x200 pgdaemon pagedaemon 21742 166208 0 0 3 0x14000 0x200 bored viomb 25889 407361 0 0 3 0x14000 0x40000200 acpi0 acpi0 8685 485146 0 0 3 0x14000 0x200 bored softnet0 49453 315045 0 0 3 0x14000 0x200 smrbar systqmp 4151 176353 0 0 3 0x14000 0x200 bored systq 11129 267390 0 0 3 0x14000 0x40000200 tmoslp softclock 60053 347867 0 0 3 0x14000 0x40000200 idle0 1 344821 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 11033 12229K 12232K 166960K 12149 0 pcb 17 12K 12K 166960K 30 0 rtable 197 5K 8K 166960K 395 0 pf 29 12K 16K 166960K 44 0 ifaddr 36 6K 7K 166960K 51 0 ifgroup 47 2K 2K 166960K 61 0 sysctl 1 1K 9K 166960K 5 0 counters 33 17K 18K 166960K 39 0 ioctlops 0 0K 4K 166960K 43 0 iov 0 0K 2K 166960K 1 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1297 82K 82K 166960K 1420 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 1K 166960K 2 0 VM map 2 1K 1K 166960K 2 0 sem 7 0K 0K 166960K 7 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1692 195K 286K 166960K 12470 0 file desc 16 57K 97K 166960K 195 0 proc 60 59K 91K 166960K 533 0 subproc 66 4K 4K 166960K 84 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 5 0 in_multi 78 5K 6K 166960K 112 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 2 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 55 254K 254K 166960K 55 0 exec 0 0K 1K 166960K 383 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 206 151K 166K 166960K 3366 0 UVM aobj 3 2K 2K 166960K 3 0 pinsyscall 37 74K 94K 166960K 1321 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 2 0 NDP 12 0K 2K 166960K 32 0 temp 33 9105K 9126K 166960K 5987 0 kqueue 15 24K 28K 166960K 36 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 41 0 38 1 0 1 1 0 8 0 rtentry 136 123 0 34 4 0 4 4 0 8 0 unpcb 144 54 0 39 1 0 1 1 0 8 0 syncache 336 6 0 6 1 0 1 1 0 8 1 tcpcb 736 19 0 13 1 0 1 1 0 8 0 arp 96 20 0 6 1 0 1 1 0 8 0 ipq 40 1 0 1 1 0 1 1 0 8 1 ipqe 40 2 0 2 1 0 1 1 0 8 1 inpcb 328 94 0 85 1 0 1 1 0 8 0 nd6 112 27 0 9 1 0 1 1 0 8 0 kcovpl 48 9 0 2 1 0 1 1 0 8 0 ppxss 1072 4 0 3 1 0 1 1 0 8 0 pppxif 1416 1 0 0 1 0 1 1 0 8 0 pfrktable 1344 4 0 4 1 0 1 1 0 8 1 pfsrclim 320 2 0 1 1 0 1 1 0 8 0 pfanchor 1288 1 0 1 1 0 1 1 0 8 1 pftag 88 1 0 1 1 0 1 1 0 8 1 pfrule 1360 3 0 3 1 0 1 1 0 8 1 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 502 0 88 29 0 29 29 0 8 2 art_table 40 503 0 88 5 0 5 5 0 8 0 art_node 32 123 0 32 1 0 1 1 0 8 0 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 72 5 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1654 0 185 92 0 92 92 0 8 0 ffsino 256 1654 0 185 92 0 92 92 0 8 0 nchpl 144 1916 0 211 64 0 64 64 0 8 0 vnodes 216 1767 0 0 99 0 99 99 0 8 0 namei 1024 6549 0 6549 4 0 4 4 0 8 4 pfiaddrpl 120 1 0 1 1 0 1 1 0 8 1 kstatmem 264 29 0 8 2 0 2 2 0 8 0 scxspl 216 6787 0 6787 2 0 2 2 1 8 2 plimitpl 152 39 0 22 1 0 1 1 0 8 0 sigapl 424 506 0 445 7 0 7 7 0 8 0 knotepl 120 3829 0 3779 9 0 9 9 0 8 7 kqueuepl 184 37 0 25 1 0 1 1 0 8 0 pipepl 304 132 0 105 3 0 3 3 0 8 0 fdescpl 448 473 0 445 5 0 5 5 0 8 1 filepl 120 1781 0 1568 8 0 8 8 0 8 1 lockfpl 104 22 0 18 1 0 1 1 0 8 0 lockfspl 48 13 0 9 1 0 1 1 0 8 0 sessionpl 144 25 0 17 1 0 1 1 0 8 0 pgrppl 48 36 0 20 1 0 1 1 0 8 0 ucredpl 104 216 0 205 1 0 1 1 0 8 0 zombiepl 144 445 0 445 1 0 1 1 0 8 1 processpl 1160 506 0 445 5 0 5 5 0 8 0 procpl 664 578 0 510 7 0 7 7 0 8 0 sockpl 552 192 0 165 3 0 3 3 0 8 0 mcl64k 65536 4 0 4 1 0 1 1 0 8 1 mcl16k 16384 3 0 3 1 0 1 1 0 8 1 mcl12k 12288 1 0 1 1 0 1 1 0 8 1 mcl8k 8192 6 0 6 1 0 1 1 0 8 1 mcl4k 4096 2566 0 2513 14 0 14 14 0 8 6 mcl2k 2048 187 0 187 1 0 1 1 0 8 1 mextrefs 64 64 0 64 1 0 1 1 0 8 1 mtagpl 96 4 0 4 1 0 1 1 0 8 1 mbufpl 256 4755 0 4633 10 0 10 10 0 8 1 bufpl 272 2328 0 104 149 0 149 149 0 8 0 anonpl 24 95251 0 88204 44 0 44 44 0 187 0 amapchunkpl 152 9400 0 8948 25 0 25 25 0 158 5 amappl16 200 1720 0 1479 13 0 13 13 0 8 0 amappl15 192 7 0 6 1 0 1 1 0 8 0 amappl14 184 422 0 421 1 0 1 1 0 8 0 amappl13 176 242 0 232 1 0 1 1 0 8 0 amappl12 168 715 0 689 2 0 2 2 0 8 0 amappl11 160 25 0 24 1 0 1 1 0 8 0 amappl10 152 59 0 49 1 0 1 1 0 8 0 amappl9 144 271 0 271 1 0 1 1 0 8 1 amappl8 136 97 0 96 1 0 1 1 0 8 0 amappl7 128 142 0 131 1 0 1 1 0 8 0 amappl6 120 181 0 179 1 0 1 1 0 8 0 amappl5 112 92 0 85 1 0 1 1 0 8 0 amappl4 104 265 0 248 1 0 1 1 0 8 0 amappl3 96 1649 0 1567 3 0 3 3 0 8 0 amappl2 88 587 0 521 2 0 2 2 0 8 0 amappl1 80 10396 0 9856 13 0 13 13 0 8 1 amappl 88 2649 0 2507 4 0 4 4 0 92 0 uvmvnodes 80 96 0 0 2 0 2 2 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 19 0 18 1 0 1 1 0 8 0 aobjpl 72 2 0 0 1 0 1 1 0 8 0 uaddrrnd 24 473 0 445 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 473 0 445 1 0 1 1 0 8 0 vmmpekpl 168 5822 0 5784 2 0 2 2 0 8 0 vmmpepl 168 40906 0 39001 87 0 87 87 0 357 1 vmsppl 368 472 0 445 4 0 4 4 0 8 1 rwobjpl 40 14748 0 13617 13 0 13 13 0 8 1 pdppl 4096 953 0 890 101 34 67 83 0 8 4 pvpl 32 237594 0 225527 104 0 104 104 0 265 2 pmappl 216 472 0 445 3 0 3 3 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 514 0 34 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(ffffffff834915ef) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834d0712,ffffffff83531146,3bf,ffffffff8350a2ed) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a7dac48,ffffffff834865c4) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(ffff8000348c8000,ffff80002a7dac40) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(205b92,1,2000,ffff80002ccae560) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff8000310d3660) at spec_close+0x417 sys/kern/spec_vnops.c:-1 VOP_CLOSE(ffffee8072f2b6f0,1,ffffee8007ffd478,ffff80002ccae560) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(ffffee806d630100,ffff80002ccae560) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(ffffee806d630100,ffff80002ccae560) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(ffffee806d630100,ffff80002ccae560) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(ffffee806d630100,ffff80002ccae560) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002ccae560,ffff8000310d3920,ffff8000310d3870) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff8000310d3920) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff8000310d3920) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x2cfd355b740, 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(ffffffff834915ef) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834d0712,ffffffff83531146,3bf,ffffffff8350a2ed) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a7dac48,ffffffff834865c4) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(ffff8000348c8000,ffff80002a7dac40) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(205b92,1,2000,ffff80002ccae560) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff8000310d3660) at spec_close+0x417 sys/kern/spec_vnops.c:-1 VOP_CLOSE(ffffee8072f2b6f0,1,ffffee8007ffd478,ffff80002ccae560) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(ffffee806d630100,ffff80002ccae560) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(ffffee806d630100,ffff80002ccae560) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(ffffee806d630100,ffff80002ccae560) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(ffffee806d630100,ffff80002ccae560) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002ccae560,ffff8000310d3920,ffff8000310d3870) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff8000310d3920) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff8000310d3920) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x2cfd355b740, count: -14