login: 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 *271973 79547 0 0x1000 0x4080000 0K syz-executor db_enter() at db_enter+37 panic(ffffffff833959d9) at panic+485 __assert(ffffffff833d5dca,ffffffff833e1a34,3b9,ffffffff8340b62e) at __assert+41 refcnt_finalize(ffff80003c457520,ffffffff8338931c) at refcnt_finalize+475 pppx_if_destroy(285b9a,ffff80003c457518) at pppx_if_destroy+61 pppxclose(285b9a,41,2000,ffff80003a7fbcc0) at pppxclose+160 spec_close(ffff80002a380720) at spec_close+1047 VOP_CLOSE(fffffd80613826d8,41,fffffd80097fb6e8,ffff80003a7fbcc0) at VOP_CLOSE+306 vn_closefile(fffffd806cb8a708,ffff80003a7fbcc0) at vn_closefile+299 fdrop(fffffd806cb8a708,ffff80003a7fbcc0) at fdrop+289 dofilereadv(ffff80003a7fbcc0,6,ffff80002a380970,0,ffff80002a380a30) at dofilereadv+1230 sys_readv(ffff80003a7fbcc0,ffff80002a380ae0,ffff80002a380a30) at sys_readv+216 syscall(ffff80002a380ae0) at syscall+3028 Xsyscall() at Xsyscall+296 end of kernel end trace frame: 0x5da49946690, 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 953 ddb{0}> trace db_enter() at db_enter+37 panic(ffffffff833959d9) at panic+485 __assert(ffffffff833d5dca,ffffffff833e1a34,3b9,ffffffff8340b62e) at __assert+41 refcnt_finalize(ffff80003c457520,ffffffff8338931c) at refcnt_finalize+475 pppx_if_destroy(285b9a,ffff80003c457518) at pppx_if_destroy+61 pppxclose(285b9a,41,2000,ffff80003a7fbcc0) at pppxclose+160 spec_close(ffff80002a380720) at spec_close+1047 VOP_CLOSE(fffffd80613826d8,41,fffffd80097fb6e8,ffff80003a7fbcc0) at VOP_CLOSE+306 vn_closefile(fffffd806cb8a708,ffff80003a7fbcc0) at vn_closefile+299 fdrop(fffffd806cb8a708,ffff80003a7fbcc0) at fdrop+289 dofilereadv(ffff80003a7fbcc0,6,ffff80002a380970,0,ffff80002a380a30) at dofilereadv+1230 sys_readv(ffff80003a7fbcc0,ffff80002a380ae0,ffff80002a380a30) at sys_readv+216 syscall(ffff80002a380ae0) at syscall+3028 Xsyscall() at Xsyscall+296 end of kernel end trace frame: 0x5da49946690, count: -14 ddb{0}> show registers rdi 0 rsi 1 rbp 18446603336929510640 rbx 18446744071621397983 cpu_info_full_primary+11743 rdx 0 rcx 18446603337202646208 rax 18446744071621394416 cpu_info_full_primary+8176 r8 72340172838076673 r9 9259542123273814144 r10 9417367720657059620 r11 15295896525747338384 r12 18446744071621397472 cpu_info_full_primary+11232 r13 0 r14 0 r15 1 rip 18446744071600597781 db_enter+37 cs 8 rflags 582 rsp 18446603336929510624 ss 16 db_enter+37: addq $8,%rsp ddb{0}> show proc PROC (syz-executor) tid=271973 pid=79547 tcnt=5 stat=onproc flags process=1000 proc=4080000 runpri=23, usrpri=86, slppri=23, nice=20 wchan=0x0, wmesg=, ps_single=0xffff8000377ef250 scnt=4 ecnt=0 forw=0xffffffffffffffff, list=0xffff80003a7fa2d0,0xffff80003a7fb7a0 process=0xffff8000377f04f0 user=0xffff80002a37b000, vmspace=0xfffffd806c046b90 estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 80412 405155 42076 0 2 0 syz-executor 80412 203650 42076 0 3 0x4000080 fsleep syz-executor 49124 432302 40714 0 2 0 syz-executor 49124 266491 40714 0 3 0x4000080 fsleep syz-executor 50627 407414 40662 0 2 0 syz-executor 50627 70896 40662 0 3 0x4000080 fsleep syz-executor 28083 474159 18240 0 2 0 syz-executor 28083 473670 18240 0 3 0x4000080 fsleep syz-executor 62917 20931 0 0 3 0x14200 acct acct 79547 437502 53747 0 3 0x3000 suspend syz-executor 79547 306376 53747 0 2 0x4081080 syz-executor *79547 271973 53747 0 7 0x4081000 syz-executor 79547 64828 53747 0 3 0x4081000 smrbar syz-executor 79547 16996 53747 0 2 0x4081000 syz-executor 75451 222087 1 0 3 0x100083 ttyin getty 94910 396505 58648 0 3 0x82 nanoslp syz-executor 18240 271633 58648 0 2 0xc82 syz-executor 40662 121975 58648 0 2 0xc82 syz-executor 53747 483573 58648 0 3 0x82 nanoslp syz-executor 93556 184493 58648 0 2 0x2 syz-executor 40714 266162 58648 0 3 0x82 nanoslp syz-executor 3128 511995 13453 0 3 0x100082 sbwait arp 13453 276218 1 0 3 0x10008a sigsusp sh 42076 499412 58648 0 3 0x82 nanoslp syz-executor 43763 109173 58648 0 3 0x82 nanoslp syz-executor 58648 130379 3461 0 3 0x82 kqread syz-executor 3461 387779 41698 0 3 0x10008a sigsusp ksh 41698 236732 85036 0 3 0x98 kqread sshd-session 85036 8863 59788 0 3 0x92 kqread sshd-session 59788 172366 1 0 3 0x88 kqread sshd 98459 175570 62003 74 3 0x1100092 bpf pflogd 62003 447644 1 0 3 0x80 sbwait pflogd 87323 200366 73250 73 3 0x1100090 kqread syslogd 73250 347757 1 0 3 0x100082 sbwait syslogd 87062 268494 1 0 3 0x100080 kqread resolvd 51636 508833 65215 77 3 0x100092 kqread dhcpleased 28531 19667 65215 77 3 0x100092 kqread dhcpleased 65215 436609 1 0 3 0x80 kqread dhcpleased 30071 258991 0 0 3 0x14200 bored smr 33620 439569 0 0 2 0x14200 zerothread 90000 185260 0 0 3 0x14200 aiodoned aiodoned 51355 443299 0 0 3 0x14200 syncer update 81489 514501 0 0 3 0x14200 cleaner cleaner 8405 483830 0 0 3 0x14200 reaper reaper 13526 323207 0 0 3 0x14200 pgdaemon pagedaemon 659 86072 0 0 3 0x14200 bored viomb 93914 164925 0 0 3 0x40014200 acpi0 acpi0 16378 396864 0 0 7 0x40014200 idle1 37215 100991 0 0 3 0x14200 bored softnet1 95478 402066 0 0 3 0x14200 bored softnet0 50970 123531 0 0 3 0x14200 smrbar systqmp 58616 408046 0 0 3 0x14200 bored systq 64733 162182 0 0 3 0x14200 tmoslp softclockmp 94625 425424 0 0 3 0x40014200 tmoslp softclock 73267 74168 0 0 3 0x40014200 idle0 1 137317 0 0 3 0x82 wait init 0 0 -1 0 3 0x10010200 scheduler swapper ddb{0}> show all locks Process 79547 (syz-executor) thread 0xffff80003a7fbcc0 (271973) Process 50970 (systqmp) thread 0xffff8000ffffe7c8 (123531) ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10243 11058K 14393K 166960K 17081 0 pcb 17 15K 16K 166960K 783 0 rtable 261 16K 17K 166960K 1336 0 pf 44 19K 67487K 166960K 537 0 ifaddr 46 9K 10K 166960K 314 0 ifgroup 64 2K 3K 166960K 560 0 sysctl 4 1K 9K 166960K 92 0 counters 74 37K 38K 166960K 630 0 ioctlops 0 0K 4K 166960K 2421 0 iov 1 0K 28K 166960K 245 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1622 102K 102K 166960K 5758 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 2K 10K 166960K 46 0 VM map 2 1K 1K 166960K 2 0 sem 27 29K 29K 166960K 280 0 dirhash 15 2K 3K 166960K 117 0 ACPI 1692 195K 286K 166960K 12470 0 file desc 19 69K 248K 166960K 3862 0 sigio 0 0K 0K 166960K 160 0 proc 74 115K 164K 166960K 1274 0 subproc 81 5K 5K 166960K 191 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 749 0 in_multi 85 6K 7K 166960K 382 0 ether_multi 1 0K 0K 166960K 43 0 mrt 1 0K 0K 166960K 34 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 253 1129K 1129K 166960K 253 0 exec 0 0K 1K 166960K 1291 0 fusefs mount 1 32K 32K 166960K 1 0 pfkey data 0 0K 0K 166960K 10 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 266 178K 198K 166960K 34443 0 UVM aobj 49 2K 3K 166960K 54 0 pinsyscall 45 90K 104K 166960K 5265 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 1K 166960K 400 0 NDP 14 0K 1K 166960K 233 0 temp 152 8661K 8917K 166960K 199477 0 kqueue 15 24K 36K 166960K 797 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 26 0 0 1 0 1 1 0 8 0 rtpcb 120 531 0 527 5 4 1 3 0 8 0 rtentry 176 426 0 331 5 0 5 5 0 8 0 unpcb 144 2914 0 2897 17 16 1 6 0 8 0 syncache 336 11 0 11 4 4 0 1 0 8 0 tcpqe 32 2 0 2 1 1 0 1 0 8 0 tcpcb 736 1557 0 1551 29 28 1 7 0 8 0 arp 136 57 0 42 1 0 1 1 0 8 0 inpcb 328 4985 0 4976 31 26 5 12 0 8 3 nd6 152 66 0 44 1 0 1 1 0 8 0 pkpcb 40 39 0 39 5 4 1 1 0 8 1 kcovpl 48 21 0 12 1 0 1 1 0 8 0 mppekey 1024 3 0 3 3 3 0 1 0 8 0 ppxss 1192 225 0 224 2 1 1 1 0 8 0 pppxif 1504 20 0 19 8 7 1 1 0 8 0 pfstscr 40 3 0 3 2 2 0 1 0 8 0 pffrag 232 139 0 126 2 0 2 2 0 482 0 pffrnode 88 56 0 45 1 0 1 1 0 8 0 pffrent 40 277 0 263 1 0 1 1 0 8 0 pfosfp 40 1429 0 1005 5 0 5 5 0 8 0 pfosfpen 112 1429 0 714 21 0 21 21 0 8 0 pfrktable 1344 5 0 4 1 0 1 1 0 8 0 pfanchor 1288 1 0 0 1 0 1 1 0 8 0 pftag 88 3 0 0 1 0 1 1 0 8 0 pfstitem 24 219 0 125 1 0 1 1 0 8 0 pfstkey 128 221 0 127 4 0 4 4 0 8 0 pfstate 384 219 0 127 11 0 11 11 0 8 0 pfrule 1344 30 0 24 2 1 1 2 0 8 0 rttmr 136 6 0 6 4 4 0 1 0 8 0 art_heap8 4096 7 0 1 6 0 6 6 0 8 0 art_heap4 256 1637 0 1220 41 10 31 33 0 8 1 art_table 40 1644 0 1221 6 0 6 6 0 8 0 art_node 32 355 0 273 1 0 1 1 0 8 0 sysvmsgpl 40 25 0 21 1 0 1 1 0 8 0 semupl 112 2 0 2 2 2 0 1 0 8 0 semapl 112 272 0 247 1 0 1 1 0 8 0 shmpl 112 51 0 5 2 0 2 2 0 8 0 dirhash 1024 87 0 68 3 0 3 3 0 8 0 dino2pl 256 9006 0 7471 97 0 97 97 0 8 0 ffsino 296 9006 0 7471 119 0 119 119 0 8 0 nchpl 144 14178 0 12445 65 0 65 65 0 8 0 rtmask 32 52 0 52 3 2 1 1 0 8 1 vnodes 216 5926 0 0 330 0 330 330 0 8 0 namei 1024 51877 0 51876 2 1 1 1 0 8 0 percpumem 16 330 0 278 1 0 1 1 0 8 0 kstatmem 264 386 0 354 4 1 3 3 0 8 0 acpiwqpl 32 1 0 1 1 0 1 1 1 8 1 scsiplug 72 18 0 18 3 3 0 1 0 8 0 scxspl 216 91633 0 91633 10 9 1 3 1 8 1 plimitpl 152 747 0 729 1 0 1 1 0 8 0 sigapl 424 4095 0 4045 8 0 8 8 0 8 0 knotepl 120 748 0 0 22 0 22 22 0 8 0 kqueuepl 224 1970 0 1956 17 15 2 5 0 8 0 pipepl 344 599 0 569 14 10 4 9 0 8 1 fdescpl 528 4046 0 4013 3 0 3 3 0 8 0 filepl 160 31896 0 31664 37 23 14 22 0 8 0 lockfpl 104 2169 0 2166 5 4 1 2 0 8 0 lockfspl 48 809 0 806 1 0 1 1 0 8 0 sessionpl 144 44 0 35 1 0 1 1 0 8 0 pgrppl 48 130 0 112 1 0 1 1 0 8 0 ucredpl 104 5866 0 5852 1 0 1 1 0 8 0 zombiepl 144 4205 0 4202 1 0 1 1 0 8 0 processpl 1232 4095 0 4045 6 1 5 6 0 8 0 procpl 664 10003 0 9944 8 1 7 8 0 8 0 sosppl 176 33 0 33 4 3 1 1 0 8 1 sockpl 752 8599 0 8569 58 49 9 18 0 8 5 mcl64k 65536 38 0 0 5 0 5 5 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 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 116 0 0 14 0 14 14 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 80 0 0 6 0 6 6 0 8 0 mtagpl 96 41 0 0 1 0 1 1 0 8 0 mbufpl 256 1459 0 0 92 1 91 91 0 8 0 bufpl 280 37059 0 30922 439 0 439 439 0 8 0 anonpl 32 23739 0 0 191 0 191 191 0 246 0 amapchunkpl 152 124405 0 123770 67 35 32 42 0 158 1 amappl16 200 13743 0 13440 81 50 31 59 0 8 0 amappl15 192 6 0 6 1 1 0 1 0 8 0 amappl14 184 7 0 7 1 1 0 1 0 8 0 amappl13 176 579 0 577 1 0 1 1 0 8 0 amappl12 168 4500 0 4455 3 0 3 3 0 8 0 amappl11 160 3 0 3 1 1 0 1 0 8 0 amappl10 152 95 0 80 1 0 1 1 0 8 0 amappl9 144 251 0 251 1 1 0 1 0 8 0 amappl8 136 26 0 23 1 0 1 1 0 8 0 amappl7 128 129 0 128 1 0 1 1 0 8 0 amappl6 120 464 0 448 1 0 1 1 0 8 0 amappl5 112 95 0 84 1 0 1 1 0 8 0 amappl4 104 515 0 483 1 0 1 1 0 8 0 amappl3 96 22114 0 22016 5 1 4 4 0 8 0 amappl2 88 4178 0 4097 2 0 2 2 0 8 0 amappl1 80 26034 0 25417 16 1 15 15 0 8 0 amappl 88 32864 0 32682 5 0 5 5 0 92 0 uvmvnodes 80 5926 0 0 121 0 121 121 0 8 0 dma32768 32768 1 0 1 1 1 0 1 0 8 0 dma4096 4096 2 0 2 2 2 0 1 0 8 0 dma2048 2048 1 0 1 1 1 0 1 0 8 0 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 9 0 9 4 4 0 1 0 8 0 dma128 128 258 0 258 6 6 0 1 0 8 0 dma64 64 10 0 10 4 4 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 19 0 18 1 0 1 1 0 8 0 aobjpl 72 53 0 5 1 0 1 1 0 8 0 uaddrrnd 24 4046 0 4013 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 4046 0 4013 1 0 1 1 0 8 0 vmmpekpl 168 29453 0 29389 4 0 4 4 0 8 0 vmmpepl 168 257934 0 255623 168 50 118 141 0 357 5 vmsppl 488 4045 0 4013 5 0 5 5 0 8 0 rwobjpl 80 71279 0 64040 168 12 156 166 0 8 1 pdppl 4096 8099 0 8026 117 42 75 85 0 8 2 pvpl 32 32984 0 0 267 1 266 266 0 265 0 pmappl 256 4045 0 4013 3 0 3 3 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 433 0 97 10 0 10 10 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+37 panic(ffffffff833959d9) at panic+485 __assert(ffffffff833d5dca,ffffffff833e1a34,3b9,ffffffff8340b62e) at __assert+41 refcnt_finalize(ffff80003c457520,ffffffff8338931c) at refcnt_finalize+475 pppx_if_destroy(285b9a,ffff80003c457518) at pppx_if_destroy+61 pppxclose(285b9a,41,2000,ffff80003a7fbcc0) at pppxclose+160 spec_close(ffff80002a380720) at spec_close+1047 VOP_CLOSE(fffffd80613826d8,41,fffffd80097fb6e8,ffff80003a7fbcc0) at VOP_CLOSE+306 vn_closefile(fffffd806cb8a708,ffff80003a7fbcc0) at vn_closefile+299 fdrop(fffffd806cb8a708,ffff80003a7fbcc0) at fdrop+289 dofilereadv(ffff80003a7fbcc0,6,ffff80002a380970,0,ffff80002a380a30) at dofilereadv+1230 sys_readv(ffff80003a7fbcc0,ffff80002a380ae0,ffff80002a380a30) at sys_readv+216 syscall(ffff80002a380ae0) at syscall+3028 Xsyscall() at Xsyscall+296 end of kernel end trace frame: 0x5da49946690, count: -14 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+39: addq $8,%rsp x86_ipi_db(ffff8000299edff0) at x86_ipi_db+39 x86_ipi_handler() at x86_ipi_handler+217 Xresume_lapic_ipi() at Xresume_lapic_ipi+39 acpicpu_idle() at acpicpu_idle+1111 sched_idle(ffff8000299edff0) at sched_idle+913 end trace frame: 0x0, count: 10 ddb{1}> trace x86_ipi_db(ffff8000299edff0) at x86_ipi_db+39 x86_ipi_handler() at x86_ipi_handler+217 Xresume_lapic_ipi() at Xresume_lapic_ipi+39 acpicpu_idle() at acpicpu_idle+1111 sched_idle(ffff8000299edff0) at sched_idle+913 end trace frame: 0x0, count: -5