panic: mallocarray: overflow 18446744071562067968 * 8 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 12616 30966 0 0 0x4000000 0 syz-executor.0 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:208 fifo_badop(ffffffff80000000) at fifo_badop wsmux_getmux(7fffffff) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(7fffffff,ffff800003b82d00) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd802f601850,80085761,ffff8000149faa80,f,fffffd803f7c6ae0,ffff8000fffef2d8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd80361a7e90,80085761,ffff8000149faa80,ffff8000fffef2d8) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff8000fffef2d8,ffff8000149fabc8,ffff8000149fabb0) at sys_ioctl+0x638 syscall(ffff8000149fac60) at syscall+0x541 Xsyscall(6,0,ffffffffffffff86,0,3,a5cb64be010) at Xsyscall+0x128 end of kernel end trace frame: 0xa5ed5629cf0, count: 5 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 mallocarray: overflow 18446744071562067968 * 8 ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:208 fifo_badop(ffffffff80000000) at fifo_badop wsmux_getmux(7fffffff) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(7fffffff,ffff800003b82d00) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd802f601850,80085761,ffff8000149faa80,f,fffffd803f7c6ae0,ffff8000fffef2d8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd80361a7e90,80085761,ffff8000149faa80,ffff8000fffef2d8) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff8000fffef2d8,ffff8000149fabc8,ffff8000149fabb0) at sys_ioctl+0x638 syscall(ffff8000149fac60) at syscall+0x541 Xsyscall(6,0,ffffffffffffff86,0,3,a5cb64be010) at Xsyscall+0x128 end of kernel end trace frame: 0xa5ed5629cf0, count: -10 ddb> show registers rdi 0xffffffff81bfb6f7 db_enter+0x17 rsi 0x16f5 __ALIGN_SIZE+0x6f5 rbp 0xffff8000149fa6c0 rbx 0xffff8000149fa770 rdx 0x16f6 __ALIGN_SIZE+0x6f6 rcx 0xffff80000397e000 rax 0xffff80000397e000 r8 0xffff8000149fa680 r9 0x1 r10 0xffff800000933b80 r11 0x94b2aa1ebc2b34f r12 0x3000000008 r13 0xffff8000149fa6d0 r14 0x100 r15 0x1 rip 0xffffffff81bfb6f8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000149fa6b0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=12616 stat=onproc flags process=0 proc=4000000 pri=77, usrpri=77, nice=20 forw=0xffffffffffffffff, list=0xffff8000fffef9e0,0xffffffff822f0db8 process=0xffff800014953710 user=0xffff8000149f5000, vmspace=0xfffffd803f014d68 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 30966 121058 52056 0 2 0 syz-executor.0 *30966 12616 52056 0 7 0x4000000 syz-executor.0 96977 192748 46769 0 2 0x2 syz-executor.1 52056 285876 46769 0 3 0x82 nanosleep syz-executor.0 52972 505620 0 0 3 0x14200 bored sosplice 61287 502649 1 0 3 0x100083 ttyin getty 46769 30841 17247 0 3 0x82 thrsleep syz-fuzzer 46769 477939 17247 0 3 0x4000082 thrsleep syz-fuzzer 46769 489651 17247 0 3 0x4000082 thrsleep syz-fuzzer 46769 111736 17247 0 3 0x4000082 thrsleep syz-fuzzer 46769 432528 17247 0 3 0x4000082 thrsleep syz-fuzzer 46769 369168 17247 0 3 0x4000082 kqread syz-fuzzer 46769 109940 17247 0 3 0x4000082 thrsleep syz-fuzzer 46769 161770 17247 0 3 0x4000082 thrsleep syz-fuzzer 17247 212076 71371 0 3 0x10008a pause ksh 71371 477998 37609 0 3 0x92 select sshd 37609 228387 1 0 3 0x80 select sshd 11242 186300 70964 73 3 0x100090 kqread syslogd 70964 114052 1 0 3 0x100082 netio syslogd 48881 326792 1 77 3 0x100090 poll dhclient 13493 139469 1 0 3 0x80 poll dhclient 63014 147501 0 0 2 0x14200 zerothread 43346 434331 0 0 3 0x14200 aiodoned aiodoned 57635 98215 0 0 3 0x14200 syncer update 18992 459794 0 0 3 0x14200 cleaner cleaner 93326 340216 0 0 3 0x14200 reaper reaper 74487 38111 0 0 3 0x14200 pgdaemon pagedaemon 65337 511504 0 0 3 0x14200 bored crynlk 63266 209432 0 0 3 0x14200 bored crypto 56922 146458 0 0 3 0x40014200 acpi0 acpi0 56695 251069 0 0 3 0x14200 bored softnet 69938 96150 0 0 3 0x14200 bored systqmp 17251 120665 0 0 3 0x14200 bored systq 29374 336280 0 0 3 0x40014200 bored softclock 95189 231885 0 0 3 0x40014200 idle0 6913 205958 0 0 3 0x14200 bored smr 1 352241 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9510 6385K 6394K 78643K 11457 0 0 pcb 23 9K 10K 78643K 617 0 0 rtable 100 3K 3K 78643K 612 0 0 ifaddr 58 13K 13K 78643K 210 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 0 0K 2K 78643K 37 0 0 iov 0 0K 32K 78643K 163 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1196 75K 76K 78643K 2123 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 5K 78643K 15 0 0 VM map 2 0K 0K 78643K 2 0 0 sem 12 0K 1K 78643K 177 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12537 0 0 file desc 5 13K 25K 78643K 1858 0 0 sigio 0 0K 0K 78643K 22 0 0 proc 42 30K 46K 78643K 538 0 0 subproc 64 65538K 67586K 78643K 346 0 0 NFS srvsock 1 0K 0K 78643K 1 0 0 NFS daemon 1 16K 16K 78643K 1 0 0 ip_moptions 0 0K 0K 78643K 135 0 0 in_multi 33 2K 2K 78643K 181 0 0 ether_multi 1 0K 0K 78643K 13 0 0 mrt 0 0K 0K 78643K 3 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 66 291K 291K 78643K 66 0 0 exec 0 0K 1K 78643K 305 0 0 pagedep 1 8K 8K 78643K 1 0 0 inodedep 1 32K 32K 78643K 1 0 0 newblk 1 0K 0K 78643K 1 0 0 VM swap 7 26K 26K 78643K 7 0 0 UVM amap 72 20K 22K 78643K 5112 0 0 UVM aobj 61 4K 4K 78643K 64 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 0K 78643K 48 0 0 NDP 12 0K 0K 78643K 67 0 0 temp 170 2359K 2430K 78643K 8437 0 0 kqueue 0 0K 0K 78643K 6 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 12 0 8 1 0 1 1 0 8 0 inpcbpl 280 503 0 496 1 0 1 1 0 8 0 plimitpl 152 51 0 44 1 0 1 1 0 8 0 rtentry 112 113 0 73 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpcb 544 172 0 168 1 0 1 1 0 8 0 nd6 48 20 0 16 1 0 1 1 0 8 0 ppxss 1128 20 0 20 8 8 0 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 523 0 335 12 0 12 12 0 8 0 art_table 32 524 0 335 2 0 2 2 0 8 0 art_node 16 112 0 78 1 0 1 1 0 8 0 sysvmsgpl 40 84 0 52 1 0 1 1 0 8 0 semapl 112 175 0 165 1 0 1 1 0 8 0 shmpl 112 62 0 3 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 4610 0 3162 47 0 47 47 0 8 0 ffsino 240 4610 0 3162 86 0 86 86 0 8 0 nchpl 144 7172 0 5489 63 0 63 63 0 8 0 uvmvnodes 72 4868 0 0 89 0 89 89 0 8 0 vnodes 200 4868 0 0 257 0 257 257 0 8 0 namei 1024 21527 0 21526 2 1 1 1 0 8 0 scsiplug 64 1 0 1 1 1 0 1 0 8 0 scxspl 192 21862 0 21862 16 15 1 6 0 8 1 sigapl 432 2005 0 1992 2 0 2 2 0 8 0 futexpl 56 27722 0 27722 1 0 1 1 0 8 1 knotepl 112 409 0 390 1 0 1 1 0 8 0 kqueuepl 104 291 0 289 1 0 1 1 0 8 0 pipepl 112 1974 0 1955 3 2 1 2 0 8 0 fdescpl 424 2006 0 1992 2 0 2 2 0 8 0 filepl 120 11592 0 11497 5 1 4 4 0 8 1 lockfpl 104 346 0 346 6 5 1 1 0 8 1 lockfspl 32 336 0 336 7 6 1 1 0 8 1 sessionpl 112 26 0 16 1 0 1 1 0 8 0 pgrppl 48 46 0 36 1 0 1 1 0 8 0 ucredpl 96 2427 0 2420 1 0 1 1 0 8 0 zombiepl 144 1992 0 1992 2 1 1 1 0 8 1 processpl 840 2021 0 1992 4 0 4 4 0 8 0 procpl 600 4359 0 4322 4 0 4 4 0 8 0 sosppl 128 15 0 15 4 4 0 1 0 8 0 sockpl 384 1037 0 1020 8 5 3 3 0 8 1 mcl64k 65536 44 0 44 6 5 1 1 0 8 1 mcl16k 16384 4 0 4 4 4 0 1 0 8 0 mcl12k 12288 24 0 24 11 10 1 1 0 8 1 mcl9k 9216 15 0 15 8 8 0 1 0 8 0 mcl8k 8192 22 0 22 5 5 0 1 0 8 0 mcl4k 4096 138 0 138 10 9 1 1 0 8 1 mcl2k2 2112 42 0 42 7 7 0 1 0 8 0 mcl2k 2048 48456 0 48421 19 14 5 11 0 8 0 mtagpl 80 2 0 2 1 1 0 1 0 8 0 mbufpl 256 88394 0 88288 16 8 8 9 0 8 0 bufpl 256 10463 0 4815 354 0 354 354 0 8 0 anonpl 16 178401 0 169874 92 41 51 52 0 62 14 amapchunkpl 152 8271 0 8188 27 23 4 14 0 158 0 amappl16 192 8535 0 8061 73 41 32 36 0 8 8 amappl15 184 538 0 531 1 0 1 1 0 8 0 amappl14 176 657 0 656 2 1 1 1 0 8 0 amappl13 168 27 0 24 1 0 1 1 0 8 0 amappl12 160 627 0 624 1 0 1 1 0 8 0 amappl11 152 512 0 498 1 0 1 1 0 8 0 amappl10 144 653 0 651 2 1 1 1 0 8 0 amappl9 136 589 0 586 1 0 1 1 0 8 0 amappl8 128 168 0 151 1 0 1 1 0 8 0 amappl7 120 47 0 40 1 0 1 1 0 8 0 amappl6 112 113 0 105 1 0 1 1 0 8 0 amappl5 104 268 0 257 1 0 1 1 0 8 0 amappl4 96 1566 0 1539 2 1 1 2 0 8 0 amappl3 88 1294 0 1288 1 0 1 1 0 8 0 amappl2 80 17142 0 17088 2 0 2 2 0 8 0 amappl1 72 46520 0 46106 24 14 10 19 0 8 0 amappl 72 4625 0 4592 1 0 1 1 0 75 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma64 64 259 0 259 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 17 0 17 1 1 0 1 0 8 0 aobjpl 64 63 0 3 1 0 1 1 0 8 0 uaddrrnd 24 2006 0 1992 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2006 0 1992 1 0 1 1 0 8 0 vmmpekpl 168 17977 0 17959 2 0 2 2 0 8 0 vmmpepl 168 207990 0 206586 146 69 77 79 0 357 10 vmsppl 264 2005 0 1992 3 2 1 2 0 8 0 pdppl 4096 4018 0 3984 6 1 5 6 0 8 0 pvpl 32 598304 0 586626 285 106 179 218 0 265 83 pmappl 192 2005 0 1992 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 527 0 49 14 0 14 14 0 8 0