panic: kernel diagnostic assertion "refs != ~0" failed: file "/syzkaller/managers/multicore/kernel/sys/kern/kern_synch.c", line 953 Stopped at db_enter+37: addq $8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 374380 43039 0 0 0 0 syz-executor db_enter() at db_enter+37 panic(ffffffff833956d0) at panic+485 __assert(ffffffff833d22f8,ffffffff833dddd1,3b9,ffffffff83407984) at __assert+41 refcnt_finalize(ffff8000fffe34f0,ffffffff8338dd6f) at refcnt_finalize+475 pppx_if_destroy(285b98,ffff8000fffe34e8) at pppx_if_destroy+61 pppxclose(285b98,1,2000,ffff8000fffeea78) at pppxclose+160 spec_close(ffff80003c01fe40) at spec_close+1047 VOP_CLOSE(fffffd806a80bc20,1,fffffd80097fb6e8,ffff8000fffeea78) at VOP_CLOSE+306 vn_closefile(fffffd805e644810,ffff8000fffeea78) at vn_closefile+299 fdrop(fffffd805e644810,ffff8000fffeea78) at fdrop+289 closef(fffffd805e644810,ffff8000fffeea78) at closef+402 fdfree(ffff8000fffeea78) at fdfree+278 exit1(ffff8000fffeea78,0,0,1) at exit1+1398 sys_exit(ffff8000fffeea78,ffff80003c0201b0,ffff80003c020100) at sys_exit+26 end trace frame: 0xffff80003c0201a0, count: 0 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{1}> ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic *cpu1: kernel diagnostic assertion "refs != ~0" failed: file "/syzkaller/managers/multicore/kernel/sys/kern/kern_synch.c", line 953 ddb{1}> trace db_enter() at db_enter+37 panic(ffffffff833956d0) at panic+485 __assert(ffffffff833d22f8,ffffffff833dddd1,3b9,ffffffff83407984) at __assert+41 refcnt_finalize(ffff8000fffe34f0,ffffffff8338dd6f) at refcnt_finalize+475 pppx_if_destroy(285b98,ffff8000fffe34e8) at pppx_if_destroy+61 pppxclose(285b98,1,2000,ffff8000fffeea78) at pppxclose+160 spec_close(ffff80003c01fe40) at spec_close+1047 VOP_CLOSE(fffffd806a80bc20,1,fffffd80097fb6e8,ffff8000fffeea78) at VOP_CLOSE+306 vn_closefile(fffffd805e644810,ffff8000fffeea78) at vn_closefile+299 fdrop(fffffd805e644810,ffff8000fffeea78) at fdrop+289 closef(fffffd805e644810,ffff8000fffeea78) at closef+402 fdfree(ffff8000fffeea78) at fdfree+278 exit1(ffff8000fffeea78,0,0,1) at exit1+1398 sys_exit(ffff8000fffeea78,ffff80003c0201b0,ffff80003c020100) at sys_exit+26 syscall(ffff80003c0201b0) at syscall+2839 Xsyscall() at Xsyscall+296 end of kernel end trace frame: 0x70db7d2de430, count: -16 ddb{1}> show registers rdi 0 rsi 1 rbp 18446603337227959312 rbx 18446603336919477727 rdx 0 rcx 18446603340516092536 rax 18446603336919474160 r8 72340172838076673 r9 9259542123273814144 r10 16823120144277593889 r11 4027354764980607135 r12 18446603336919477216 r13 0 r14 0 r15 1 rip 18446744071606658517 db_enter+37 cs 8 rflags 582 rsp 18446603337227959296 ss 16 db_enter+37: addq $8,%rsp ddb{1}> show proc PROC (syz-executor) tid=121433 pid=7212 tcnt=0 stat=onproc flags process=1008 proc=2000 runpri=32, usrpri=86, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0xffff8000fffeea78 scnt=-1 ecnt=1 forw=0xffffffffffffffff, list=0xffff8000fffef770,0xffff8000fffe5260 process=0xffff8000fffe8018 user=0xffff80003c01b000, vmspace=0xfffffd800b027d58 estcpu=36, cpticks=5, pctcpu=0.0, user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 3642 480640 94890 0 2 0 syz-executor 43039 374380 51323 0 7 0 syz-executor 43039 162947 51323 0 2 0x4000000 syz-executor 90723 365553 795 0 2 0 syz-executor 90723 313042 795 0 2 0x4000000 syz-executor 80006 485308 24583 0 2 0 syz-executor 80006 295628 24583 0 3 0x4000080 fsleep syz-executor 80006 516158 24583 0 3 0x4000080 fsleep syz-executor 80006 351465 24583 0 3 0x4000080 fsleep syz-executor 60044 403636 87134 0 3 0x80 nanoslp syz-executor 60044 135301 87134 0 3 0x4000000 smrbar syz-executor 60044 120984 87134 0 3 0x4000080 fsleep syz-executor 57448 168121 40132 0 3 0x80 nanoslp syz-executor 57448 465949 40132 0 3 0x4000080 fsleep syz-executor 57448 73095 40132 0 3 0x4000080 lockf syz-executor 22946 426473 1 0 3 0x100083 ttyopn getty 40132 61250 35450 0 3 0x82 nanoslp syz-executor 45922 217285 35450 0 3 0x82 nanoslp syz-executor 51323 302569 35450 0 3 0x82 nanoslp syz-executor 24583 391392 35450 0 3 0x82 nanoslp syz-executor 94890 420790 35450 0 2 0x2 syz-executor 10 444493 35450 0 3 0x82 nanoslp syz-executor 87134 134883 35450 0 3 0x82 nanoslp syz-executor 795 234743 35450 0 3 0x82 nanoslp syz-executor 35450 288762 35893 0 3 0x82 kqread syz-executor 35893 271673 8799 0 3 0x10008a sigsusp ksh 8799 6060 13543 0 3 0x98 kqread sshd-session 13543 248503 80011 0 3 0x92 kqread sshd-session 80011 155431 1 0 3 0x88 kqread sshd 34879 448805 88187 74 3 0x1100092 bpf pflogd 88187 194153 1 0 3 0x80 sbwait pflogd 27865 495971 30792 73 3 0x1100090 kqread syslogd 30792 472606 1 0 3 0x100082 sbwait syslogd 25321 108269 1 0 3 0x100080 kqread resolvd 70345 391245 50453 77 3 0x100092 kqread dhcpleased 86546 55748 50453 77 3 0x100092 kqread dhcpleased 50453 449240 1 0 3 0x80 kqread dhcpleased 47578 489683 0 0 3 0x14200 bored smr 93819 313273 0 0 3 0x14200 pgzero zerothread 98416 103764 0 0 3 0x14200 aiodoned aiodoned 77044 191089 0 0 3 0x14200 syncer update 12156 453742 0 0 3 0x14200 cleaner cleaner 39732 219930 0 0 3 0x14200 reaper reaper 32345 434683 0 0 3 0x14200 pgdaemon pagedaemon 61217 237189 0 0 3 0x14200 bored viomb 38474 351450 0 0 3 0x40014200 acpi0 acpi0 33980 335706 0 0 3 0x40014200 idle1 61160 12945 0 0 3 0x14200 bored softnet1 48509 275324 0 0 3 0x14200 bored softnet0 78116 409514 0 0 3 0x14200 bored systqmp 78129 45923 0 0 3 0x14200 bored systq 75993 449911 0 0 3 0x14200 tmoslp softclockmp 83543 140989 0 0 3 0x40014200 tmoslp softclock 92020 467048 0 0 3 0x40014200 idle0 1 292734 0 0 3 0x82 wait init 0 0 -1 0 3 0x10010200 scheduler swapper ddb{1}> show all locks ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10232 11044K 12390K 166960K 12365 0 pcb 17 16K 18K 166960K 256 0 rtable 246 10K 10K 166960K 486 0 pf 42 19K 67485K 166960K 193 0 ifaddr 44 7K 8K 166960K 87 0 ifgroup 62 2K 2K 166960K 149 0 sysctl 4 1K 9K 166960K 11 0 counters 76 37K 38K 166960K 158 0 ioctlops 0 0K 4K 166960K 1727 0 iov 0 0K 16K 166960K 124 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1522 96K 96K 166960K 2233 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 13 0 VM map 2 1K 1K 166960K 2 0 sem 12 0K 0K 166960K 52 0 dirhash 12 2K 2K 166960K 36 0 ACPI 1692 195K 286K 166960K 12470 0 file desc 18 65K 89K 166960K 1057 0 sigio 0 0K 0K 166960K 27 0 proc 73 115K 164K 166960K 650 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 2 0K 0K 166960K 113 0 in_multi 94 7K 7K 166960K 140 0 ether_multi 1 0K 0K 166960K 7 0 mrt 3 0K 0K 166960K 11 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 229 1023K 1023K 166960K 229 0 exec 0 0K 1K 166960K 576 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 251 168K 182K 166960K 11851 0 UVM aobj 59 10K 10K 166960K 62 0 pinsyscall 43 86K 100K 166960K 2198 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 90 0 NDP 14 0K 2K 166960K 57 0 temp 68 8657K 8731K 166960K 57773 0 kqueue 13 20K 30K 166960K 205 0 SYN cache 2 16K 16K 166960K 2 0 ddb{1}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 26 0 0 1 0 1 1 0 8 0 rtpcb 120 174 0 170 3 0 3 3 0 8 2 rtentry 176 139 0 37 6 0 6 6 0 8 0 unpcb 144 697 0 679 9 8 1 6 0 8 0 syncache 336 5 0 5 2 2 0 1 0 8 0 tcpcb 736 222 0 216 1 0 1 1 0 8 0 arp 136 22 0 2 1 0 1 1 0 8 0 inpcb 328 1067 0 1056 10 8 2 10 0 8 0 nd6 152 28 0 3 2 0 2 2 0 8 0 pkpcb 40 7 0 7 3 3 0 1 0 8 0 kcovpl 48 8 0 0 1 0 1 1 0 8 0 ppxss 1192 32 0 29 1 0 1 1 0 8 0 pppxif 1504 7 0 6 2 1 1 1 0 8 0 pfstscr 40 4 0 4 2 2 0 1 0 8 0 pffrag 232 50 0 42 1 0 1 1 0 482 0 pffrnode 88 49 0 41 1 0 1 1 0 8 0 pffrent 40 97 0 88 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 pfrktable 1344 1 0 1 1 1 0 1 0 8 0 pfstitem 24 88 0 24 1 0 1 1 0 8 0 pfstkey 128 94 0 30 3 0 3 3 0 8 0 pfstate 384 91 0 27 7 0 7 7 0 8 0 pfrule 1344 88 0 18 7 1 6 6 0 8 0 rttmr 136 1 0 1 1 1 0 1 0 8 0 art_heap8 4096 4 0 0 4 0 4 4 0 8 0 art_heap4 256 609 0 185 31 2 29 30 0 8 1 art_table 40 613 0 185 5 0 5 5 0 8 0 art_node 32 139 0 47 1 0 1 1 0 8 0 sysvmsgpl 40 7 0 5 2 1 1 1 0 8 0 semapl 112 48 0 38 1 0 1 1 0 8 0 shmpl 112 59 0 3 2 0 2 2 0 8 0 dirhash 1024 33 0 16 3 0 3 3 0 8 0 dino2pl 256 3388 0 1867 96 0 96 96 0 8 0 ffsino 296 3388 0 1867 118 0 118 118 0 8 0 nchpl 144 4974 0 3270 64 0 64 64 0 8 0 rtmask 32 5 0 5 2 1 1 1 0 8 1 vnodes 216 3949 0 0 220 0 220 220 0 8 0 namei 1024 18078 0 18078 2 0 2 2 0 8 2 percpumem 16 94 0 41 1 0 1 1 0 8 0 kstatmem 264 84 0 54 4 1 3 3 0 8 1 scsiplug 72 2 0 2 2 2 0 1 0 8 0 scxspl 216 29217 0 29217 12 10 2 8 1 8 2 plimitpl 152 296 0 278 1 0 1 1 0 8 0 sigapl 424 1371 0 1323 7 1 6 7 0 8 0 knotepl 120 461 0 0 14 0 14 14 0 8 0 kqueuepl 224 455 0 442 5 4 1 5 0 8 0 pipepl 344 237 0 210 6 3 3 6 0 8 0 fdescpl 528 1353 0 1321 3 0 3 3 0 8 0 filepl 160 9541 0 9314 27 12 15 21 0 8 4 lockfpl 104 619 0 615 2 1 1 2 0 8 0 lockfspl 48 199 0 196 1 0 1 1 0 8 0 sessionpl 144 25 0 16 1 0 1 1 0 8 0 pgrppl 48 61 0 44 1 0 1 1 0 8 0 ucredpl 104 1712 0 1697 1 0 1 1 0 8 0 zombiepl 144 1325 0 1323 1 0 1 1 0 8 0 processpl 1232 1371 0 1323 5 1 4 5 0 8 0 procpl 664 3018 0 2961 6 0 6 6 0 8 0 sosppl 176 12 0 12 1 1 0 1 0 8 0 sockpl 752 1964 0 1931 26 16 10 17 0 8 6 mcl64k 65536 19 0 0 3 0 3 3 0 8 0 mcl16k 16384 3 0 0 1 0 1 1 0 8 0 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl9k 9216 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 7 0 0 1 0 1 1 0 8 0 mcl4k 4096 135 0 0 17 0 17 17 0 8 0 mcl2k 2048 26 0 0 4 0 4 4 0 8 0 mtagpl 96 4 0 0 1 0 1 1 0 8 0 mbufpl 256 1855 0 0 115 0 115 115 0 8 0 bufpl 280 11463 0 5326 439 0 439 439 0 8 0 anonpl 32 11550 0 0 94 1 93 93 0 246 0 amapchunkpl 152 38614 0 38051 39 7 32 32 0 158 6 amappl16 200 5023 0 4904 24 10 14 20 0 8 3 amappl15 192 6 0 6 1 1 0 1 0 8 0 amappl14 184 10 0 8 1 0 1 1 0 8 0 amappl13 176 441 0 440 1 0 1 1 0 8 0 amappl12 168 1729 0 1685 3 1 2 3 0 8 0 amappl11 160 15 0 15 2 2 0 1 0 8 0 amappl10 152 66 0 52 1 0 1 1 0 8 0 amappl9 144 267 0 267 1 1 0 1 0 8 0 amappl8 136 49 0 46 1 0 1 1 0 8 0 amappl7 128 85 0 84 1 0 1 1 0 8 0 amappl6 120 277 0 262 1 0 1 1 0 8 0 amappl5 112 80 0 69 1 0 1 1 0 8 0 amappl4 104 443 0 414 1 0 1 1 0 8 0 amappl3 96 6802 0 6711 4 1 3 3 0 8 0 amappl2 88 1483 0 1406 2 0 2 2 0 8 0 amappl1 80 13451 0 12857 14 0 14 14 0 8 0 amappl 88 10943 0 10770 5 0 5 5 0 92 0 uvmvnodes 80 3949 0 0 81 0 81 81 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 254 0 254 2 2 0 1 0 8 0 dma64 64 8 0 8 3 3 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 61 0 3 2 0 2 2 0 8 0 uaddrrnd 24 1354 0 1322 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1354 0 1322 1 0 1 1 0 8 0 vmmpekpl 168 12566 0 12533 2 0 2 2 0 8 0 vmmpepl 168 92146 0 90082 105 8 97 102 0 357 4 vmsppl 488 1353 0 1322 5 1 4 5 0 8 0 rwobjpl 80 30867 0 25840 103 0 103 103 0 8 0 pdppl 4096 2715 0 2644 103 32 71 83 0 8 0 pvpl 32 19472 0 0 157 0 157 157 0 265 0 pmappl 256 1353 0 1322 3 0 3 3 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 389 0 38 11 0 11 11 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+39: addq $8,%rsp x86_ipi_db(ffffffff83803ff0) at x86_ipi_db+39 x86_ipi_handler() at x86_ipi_handler+217 Xresume_lapic_ipi() at Xresume_lapic_ipi+39 __mp_lock(ffffffff8393fce0) at __mp_lock+409 softintr_dispatch(0) at softintr_dispatch+293 dosoftint(0) at dosoftint+84 Xsoftclock() at Xsoftclock+39 end of kernel end trace frame: 0x70d726045700, count: 8 ddb{0}> trace x86_ipi_db(ffffffff83803ff0) at x86_ipi_db+39 x86_ipi_handler() at x86_ipi_handler+217 Xresume_lapic_ipi() at Xresume_lapic_ipi+39 __mp_lock(ffffffff8393fce0) at __mp_lock+409 softintr_dispatch(0) at softintr_dispatch+293 dosoftint(0) at dosoftint+84 Xsoftclock() at Xsoftclock+39 end of kernel end trace frame: 0x70d726045700, count: -7 ddb{0}> machine ddbcpu 1 Stopped at db_enter+37: addq $8,%rsp db_enter() at db_enter+37 panic(ffffffff833956d0) at panic+485 __assert(ffffffff833d22f8,ffffffff833dddd1,3b9,ffffffff83407984) at __assert+41 refcnt_finalize(ffff8000fffe34f0,ffffffff8338dd6f) at refcnt_finalize+475 pppx_if_destroy(285b98,ffff8000fffe34e8) at pppx_if_destroy+61 pppxclose(285b98,1,2000,ffff8000fffeea78) at pppxclose+160 spec_close(ffff80003c01fe40) at spec_close+1047 VOP_CLOSE(fffffd806a80bc20,1,fffffd80097fb6e8,ffff8000fffeea78) at VOP_CLOSE+306 vn_closefile(fffffd805e644810,ffff8000fffeea78) at vn_closefile+299 fdrop(fffffd805e644810,ffff8000fffeea78) at fdrop+289 closef(fffffd805e644810,ffff8000fffeea78) at closef+402 fdfree(ffff8000fffeea78) at fdfree+278 exit1(ffff8000fffeea78,0,0,1) at exit1+1398 sys_exit(ffff8000fffeea78,ffff80003c0201b0,ffff80003c020100) at sys_exit+26 end trace frame: 0xffff80003c0201a0, count: 0 ddb{1}> trace db_enter() at db_enter+37 panic(ffffffff833956d0) at panic+485 __assert(ffffffff833d22f8,ffffffff833dddd1,3b9,ffffffff83407984) at __assert+41 refcnt_finalize(ffff8000fffe34f0,ffffffff8338dd6f) at refcnt_finalize+475 pppx_if_destroy(285b98,ffff8000fffe34e8) at pppx_if_destroy+61 pppxclose(285b98,1,2000,ffff8000fffeea78) at pppxclose+160 spec_close(ffff80003c01fe40) at spec_close+1047 VOP_CLOSE(fffffd806a80bc20,1,fffffd80097fb6e8,ffff8000fffeea78) at VOP_CLOSE+306 vn_closefile(fffffd805e644810,ffff8000fffeea78) at vn_closefile+299 fdrop(fffffd805e644810,ffff8000fffeea78) at fdrop+289 closef(fffffd805e644810,ffff8000fffeea78) at closef+402 fdfree(ffff8000fffeea78) at fdfree+278 exit1(ffff8000fffeea78,0,0,1) at exit1+1398 sys_exit(ffff8000fffeea78,ffff80003c0201b0,ffff80003c020100) at sys_exit+26 syscall(ffff80003c0201b0) at syscall+2839 Xsyscall() at Xsyscall+296 end of kernel end trace frame: 0x70db7d2de430, count: -16