panic: malloc: allocation too large, type = 2, size = 268435464 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 97303 3259 0 0 0x4000000 0 syz-executor.1 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:208 malloc(10000008,2,2) at malloc+0xa13 sys/kern/kern_malloc.c:339 wsmux_getmux(2000000) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(2000000,ffff800001967700) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd802c2f7500,80085761,ffff800014a28280,f,fffffd803f7c6a80,ffff8000ffff8968) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd80361a9a58,80085761,ffff800014a28280,ffff8000ffff8968) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff8000ffff8968,ffff800014a283c8,ffff800014a283b0) at sys_ioctl+0x638 syscall(ffff800014a28460) at syscall+0x541 Xsyscall(6,0,ffffffffffffff86,0,3,a2c3fd24010) at Xsyscall+0x128 end of kernel end trace frame: 0xa2e9c754e00, 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 malloc: allocation too large, type = 2, size = 268435464 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 malloc(10000008,2,2) at malloc+0xa13 sys/kern/kern_malloc.c:339 wsmux_getmux(2000000) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(2000000,ffff800001967700) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd802c2f7500,80085761,ffff800014a28280,f,fffffd803f7c6a80,ffff8000ffff8968) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd80361a9a58,80085761,ffff800014a28280,ffff8000ffff8968) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff8000ffff8968,ffff800014a283c8,ffff800014a283b0) at sys_ioctl+0x638 syscall(ffff800014a28460) at syscall+0x541 Xsyscall(6,0,ffffffffffffff86,0,3,a2c3fd24010) at Xsyscall+0x128 end of kernel end trace frame: 0xa2e9c754e00, count: -10 ddb> show registers rdi 0xffffffff81c210d7 db_enter+0x17 rsi 0x1ca5 __ALIGN_SIZE+0xca5 rbp 0xffff800014a27e50 rbx 0xffff800014a27f00 rdx 0x1ca6 __ALIGN_SIZE+0xca6 rcx 0xffff800003b3c000 rax 0xffff800003b3c000 r8 0xffff800014a27e10 r9 0x1 r10 0xffff8000019435c0 r11 0xd32137396deae284 r12 0x3000000008 r13 0xffff800014a27e60 r14 0x100 r15 0x1 rip 0xffffffff81c210d8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800014a27e40 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.1) pid=97303 stat=onproc flags process=0 proc=4000000 pri=67, usrpri=67, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff8bc0,0xffffffff82252c30 process=0xffff800014963080 user=0xffff800014a23000, vmspace=0xfffffd803f014108 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 3259 503856 50734 0 2 0 syz-executor.1 * 3259 97303 50734 0 7 0x4000000 syz-executor.1 70459 9813 62613 0 2 0x2 syz-executor.0 50734 88069 62613 0 3 0x82 nanosleep syz-executor.1 34060 67496 0 0 3 0x14200 bored sosplice 75486 47120 1 0 3 0x100083 ttyin getty 62613 87660 90175 0 3 0x82 thrsleep syz-fuzzer 62613 71381 90175 0 3 0x4000082 thrsleep syz-fuzzer 62613 344820 90175 0 3 0x4000082 thrsleep syz-fuzzer 62613 386245 90175 0 3 0x4000082 kqread syz-fuzzer 62613 216406 90175 0 3 0x4000082 thrsleep syz-fuzzer 62613 471574 90175 0 3 0x4000082 thrsleep syz-fuzzer 62613 514580 90175 0 3 0x4000082 thrsleep syz-fuzzer 90175 97370 25707 0 3 0x10008a pause ksh 25707 55931 92043 0 3 0x92 select sshd 92043 427103 1 0 3 0x80 select sshd 30439 350748 96920 73 3 0x100090 kqread syslogd 96920 337147 1 0 3 0x100082 netio syslogd 45918 114164 1 77 3 0x100090 poll dhclient 56077 431145 1 0 3 0x80 poll dhclient 35992 416725 0 0 2 0x14200 zerothread 1322 173651 0 0 3 0x14200 aiodoned aiodoned 85136 441514 0 0 3 0x14200 syncer update 1127 216103 0 0 3 0x14200 cleaner cleaner 73777 284380 0 0 3 0x14200 reaper reaper 62942 377787 0 0 3 0x14200 pgdaemon pagedaemon 80361 14331 0 0 3 0x14200 bored crynlk 63949 225627 0 0 3 0x14200 bored crypto 16317 365733 0 0 3 0x40014200 acpi0 acpi0 63369 458206 0 0 3 0x14200 bored softnet 58334 328765 0 0 3 0x14200 bored systqmp 21278 481698 0 0 3 0x14200 bored systq 74126 140703 0 0 3 0x40014200 bored softclock 55826 1153 0 0 3 0x40014200 idle0 27471 19633 0 0 3 0x14200 bored smr 1 258723 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 9526 6356K 6356K 78643K 11088 0 0 pcb 23 9K 11K 78643K 783 0 0 rtable 103 4K 4K 78643K 663 0 0 ifaddr 63 13K 14K 78643K 248 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 0 0K 2K 78643K 43 0 0 iov 0 0K 24K 78643K 193 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1197 75K 75K 78643K 1811 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 21 0 0 VM map 2 0K 0K 78643K 2 0 0 sem 12 0K 0K 78643K 178 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12537 0 0 file desc 5 13K 21K 78643K 1232 0 0 sigio 0 0K 0K 78643K 16 0 0 proc 42 30K 46K 78643K 555 0 0 subproc 64 65538K 67586K 78643K 276 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 128 0 0 in_multi 33 2K 2K 78643K 134 0 0 ether_multi 1 0K 0K 78643K 10 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 293 0 0 pfkey data 0 0K 0K 78643K 2 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 78 20K 29K 78643K 3680 0 0 UVM aobj 62 4K 5K 78643K 72 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 1K 78643K 90 0 0 NDP 14 0K 0K 78643K 76 0 0 temp 184 2359K 2486K 78643K 6705 0 0 kqueue 0 0K 0K 78643K 10 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 10 0 6 1 0 1 1 0 8 0 inpcbpl 280 654 0 647 1 0 1 1 0 8 0 plimitpl 152 60 0 53 1 0 1 1 0 8 0 rtentry 112 97 0 57 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpcb 544 235 0 231 1 0 1 1 0 8 0 nd6 48 16 0 12 1 0 1 1 0 8 0 ppxss 1128 31 0 31 3 3 0 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 442 0 255 12 0 12 12 0 8 0 art_table 32 443 0 255 2 0 2 2 0 8 0 art_node 16 94 0 60 1 0 1 1 0 8 0 sysvmsgpl 40 26 0 10 1 0 1 1 0 8 0 semapl 112 176 0 166 1 0 1 1 0 8 0 shmpl 112 70 0 10 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 3597 0 2143 48 1 47 47 0 8 0 ffsino 240 3597 0 2143 86 0 86 86 0 8 0 nchpl 144 5613 0 3964 62 0 62 62 0 8 0 uvmvnodes 72 3850 0 0 70 0 70 70 0 8 0 vnodes 200 3850 0 0 203 0 203 203 0 8 0 namei 1024 17312 0 17312 2 1 1 1 0 8 1 scsiplug 64 4 0 4 2 2 0 1 0 8 0 scxspl 192 18844 0 18844 11 8 3 6 0 8 3 sigapl 432 1385 0 1372 2 0 2 2 0 8 0 futexpl 56 21271 0 21271 1 0 1 1 0 8 1 knotepl 112 391 0 372 1 0 1 1 0 8 0 kqueuepl 104 378 0 376 1 0 1 1 0 8 0 pipepl 112 978 0 959 6 4 2 2 0 8 1 fdescpl 424 1386 0 1372 2 0 2 2 0 8 0 filepl 120 9094 0 8999 6 1 5 5 0 8 2 lockfpl 104 374 0 374 2 1 1 1 0 8 1 lockfspl 32 225 0 225 2 1 1 1 0 8 1 sessionpl 112 24 0 14 1 0 1 1 0 8 0 pgrppl 48 42 0 32 1 0 1 1 0 8 0 ucredpl 96 1837 0 1830 1 0 1 1 0 8 0 zombiepl 144 1372 0 1372 2 1 1 1 0 8 1 processpl 840 1401 0 1372 4 0 4 4 0 8 0 procpl 600 2926 0 2890 4 0 4 4 0 8 1 sosppl 128 14 0 14 4 3 1 1 0 8 1 sockpl 384 1320 0 1303 4 1 3 4 0 8 1 mcl64k 65536 68 0 68 5 4 1 1 0 8 1 mcl16k 16384 7 0 7 6 6 0 1 0 8 0 mcl12k 12288 41 0 41 4 3 1 1 0 8 1 mcl9k 9216 26 0 26 4 4 0 1 0 8 0 mcl8k 8192 32 0 32 7 6 1 1 0 8 1 mcl4k 4096 63 0 63 3 2 1 1 0 8 1 mcl2k2 2112 10 0 10 7 6 1 1 0 8 1 mcl2k 2048 49408 0 49376 11 6 5 9 0 8 0 mtagpl 80 2 0 2 1 1 0 1 0 8 0 mbufpl 256 88101 0 88023 15 6 9 10 0 8 1 bufpl 256 8235 0 3704 284 0 284 284 0 8 0 anonpl 16 159580 0 152021 93 45 48 54 0 62 9 amapchunkpl 152 5710 0 5630 11 6 5 9 0 158 0 amappl16 192 7600 0 7108 97 64 33 37 0 8 8 amappl15 184 80 0 75 1 0 1 1 0 8 0 amappl14 176 765 0 764 2 1 1 1 0 8 0 amappl13 168 295 0 292 1 0 1 1 0 8 0 amappl12 160 639 0 636 1 0 1 1 0 8 0 amappl11 152 256 0 243 1 0 1 1 0 8 0 amappl10 144 70 0 67 2 1 1 1 0 8 0 amappl9 136 555 0 552 1 0 1 1 0 8 0 amappl8 128 145 0 130 1 0 1 1 0 8 0 amappl7 120 39 0 33 1 0 1 1 0 8 0 amappl6 112 279 0 273 1 0 1 1 0 8 0 amappl5 104 250 0 238 1 0 1 1 0 8 0 amappl4 96 1024 0 999 2 1 1 2 0 8 0 amappl3 88 1468 0 1462 1 0 1 1 0 8 0 amappl2 80 11396 0 11344 2 0 2 2 0 8 0 amappl1 72 33505 0 33099 26 17 9 19 0 8 0 amappl 72 3199 0 3167 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 71 0 10 1 0 1 1 0 8 0 uaddrrnd 24 1386 0 1372 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1386 0 1372 1 0 1 1 0 8 0 vmmpekpl 168 13683 0 13665 2 0 2 2 0 8 0 vmmpepl 168 154222 0 152813 131 48 83 83 0 357 15 vmsppl 264 1385 0 1372 3 1 2 2 0 8 1 pdppl 4096 2778 0 2744 5 0 5 5 0 8 0 pvpl 32 458792 0 448147 184 55 129 139 0 265 28 pmappl 192 1385 0 1372 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 443 0 33 12 0 12 12 0 8 0