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 * 4902 74200 0 0 0x4000000 0 syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834bee6c) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fe1cd,ffffffff83557c10,3bf,ffffffff835303db) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80003c50ec88,ffffffff834b6496) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80003c50ec80) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a726a68) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002a7ed730) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffff18076fc1eb0,81,fffff18007ffd3a8,ffff80002a726a68) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffff1806d569088,ffff80002a726a68) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffff1806d569088,ffff80002a726a68) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffff1806d569088,ffff80002a726a68) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffff1806d569088,ffff80002a726a68) at closef+0x190 sys/kern/kern_descrip.c:1265 syscall(ffff80002a7ed980) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a7ed980) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x69362adaa80, 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> 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(ffffffff834bee6c) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fe1cd,ffffffff83557c10,3bf,ffffffff835303db) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80003c50ec88,ffffffff834b6496) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80003c50ec80) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a726a68) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002a7ed730) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffff18076fc1eb0,81,fffff18007ffd3a8,ffff80002a726a68) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffff1806d569088,ffff80002a726a68) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffff1806d569088,ffff80002a726a68) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffff1806d569088,ffff80002a726a68) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffff1806d569088,ffff80002a726a68) at closef+0x190 sys/kern/kern_descrip.c:1265 syscall(ffff80002a7ed980) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a7ed980) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x69362adaa80, count: -13 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80002a7ed500 rbx 0x1 rdx 0 rcx 0 rax 0xffff80002a726a68 r8 0x101010101010101 r9 0x8080808080808080 r10 0x6e6c91624431fbe7 r11 0x9adb336d2add8eda r12 0 r13 0 r14 0 r15 0x1 rip 0xffffffff83108295 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a7ed4f0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb> show proc PROC (syz-executor) tid=4902 pid=74200 tcnt=18 stat=onproc flags process=0 proc=4000000 runpri=80, usrpri=81, slppri=16, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80002a74cd08,0xffff80002a7274d8 process=0xffff80002a77db40 user=0xffff80002a7e8000, vmspace=0xfffff1806d007180 estcpu=31, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 87023 110766 23369 0 2 0x100000 0 sh 23369 44692 78535 0 3 0x100002 0x88 sigsusp sh 90972 409386 59812 0 2 0 0 syz-executor 90972 295824 59812 0 3 0 0x4000080 fsleep syz-executor 74200 495210 14319 0 3 0 0x80 nanoslp syz-executor 74200 321447 14319 0 3 0 0x4000000 smrbar syz-executor 74200 54600 14319 0 3 0 0x4000080 fsleep syz-executor 74200 16527 14319 0 3 0 0x4000080 fsleep syz-executor 74200 215085 14319 0 3 0 0x4000080 fsleep syz-executor 74200 492950 14319 0 3 0 0x4000080 fsleep syz-executor 74200 439486 14319 0 3 0 0x4000080 fsleep syz-executor 74200 518363 14319 0 3 0 0x4000080 fsleep syz-executor 74200 314313 14319 0 3 0 0x4000080 fsleep syz-executor *74200 4902 14319 0 7 0 0x4000000 syz-executor 74200 295181 14319 0 2 0 0x4000000 syz-executor 74200 76367 14319 0 2 0 0x4000000 syz-executor 74200 229356 14319 0 2 0 0x4000000 syz-executor 74200 112647 14319 0 2 0 0x4000000 syz-executor 74200 279122 14319 0 2 0 0x4000000 syz-executor 74200 370493 14319 0 2 0 0x4000000 syz-executor 74200 279338 14319 0 2 0 0x4000000 syz-executor 74200 118513 14319 0 2 0 0x4000000 syz-executor 78535 468163 7828 0 3 0x2 0x80 wait syz-executor 33854 212744 31566 0 2 0 0xc80 syz-executor 33854 413818 31566 0 3 0 0x4000080 fsleep syz-executor 33854 154916 31566 0 3 0 0x4000080 fsleep syz-executor 33854 396565 31566 0 3 0 0x4000080 fsleep syz-executor 38948 502555 7828 0 3 0x2 0x80 piperd syz-executor 77662 462796 7828 0 3 0x2 0x80 piperd syz-executor 21131 345823 7828 0 3 0x2 0x80 nanoslp syz-executor 14319 129330 7828 0 2 0x2 0xc80 syz-executor 31566 284966 7828 0 3 0x2 0x80 nanoslp syz-executor 59812 102227 7828 0 2 0x2 0xc80 syz-executor 7828 176400 65512 0 3 0x2 0x80 wait syz-executor 65512 15562 70250 0 3 0x100002 0x88 sigsusp ksh 70250 72962 63187 0 3 0x10 0x88 kqread sshd-session 63187 338468 73727 0 3 0x12 0x80 kqread sshd-session 270 325561 1 0 3 0x100003 0x80 ttyin getty 73727 372097 1 0 3 0 0x88 kqread sshd 82274 341356 54882 73 3 0x1100010 0x80 kqread syslogd 54882 82214 1 0 3 0x100002 0x80 sbwait syslogd-parent 34330 441379 1 0 3 0x100000 0x80 kqread resolvd 44717 210683 43505 77 3 0x100012 0x80 kqread dhcpleased 28478 288397 43505 77 3 0x100012 0x80 kqread dhcpleased 43505 295751 1 0 3 0 0x80 kqread dhcpleased 16700 161798 0 0 3 0x14000 0x200 bored smr 89283 335925 0 0 2 0x14000 0x200 zerothread 41042 226336 0 0 3 0x14000 0x200 aiodoned aiodoned 90855 454911 0 0 3 0x14000 0x200 syncer update 45737 349832 0 0 3 0x14000 0x200 cleaner cleaner 50392 194424 0 0 3 0x14000 0x200 reaper reaper 67283 84803 0 0 3 0x14000 0x200 pgdaemon pagedaemon 46880 312173 0 0 3 0x14000 0x200 bored viomb 71500 435786 0 0 3 0x14000 0x40000200 acpi0 acpi0 23387 272351 0 0 3 0x14000 0x200 bored softnet0 43256 407088 0 0 3 0x14000 0x200 bored systqmp 21335 202621 0 0 3 0x14000 0x200 bored systq 43082 498949 0 0 3 0x14000 0x40000200 tmoslp softclock 37239 216698 0 0 3 0x14000 0x40000200 idle0 1 439611 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 11036 12163K 12200K 166960K 12375 0 pcb 17 15K 16K 166960K 54 0 rtable 215 7K 8K 166960K 784 0 pf 31 13K 14K 166960K 70 0 ifaddr 40 7K 7K 166960K 101 0 ifgroup 51 2K 2K 166960K 113 0 sysctl 1 1K 9K 166960K 5 0 counters 34 17K 18K 166960K 55 0 ioctlops 0 0K 4K 166960K 156 0 iov 0 0K 8K 166960K 69 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1380 87K 87K 166960K 1718 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 7 0 VM map 2 1K 1K 166960K 2 0 sem 12 0K 0K 166960K 14 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1692 195K 286K 166960K 12472 0 file desc 16 57K 102K 166960K 510 0 sigio 0 0K 0K 166960K 5 0 proc 60 59K 83K 166960K 847 0 subproc 72 4K 4K 166960K 189 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 33 0 in_multi 89 6K 6K 166960K 241 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 15 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 67 307K 307K 166960K 67 0 exec 0 0K 1K 166960K 541 0 fusefs mount 1 32K 32K 166960K 1 0 pfkey data 0 0K 0K 166960K 1 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 215 144K 160K 166960K 5592 0 UVM aobj 13 2K 6K 166960K 17 0 pinsyscall 37 74K 93K 166960K 1901 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 11 0 NDP 11 0K 2K 166960K 69 0 temp 38 9119K 9182K 166960K 14779 0 kqueue 15 24K 26K 166960K 61 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 103 0 100 2 0 2 2 0 8 1 rtentry 136 246 0 146 4 0 4 4 0 8 0 unpcb 144 353 0 338 6 0 6 6 0 8 5 syncache 336 6 0 6 1 0 1 1 0 8 1 tcpqe 32 1 0 1 1 0 1 1 0 8 1 tcpcb 736 221 0 217 7 0 7 7 0 8 6 arp 96 42 0 26 1 0 1 1 0 8 0 ipq 40 3 0 0 1 0 1 1 0 8 0 ipqe 40 3 0 0 1 0 1 1 0 8 0 inpcb 328 642 0 632 15 6 9 15 0 8 8 ip6q 80 5 0 0 1 0 1 1 0 8 0 ip6af 40 5 0 0 1 0 1 1 0 8 0 nd6 112 60 0 39 1 0 1 1 0 8 0 pkpcb 40 4 0 4 1 0 1 1 0 8 1 kcovpl 48 21 0 13 1 0 1 1 0 8 0 ppxss 1072 9 0 8 1 0 1 1 0 8 0 pppxif 1424 1 0 0 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 993 0 575 32 0 32 32 0 8 1 art_table 40 994 0 575 6 0 6 6 0 8 0 art_node 32 244 0 153 1 0 1 1 0 8 0 sysvmsgpl 40 6 0 5 1 0 1 1 0 8 0 semapl 72 12 0 2 1 0 1 1 0 8 0 shmpl 120 12 0 2 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1963 0 473 94 0 94 94 0 8 0 ffsino 256 1963 0 473 94 0 94 94 0 8 0 nchpl 144 2432 0 677 66 0 66 66 0 8 0 rtmask 32 1 0 1 1 0 1 1 0 8 1 vnodes 216 2318 0 0 129 0 129 129 0 8 0 namei 1024 10281 0 10281 3 0 3 3 0 8 3 vcpupl 3968 12 0 12 2 0 2 2 0 8 2 vmpool 808 1 0 1 1 0 1 1 0 8 1 kstatmem 264 59 0 36 2 0 2 2 0 8 0 scsiplug 72 2 0 2 1 0 1 1 0 8 1 scxspl 216 10702 0 10702 3 0 3 3 1 8 3 plimitpl 152 68 0 51 1 0 1 1 0 8 0 sigapl 424 761 0 720 6 0 6 6 0 8 0 knotepl 120 21092 0 21039 24 7 17 17 0 8 15 kqueuepl 184 92 0 79 1 0 1 1 0 8 0 pipepl 304 180 0 153 3 0 3 3 0 8 0 fdescpl 448 748 0 720 5 0 5 5 0 8 1 filepl 120 4052 0 3838 13 0 13 13 0 8 4 lockfpl 104 89 0 86 1 0 1 1 0 8 0 lockfspl 48 42 0 39 1 0 1 1 0 8 0 sessionpl 144 75 0 67 1 0 1 1 0 8 0 pgrppl 48 97 0 81 1 0 1 1 0 8 0 ucredpl 104 346 0 335 1 0 1 1 0 8 0 zombiepl 144 722 0 720 1 0 1 1 0 8 0 processpl 1160 761 0 720 4 0 4 4 0 8 0 procpl 664 1103 0 1041 6 0 6 6 0 8 0 sockpl 552 1107 0 1079 14 4 10 14 0 8 7 mcl64k 65536 17 0 11 1 0 1 1 0 8 0 mcl16k 16384 9 0 9 1 0 1 1 0 8 1 mcl12k 12288 1 0 1 1 0 1 1 0 8 1 mcl8k 8192 16 0 16 1 0 1 1 0 8 1 mcl4k 4096 2816 0 2765 14 0 14 14 0 8 7 mcl2k 2048 457 0 455 3 0 3 3 0 8 2 mextrefs 64 190 0 189 1 0 1 1 0 8 0 mtagpl 96 4 0 4 1 0 1 1 0 8 1 mbufpl 256 8031 0 7866 19 0 19 19 0 8 5 bufpl 272 4034 0 86 264 0 264 264 0 8 0 anonpl 24 123815 0 117755 50 0 50 50 0 187 6 amapchunkpl 152 16318 0 15851 26 0 26 26 0 158 6 amappl16 200 2144 0 1963 17 3 14 14 0 8 0 amappl15 192 3 0 3 1 0 1 1 0 8 1 amappl14 184 539 0 537 1 0 1 1 0 8 0 amappl13 176 143 0 133 1 0 1 1 0 8 0 amappl12 168 1037 0 1011 2 0 2 2 0 8 0 amappl11 160 5 0 5 1 0 1 1 0 8 1 amappl10 152 59 0 50 1 0 1 1 0 8 0 amappl9 144 280 0 280 1 0 1 1 0 8 1 amappl8 136 134 0 133 1 0 1 1 0 8 0 amappl7 128 171 0 161 1 0 1 1 0 8 0 amappl6 120 187 0 185 1 0 1 1 0 8 0 amappl5 112 174 0 168 1 0 1 1 0 8 0 amappl4 104 323 0 308 1 0 1 1 0 8 0 amappl3 96 3216 0 3114 4 0 4 4 0 8 1 amappl2 88 478 0 428 2 0 2 2 0 8 0 amappl1 80 12180 0 11645 13 0 13 13 0 8 1 amappl 88 4709 0 4556 4 0 4 4 0 92 0 uvmvnodes 80 109 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 254 0 254 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 20 0 19 1 0 1 1 0 8 0 aobjpl 72 16 0 4 1 0 1 1 0 8 0 uaddrrnd 24 748 0 720 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 748 0 720 1 0 1 1 0 8 0 vmmpekpl 168 7408 0 7349 3 0 3 3 0 8 0 vmmpepl 168 57625 0 55784 89 0 89 89 0 357 7 vmsppl 368 747 0 720 4 0 4 4 0 8 1 rwobjpl 40 18813 0 17698 13 0 13 13 0 8 1 pdppl 4096 1504 0 1442 96 30 66 78 0 8 4 pvpl 32 336745 0 325036 123 0 123 123 0 265 22 pmappl 216 748 0 721 2 0 2 2 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 647 0 30 18 0 18 18 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(ffffffff834bee6c) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fe1cd,ffffffff83557c10,3bf,ffffffff835303db) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80003c50ec88,ffffffff834b6496) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80003c50ec80) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a726a68) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002a7ed730) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffff18076fc1eb0,81,fffff18007ffd3a8,ffff80002a726a68) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffff1806d569088,ffff80002a726a68) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffff1806d569088,ffff80002a726a68) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffff1806d569088,ffff80002a726a68) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffff1806d569088,ffff80002a726a68) at closef+0x190 sys/kern/kern_descrip.c:1265 syscall(ffff80002a7ed980) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a7ed980) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x69362adaa80, count: -13 ddb> machine ddbcpu 1 No such command ddb> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834bee6c) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fe1cd,ffffffff83557c10,3bf,ffffffff835303db) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80003c50ec88,ffffffff834b6496) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80003c50ec80) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a726a68) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002a7ed730) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffff18076fc1eb0,81,fffff18007ffd3a8,ffff80002a726a68) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffff1806d569088,ffff80002a726a68) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffff1806d569088,ffff80002a726a68) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffff1806d569088,ffff80002a726a68) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffff1806d569088,ffff80002a726a68) at closef+0x190 sys/kern/kern_descrip.c:1265 syscall(ffff80002a7ed980) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a7ed980) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x69362adaa80, count: -13