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 *445079 54246 0 0 0x4000000 0 syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834c1c56) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fdfa3,ffffffff8355cbab,3bf,ffffffff83535b0d) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a87b7a8,ffffffff834b5e55) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80002a87b7a0) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a7854e0) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002a7f1520) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffff9006dc73b18,81,fffff90007ffd958,ffff80002a7854e0) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffff9006e5002e0,ffff80002a7854e0) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffff9006e5002e0,ffff80002a7854e0) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffff9006e5002e0,ffff80002a7854e0) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffff9006e5002e0,ffff80002a7854e0) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002a7854e0,ffff80002a7f17e0,ffff80002a7f1730) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff80002a7f17e0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a7f17e0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7dda03ebcc0, 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(ffffffff834c1c56) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fdfa3,ffffffff8355cbab,3bf,ffffffff83535b0d) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a87b7a8,ffffffff834b5e55) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80002a87b7a0) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a7854e0) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002a7f1520) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffff9006dc73b18,81,fffff90007ffd958,ffff80002a7854e0) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffff9006e5002e0,ffff80002a7854e0) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffff9006e5002e0,ffff80002a7854e0) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffff9006e5002e0,ffff80002a7854e0) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffff9006e5002e0,ffff80002a7854e0) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002a7854e0,ffff80002a7f17e0,ffff80002a7f1730) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff80002a7f17e0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a7f17e0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7dda03ebcc0, count: -14 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80002a7f12f0 rbx 0x1 rdx 0 rcx 0 rax 0xffff80002a7854e0 r8 0x101010101010101 r9 0x8080808080808080 r10 0xf245422f9234feae r11 0x6f0ca8451f1e2d13 r12 0 r13 0 r14 0 r15 0x1 rip 0xffffffff827d6da5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a7f12e0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb> show proc PROC (syz-executor) tid=445079 pid=54246 tcnt=4 stat=onproc flags process=0 proc=4000000 runpri=32, usrpri=82, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80002a77ba08,0xffff80002a785258 process=0xffff80002a77f670 user=0xffff80002a7ec000, vmspace=0xfffff9000e0558b8 estcpu=32, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 32124 263160 68175 0 2 0x100000 0 sh 54559 145995 96061 0 2 0x2 0 sh 68175 510863 22263 0 3 0x100002 0x88 sigsusp sh 54246 139516 93927 0 2 0 0 syz-executor 54246 346051 93927 0 3 0 0x4000000 smrbar syz-executor *54246 445079 93927 0 7 0 0x4000000 syz-executor 54246 214327 93927 0 3 0 0x4000080 fsleep syz-executor 41422 333389 57274 0 3 0x2 0x80 piperd syz-executor 42939 200318 57274 0 3 0x2 0x80 piperd syz-executor 22263 193298 57274 0 3 0x2 0x80 wait syz-executor 96061 251045 57274 0 3 0x2 0x80 wait syz-executor 93927 25686 57274 0 2 0x2 0xc80 syz-executor 12783 261571 57274 0 3 0x2 0x80 piperd syz-executor 57012 339463 1 0 3 0x100003 0x80 ttyin getty 3245 188160 57274 0 3 0x2 0x80 piperd syz-executor 57274 397794 8820 0 3 0x2 0x80 nanoslp syz-executor 8820 467992 72471 0 3 0x100002 0x88 sigsusp ksh 72471 202100 71416 0 3 0x10 0x88 kqread sshd-session 71416 31170 4209 0 3 0x12 0x80 kqread sshd-session 4209 132096 1 0 3 0 0x88 kqread sshd 45756 442035 23695 73 3 0x1100010 0x80 kqread syslogd 23695 12152 1 0 3 0x100002 0x80 sbwait syslogd-parent 59744 341238 1 0 3 0x100000 0x80 kqread resolvd 51564 399508 76857 77 3 0x100012 0x80 kqread dhcpleased 25511 253819 76857 77 3 0x100012 0x80 kqread dhcpleased 76857 74576 1 0 3 0 0x80 kqread dhcpleased 37910 39847 0 0 3 0x14000 0x200 bored smr 55495 164959 0 0 2 0x14000 0x200 zerothread 65248 504823 0 0 3 0x14000 0x200 aiodoned aiodoned 98835 361585 0 0 3 0x14000 0x200 syncer update 68627 518162 0 0 3 0x14000 0x200 cleaner cleaner 5304 74912 0 0 3 0x14000 0x200 reaper reaper 12947 175070 0 0 3 0x14000 0x200 pgdaemon pagedaemon 28059 484878 0 0 3 0x14000 0x200 bored viomb 79217 251604 0 0 3 0x14000 0x40000200 acpi0 acpi0 72606 289118 0 0 3 0x14000 0x200 bored softnet0 24069 261342 0 0 3 0x14000 0x200 smrbar systqmp 87933 439235 0 0 3 0x14000 0x200 bored systq 30147 107258 0 0 3 0x14000 0x40000200 tmoslp softclock 90875 99572 0 0 3 0x14000 0x40000200 idle0 1 219764 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 11032 12098K 12661K 166960K 12635 0 pcb 17 12K 12K 166960K 40 0 rtable 209 6K 7K 166960K 1344 0 pf 35 14K 16K 166960K 115 0 ifaddr 40 7K 7K 166960K 179 0 ifgroup 51 2K 2K 166960K 189 0 sysctl 1 1K 9K 166960K 6 0 counters 34 17K 17K 166960K 71 0 ioctlops 0 0K 4K 166960K 101 0 iov 0 0K 12K 166960K 5 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1329 84K 84K 166960K 1898 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 8 0K 1K 166960K 11 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1692 195K 286K 166960K 12472 0 file desc 13 45K 89K 166960K 738 0 sigio 0 0K 0K 166960K 3 0 proc 59 59K 91K 166960K 1389 0 subproc 63 3K 4K 166960K 351 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 11 0 in_multi 89 6K 6K 166960K 447 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 17 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 781 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 170 138K 149K 166960K 6580 0 UVM aobj 71 3K 3K 166960K 71 0 pinsyscall 34 68K 93K 166960K 2650 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 1 0 NDP 21 1K 2K 166960K 126 0 temp 34 9122K 9186K 166960K 9144 0 kqueue 14 22K 24K 166960K 53 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 105 0 102 1 0 1 1 0 8 0 rtentry 136 454 0 354 4 0 4 4 0 8 0 unpcb 144 187 0 172 1 0 1 1 0 8 0 syncache 336 8 0 8 1 0 1 1 0 8 1 tcpcb 736 69 0 32 4 0 4 4 0 8 0 arp 96 81 0 64 1 0 1 1 0 8 0 inpcb 328 319 0 279 4 0 4 4 0 8 0 nd6 112 116 0 96 1 0 1 1 0 8 0 pkpcb 40 3 0 3 1 0 1 1 0 8 1 kcovpl 48 39 0 32 1 0 1 1 0 8 0 ppxss 1072 6 0 5 1 0 1 1 0 8 0 pppxif 1424 1 0 0 1 0 1 1 0 8 0 pfstscr 40 4 0 0 1 0 1 1 0 8 0 pffrag 232 3 0 1 1 0 1 1 0 482 0 pffrnode 88 3 0 1 1 0 1 1 0 8 0 pffrent 40 5 0 3 1 0 1 1 0 8 0 pfsrclim 320 1 0 1 1 0 1 1 0 8 1 pftag 88 1 0 0 1 0 1 1 0 8 0 pfqueue 320 1 0 0 1 0 1 1 0 8 0 pfstitem 24 4 0 0 1 0 1 1 0 8 0 pfstkey 128 4 0 0 1 0 1 1 0 8 0 pfstate 384 2 0 0 1 0 1 1 0 8 0 pfrule 1360 4 0 3 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 1848 0 1376 33 1 32 33 0 8 2 art_table 40 1849 0 1376 6 0 6 6 0 8 1 art_node 32 454 0 349 1 0 1 1 0 8 0 sysvmsgpl 40 3 0 1 1 0 1 1 0 8 0 semapl 72 8 0 2 1 0 1 1 0 8 0 shmpl 120 68 0 0 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1926 0 397 96 0 96 96 0 8 0 ffsino 256 1926 0 397 96 0 96 96 0 8 0 nchpl 144 2320 0 515 67 0 67 67 0 8 0 vnodes 216 2420 0 0 135 0 135 135 0 8 0 namei 1024 11500 0 11500 3 0 3 3 0 8 3 kstatmem 264 97 0 74 2 0 2 2 0 8 0 scxspl 216 7561 0 7561 8 0 8 8 1 8 8 plimitpl 152 112 0 97 1 0 1 1 0 8 0 sigapl 424 968 0 930 6 0 6 6 0 8 1 knotepl 120 7021 0 6973 17 5 12 17 0 8 8 kqueuepl 184 116 0 106 3 0 3 3 0 8 2 pipepl 304 225 0 198 3 0 3 3 0 8 0 fdescpl 448 955 0 930 5 0 5 5 0 8 1 filepl 120 3624 0 3399 9 0 9 9 0 8 0 lockfpl 104 83 0 80 1 0 1 1 0 8 0 lockfspl 48 34 0 31 1 0 1 1 0 8 0 sessionpl 144 61 0 53 1 0 1 1 0 8 0 pgrppl 48 100 0 85 1 0 1 1 0 8 0 ucredpl 104 392 0 381 1 0 1 1 0 8 0 zombiepl 144 930 0 930 1 0 1 1 0 8 1 processpl 1160 968 0 930 4 0 4 4 0 8 0 procpl 664 1233 0 1192 5 0 5 5 0 8 0 sosppl 176 5 0 5 1 0 1 1 0 8 1 sockpl 552 655 0 597 5 0 5 5 0 8 0 mcl64k 65536 10 0 10 1 0 1 1 0 8 1 mcl16k 16384 1 0 1 1 0 1 1 0 8 1 mcl8k 8192 20 0 20 1 0 1 1 0 8 1 mcl4k 4096 2717 0 2665 15 0 15 15 0 8 8 mcl2k2 2112 1 0 1 1 0 1 1 0 8 1 mcl2k 2048 776 0 773 4 0 4 4 0 8 3 mextrefs 64 211 0 210 1 0 1 1 0 8 0 mtagpl 96 4 0 4 1 0 1 1 0 8 1 mbufpl 256 8322 0 8199 17 0 17 17 0 8 6 bufpl 272 2500 0 88 161 0 161 161 0 8 0 anonpl 24 122054 0 119415 49 0 49 49 0 187 22 amapchunkpl 152 17564 0 17264 21 0 21 21 0 158 6 amappl16 200 1671 0 1661 28 17 11 14 0 8 8 amappl15 192 1 0 1 1 0 1 1 0 8 1 amappl14 184 766 0 764 1 0 1 1 0 8 0 amappl13 176 229 0 219 1 0 1 1 0 8 0 amappl12 168 1309 0 1287 2 0 2 2 0 8 0 amappl11 160 2 0 2 1 0 1 1 0 8 1 amappl10 152 81 0 73 1 0 1 1 0 8 0 amappl9 144 297 0 297 1 0 1 1 0 8 1 amappl8 136 209 0 208 1 0 1 1 0 8 0 amappl7 128 209 0 199 1 0 1 1 0 8 0 amappl6 120 301 0 298 1 0 1 1 0 8 0 amappl5 112 258 0 252 1 0 1 1 0 8 0 amappl4 104 368 0 354 1 0 1 1 0 8 0 amappl3 96 3747 0 3673 4 0 4 4 0 8 1 amappl2 88 569 0 520 2 0 2 2 0 8 0 amappl1 80 14740 0 14227 13 0 13 13 0 8 1 amappl 88 5369 0 5259 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 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 70 0 0 2 0 2 2 0 8 0 uaddrrnd 24 955 0 930 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 955 0 930 1 0 1 1 0 8 0 vmmpekpl 168 8794 0 8749 3 0 3 3 0 8 0 vmmpepl 168 69578 0 68150 91 0 91 91 0 357 20 vmsppl 368 954 0 930 4 0 4 4 0 8 1 rwobjpl 40 22131 0 21213 13 0 13 13 0 8 0 pdppl 4096 1916 0 1860 122 54 68 78 0 8 12 pvpl 32 364048 0 357296 111 0 111 111 0 265 34 pmappl 216 954 0 930 2 0 2 2 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 572 0 55 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(ffffffff834c1c56) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fdfa3,ffffffff8355cbab,3bf,ffffffff83535b0d) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a87b7a8,ffffffff834b5e55) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80002a87b7a0) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a7854e0) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002a7f1520) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffff9006dc73b18,81,fffff90007ffd958,ffff80002a7854e0) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffff9006e5002e0,ffff80002a7854e0) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffff9006e5002e0,ffff80002a7854e0) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffff9006e5002e0,ffff80002a7854e0) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffff9006e5002e0,ffff80002a7854e0) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002a7854e0,ffff80002a7f17e0,ffff80002a7f1730) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff80002a7f17e0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a7f17e0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7dda03ebcc0, 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(ffffffff834c1c56) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834fdfa3,ffffffff8355cbab,3bf,ffffffff83535b0d) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80002a87b7a8,ffffffff834b5e55) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(285b9a,ffff80002a87b7a0) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(285b9a,81,2000,ffff80002a7854e0) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80002a7f1520) at spec_close+0x426 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffff9006dc73b18,81,fffff90007ffd958,ffff80002a7854e0) at VOP_CLOSE+0x129 sys/kern/vfs_vops.c:156 vn_closefile(fffff9006e5002e0,ffff80002a7854e0) at vn_closefile+0x11d vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffff9006e5002e0,ffff80002a7854e0) at vn_closefile+0x11d sys/kern/vfs_vnops.c:621 fdrop(fffff9006e5002e0,ffff80002a7854e0) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffff9006e5002e0,ffff80002a7854e0) at closef+0x190 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80002a7854e0,ffff80002a7f17e0,ffff80002a7f1730) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff80002a7f17e0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a7f17e0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7dda03ebcc0, count: -14