panic: kernel diagnostic assertion "refs != ~0" failed: file "/syzkaller/managers/multicore/kernel/sys/kern/kern_synch.c", line 959 Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 412371 3902 0 0 0 1 syz-executor *263003 4153 0 0 0x4000000 0K syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834b83b7) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff834f9176,ffffffff8350a9f2,3bf,ffffffff83533716) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80003c3cd280,ffffffff834afab0) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(ffff800034b9e000,ffff80003c3cd278) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(205b9a,81,2000,ffff80003c409250) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80003c3fb7b0) at spec_close+0x417 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffff100638bfa58,81,fffff100097fd478,ffff80003c409250) at VOP_CLOSE+0x132 sys/kern/vfs_vops.c:156 vn_closefile(fffff100666b7ed8,ffff80003c409250) at vn_closefile+0x12b vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffff100666b7ed8,ffff80003c409250) at vn_closefile+0x12b sys/kern/vfs_vnops.c:621 fdrop(fffff100666b7ed8,ffff80003c409250) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffff100666b7ed8,ffff80003c409250) at closef+0x192 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80003c409250,ffff80003c3fba80,ffff80003c3fb9d0) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff80003c3fba80) at syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c3fba80) at syscall+0xbd4 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9fe3017cd10, 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{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic *cpu0: kernel diagnostic assertion "refs != ~0" failed: file "/syzkaller/managers/multicore/kernel/sys/kern/kern_synch.c", line 959 ddb{0}> show kasan No such command ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834b83b7) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff834f9176,ffffffff8350a9f2,3bf,ffffffff83533716) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80003c3cd280,ffffffff834afab0) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(ffff800034b9e000,ffff80003c3cd278) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(205b9a,81,2000,ffff80003c409250) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80003c3fb7b0) at spec_close+0x417 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffff100638bfa58,81,fffff100097fd478,ffff80003c409250) at VOP_CLOSE+0x132 sys/kern/vfs_vops.c:156 vn_closefile(fffff100666b7ed8,ffff80003c409250) at vn_closefile+0x12b vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffff100666b7ed8,ffff80003c409250) at vn_closefile+0x12b sys/kern/vfs_vnops.c:621 fdrop(fffff100666b7ed8,ffff80003c409250) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffff100666b7ed8,ffff80003c409250) at closef+0x192 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80003c409250,ffff80003c3fba80,ffff80003c3fb9d0) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff80003c3fba80) at syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c3fba80) at syscall+0xbd4 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9fe3017cd10, count: -14 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80003c3fb570 rbx 0xffffffff83933e07 cpu_info_full_primary+0x2e07 rdx 0xffff800001604640 rcx 0xffff80003c409250 rax 0xffffffff83932ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x3101b1a774d4f5d0 r11 0x61000d8f409bb343 r12 0xffffffff83933c08 cpu_info_full_primary+0x2c08 r13 0 r14 0 r15 0x1 rip 0xffffffff8151ada5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80003c3fb560 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor) tid=263003 pid=4153 tcnt=3 stat=onproc flags process=0 proc=4000000 runpri=32, usrpri=50, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80003c409780,0xffff80003c408a98 process=0xffff80002a37d358 user=0xffff80003c3f6000, vmspace=0xfffff1006fbaf5c0 estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 68230 197961 67638 60929 2 0x10 0 syz-executor 68230 232041 67638 60929 3 0x10 0x4000080 fsleep syz-executor 3902 412371 71271 0 7 0 0 syz-executor 3902 232528 71271 0 3 0 0x4000080 piperd syz-executor 3902 190784 71271 0 2 0 0x4000000 syz-executor 90864 22846 28597 0 2 0 0 syz-executor 90864 306057 28597 0 3 0 0x4000080 fsleep syz-executor 4153 254009 63126 0 2 0 0 syz-executor 4153 140792 63126 0 3 0 0x4000000 smrbar syz-executor * 4153 263003 63126 0 7 0 0x4000000 syz-executor 63349 63258 28809 0 2 0 0 syz-executor 63349 120611 28809 0 3 0 0x4000080 fsleep syz-executor 21791 53475 52707 0 2 0 0 syz-executor 21791 290542 52707 0 3 0 0x4000080 fsleep syz-executor 66908 135997 76383 0 2 0x10 0 syz-executor 66908 354032 76383 0 3 0x10 0x4000080 pipewr syz-executor 66908 433232 76383 0 3 0x10 0x4000080 fsleep syz-executor 52686 100916 0 0 3 0x14000 0x200 acct acct 28809 24876 10604 0 2 0x2 0xc80 syz-executor 97015 1181 10604 0 2 0x2 0 syz-executor 63126 382808 10604 0 2 0x2 0xc80 syz-executor 76383 167946 10604 0 2 0x2 0xc80 syz-executor 67638 157799 10604 0 3 0x2 0x80 nanoslp syz-executor 28597 91325 10604 0 3 0x2 0x80 nanoslp syz-executor 52707 391943 10604 0 2 0x2 0xc80 syz-executor 71271 355021 10604 0 2 0x2 0xc80 syz-executor 10604 318029 60035 0 3 0x2 0x80 kqread syz-executor 60035 174197 30696 0 3 0x100002 0x88 sigsusp ksh 30696 446124 5084 0 3 0x10 0x88 kqread sshd-session 5084 434064 64605 0 3 0x12 0x80 kqread sshd-session 14101 258057 1 0 3 0x100003 0x80 ttyin getty 64605 429776 1 0 3 0 0x88 kqread sshd 73016 197086 34301 74 3 0x1100012 0x80 bpf pflogd 34301 149459 1 0 3 0 0x80 sbwait pflogd 47621 3233 21443 73 3 0x1100010 0x80 kqread syslogd 21443 121151 1 0 3 0x100002 0x80 sbwait syslogd 97789 243182 1 0 3 0x100000 0x80 kqread resolvd 14604 219224 93659 77 3 0x100012 0x80 kqread dhcpleased 94312 208975 93659 77 3 0x100012 0x80 kqread dhcpleased 93659 154945 1 0 3 0 0x80 kqread dhcpleased 71286 44510 0 0 3 0x14000 0x200 bored smr 15219 226544 0 0 2 0x14000 0x200 zerothread 59811 373398 0 0 3 0x14000 0x200 aiodoned aiodoned 86090 68033 0 0 3 0x14000 0x200 syncer update 86574 18120 0 0 3 0x14000 0x200 cleaner cleaner 85936 121292 0 0 3 0x14000 0x200 reaper reaper 44847 359164 0 0 3 0x14000 0x200 pgdaemon pagedaemon 33817 64626 0 0 3 0x14000 0x200 bored viomb 68611 451840 0 0 3 0x14000 0x40000200 acpi0 acpi0 87262 288872 0 0 3 0x14000 0x40000200 idle1 95126 485875 0 0 3 0x14000 0x200 bored softnet1 63356 178208 0 0 3 0x14000 0x200 bored softnet0 4222 331433 0 0 3 0x14000 0x200 bored systqmp 34164 313414 0 0 3 0x14000 0x200 bored systq 92987 298098 0 0 3 0x14000 0x200 tmoslp softclockmp 57387 265505 0 0 3 0x14000 0x40000200 tmoslp softclock 63248 141527 0 0 3 0x14000 0x40000200 idle0 1 177142 0 0 3 0x2 0x80 wait init 0 0 -1 0 3 0x10000 0x200 scheduler swapper ddb{0}> show all locks Process 4153 (syz-executor) thread 0xffff80003c409250 (263003) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff83af3f40) #0 witness_lock+0x5f1 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5f1 sys/kern/subr_witness.c:1160 #1 vn_closefile+0x41 sys/kern/vfs_vnops.c:614 #2 fdrop+0x121 sys/kern/kern_descrip.c:1281 #3 closef+0x192 sys/kern/kern_descrip.c:1265 #4 sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 #5 syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] #5 syscall+0xbd4 sys/arch/amd64/amd64/trap.c:783 #6 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 11072 12086K 12352K 166960K 12334 0 pcb 17 15K 16K 166960K 113 0 rtable 261 9K 9K 166960K 403 0 pf 41 18K 22K 166960K 57 0 ifaddr 46 7K 7K 166960K 48 0 ifgroup 64 2K 2K 166960K 64 0 sysctl 3 1K 9K 166960K 8 0 counters 76 37K 37K 166960K 76 0 ioctlops 0 0K 4K 166960K 1513 0 iov 1 1K 28K 166960K 10 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1357 85K 85K 166960K 1515 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 3 5K 5K 166960K 5 0 VM map 2 1K 1K 166960K 2 0 sem 11 0K 0K 166960K 77 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1734 201K 291K 166960K 11964 0 file desc 17 61K 93K 166960K 278 0 sigio 0 0K 0K 166960K 3 0 proc 72 115K 147K 166960K 568 0 subproc 72 4K 4K 166960K 72 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 100 7K 7K 166960K 108 0 ether_multi 1 0K 0K 166960K 1 0 mrt 1 0K 0K 166960K 7 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 73 334K 334K 166960K 73 0 exec 0 0K 1K 166960K 411 0 fusefs mount 1 32K 32K 166960K 1 0 pfkey data 0 0K 0K 166960K 2 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 236 160K 170K 166960K 4455 0 UVM aobj 6 2K 2K 166960K 6 0 pinsyscall 42 84K 106K 166960K 1464 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 12 0 NDP 14 0K 2K 166960K 30 0 temp 69 9126K 9130K 166960K 12080 0 kqueue 15 24K 28K 166960K 54 0 SYN cache 2 16K 16K 166960K 2 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 28 0 0 1 0 1 1 0 8 0 rtpcb 120 45 0 42 1 0 1 1 0 8 0 rtentry 176 113 0 1 6 0 6 6 0 8 0 unpcb 144 116 0 97 2 0 2 2 0 8 1 syncache 336 5 0 5 1 0 1 1 0 8 1 tcpcb 736 43 0 37 1 0 1 1 0 8 0 arp 136 18 0 0 1 0 1 1 0 8 0 inpcb 328 329 0 319 7 0 7 7 0 8 6 nd6 152 24 0 0 1 0 1 1 0 8 0 pkpcb 40 2 0 2 1 0 1 1 0 8 1 kcovpl 48 8 0 0 1 0 1 1 0 8 0 ppxss 1192 1 0 0 1 0 1 1 0 8 0 pppxif 1576 1 0 0 1 0 1 1 0 8 0 pfosfp 40 1428 0 1005 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfsrclim 320 1 0 0 1 0 1 1 0 8 0 pfanchor 1288 1 0 0 1 0 1 1 0 8 0 pfstitem 24 39 0 0 1 0 1 1 0 8 0 pfstkey 128 39 0 0 2 0 2 2 0 8 0 pfstate 448 39 0 0 5 0 5 5 0 8 0 pfrule 1360 22 0 15 2 0 2 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 490 0 0 31 0 31 31 0 8 0 art_table 40 491 0 0 5 0 5 5 0 8 0 art_node 32 113 0 11 1 0 1 1 0 8 0 sysvmsgpl 40 3 0 2 1 0 1 1 0 8 0 semapl 72 10 0 1 1 0 1 1 0 8 0 shmpl 112 3 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1817 0 350 93 0 93 93 0 8 0 ffsino 296 1817 0 350 114 0 114 114 0 8 0 nchpl 144 2225 0 521 64 0 64 64 0 8 0 vnodes 216 2020 0 0 113 0 113 113 0 8 0 namei 1024 6965 0 6965 2 0 2 2 0 8 2 percpumem 16 54 0 0 1 0 1 1 0 8 0 kstatmem 264 33 0 0 3 0 3 3 0 8 0 scxspl 216 7377 0 7377 4 3 1 3 1 8 1 plimitpl 152 51 0 34 1 0 1 1 0 8 0 sigapl 424 605 0 557 7 0 7 7 0 8 1 knotepl 120 311 0 0 10 0 10 10 0 8 0 kqueuepl 224 78 0 65 1 0 1 1 0 8 0 pipepl 344 138 0 109 3 0 3 3 0 8 0 fdescpl 528 588 0 557 3 0 3 3 0 8 0 filepl 160 2634 0 2410 16 0 16 16 0 8 5 lockfpl 104 37 0 34 1 0 1 1 0 8 0 lockfspl 48 19 0 16 1 0 1 1 0 8 0 sessionpl 144 28 0 19 1 0 1 1 0 8 0 pgrppl 48 38 0 21 1 0 1 1 0 8 0 ucredpl 104 245 0 230 1 0 1 1 0 8 0 zombiepl 144 557 0 557 1 0 1 1 0 8 1 processpl 1232 605 0 557 5 0 5 5 0 8 1 procpl 664 851 0 793 6 0 6 6 0 8 0 sosppl 176 1 0 1 1 0 1 1 0 8 1 sockpl 752 497 0 465 11 0 11 11 0 8 7 mcl64k 65536 4 0 0 1 0 1 1 0 8 0 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 122 0 0 16 0 16 16 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 17 0 0 3 0 3 3 0 8 0 mextrefs 64 17 0 0 1 0 1 1 0 8 0 mtagpl 96 2 0 0 1 0 1 1 0 8 0 mbufpl 256 144 0 0 9 0 9 9 0 8 0 bufpl 272 2618 0 106 168 0 168 168 0 8 0 anonpl 32 7524 0 0 61 0 61 61 0 247 0 amapchunkpl 152 12264 0 11780 23 0 23 23 0 158 3 amappl16 200 1118 0 1094 15 4 11 14 0 8 8 amappl15 192 16 0 16 2 2 0 1 0 8 0 amappl14 184 441 0 440 1 0 1 1 0 8 0 amappl13 176 186 0 174 1 0 1 1 0 8 0 amappl12 168 842 0 812 2 0 2 2 0 8 0 amappl11 160 10 0 10 2 2 0 1 0 8 0 amappl10 152 103 0 89 1 0 1 1 0 8 0 amappl9 144 298 0 296 1 0 1 1 0 8 0 amappl8 136 100 0 98 1 0 1 1 0 8 0 amappl7 128 148 0 134 1 0 1 1 0 8 0 amappl6 120 163 0 161 1 0 1 1 0 8 0 amappl5 112 99 0 89 1 0 1 1 0 8 0 amappl4 104 293 0 272 1 0 1 1 0 8 0 amappl3 96 2427 0 2312 4 0 4 4 0 8 0 amappl2 88 558 0 497 2 0 2 2 0 8 0 amappl1 80 11139 0 10534 15 0 15 15 0 8 2 amappl 88 3681 0 3517 5 0 5 5 0 92 1 uvmvnodes 80 103 0 0 3 0 3 3 0 8 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma128 128 253 0 253 1 1 0 1 0 8 0 dma64 64 6 0 6 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 72 5 0 0 1 0 1 1 0 8 0 uaddrrnd 24 588 0 557 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 588 0 557 1 0 1 1 0 8 0 vmmpekpl 168 6791 0 6755 2 0 2 2 0 8 0 vmmpepl 168 45621 0 43709 96 0 96 96 0 357 10 vmsppl 488 587 0 557 5 0 5 5 0 8 1 rwobjpl 80 15494 0 14458 27 0 27 27 0 8 5 pdppl 4096 1183 0 1114 103 32 71 87 0 8 2 pvpl 32 13580 0 0 110 0 110 110 0 265 0 pmappl 256 587 0 557 3 0 3 3 0 8 0 extentpl 40 46 0 28 1 0 1 1 0 8 0 phpool 112 446 0 34 12 0 12 12 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834b83b7) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff834f9176,ffffffff8350a9f2,3bf,ffffffff83533716) at __assert+0x29 sys/kern/subr_prf.c:-1 refcnt_finalize(ffff80003c3cd280,ffffffff834afab0) at refcnt_finalize+0x1e7 sys/kern/kern_synch.c:960 pppx_if_destroy(ffff800034b9e000,ffff80003c3cd278) at pppx_if_destroy+0x3d sys/net/if_pppx.c:794 pppxclose(205b9a,81,2000,ffff80003c409250) at pppxclose+0xa0 sys/net/if_pppx.c:541 spec_close(ffff80003c3fb7b0) at spec_close+0x417 sys/kern/spec_vnops.c:-1 VOP_CLOSE(fffff100638bfa58,81,fffff100097fd478,ffff80003c409250) at VOP_CLOSE+0x132 sys/kern/vfs_vops.c:156 vn_closefile(fffff100666b7ed8,ffff80003c409250) at vn_closefile+0x12b vn_close sys/kern/vfs_vnops.c:298 [inline] vn_closefile(fffff100666b7ed8,ffff80003c409250) at vn_closefile+0x12b sys/kern/vfs_vnops.c:621 fdrop(fffff100666b7ed8,ffff80003c409250) at fdrop+0x121 sys/kern/kern_descrip.c:1281 closef(fffff100666b7ed8,ffff80003c409250) at closef+0x192 sys/kern/kern_descrip.c:1265 sys_closefrom(ffff80003c409250,ffff80003c3fba80,ffff80003c3fb9d0) at sys_closefrom+0x13c sys/kern/kern_descrip.c:1471 syscall(ffff80003c3fba80) at syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c3fba80) at syscall+0xbd4 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9fe3017cd10, count: -14 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x27: addq $0x8,%rsp x86_ipi_db(ffff80002999dff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:394 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 end of kernel end trace frame: 0x719d333ea160, count: 12 ddb{1}> trace x86_ipi_db(ffff80002999dff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:394 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 end of kernel end trace frame: 0x719d333ea160, count: -3