panic: malloc: allocation too large, type = 2, size = 536870920 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 78030 60309 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(20000008,2,2) at malloc+0xa13 sys/kern/kern_malloc.c:339 wsmux_getmux(4000000) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(4000000,ffff800001942e00) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd803868f560,80085761,ffff8000149f4ae0,b,fffffd803f7c6720,ffff8000ffff9778) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd802eb31ad8,80085761,ffff8000149f4ae0,ffff8000ffff9778) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff8000ffff9778,ffff8000149f4c28,ffff8000149f4c10) at sys_ioctl+0x638 syscall(ffff8000149f4cc0) at syscall+0x541 Xsyscall(6,0,ffffffffffffff86,0,3,995adf89010) at Xsyscall+0x128 end of kernel end trace frame: 0x99878230380, 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 = 536870920 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(20000008,2,2) at malloc+0xa13 sys/kern/kern_malloc.c:339 wsmux_getmux(4000000) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(4000000,ffff800001942e00) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd803868f560,80085761,ffff8000149f4ae0,b,fffffd803f7c6720,ffff8000ffff9778) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd802eb31ad8,80085761,ffff8000149f4ae0,ffff8000ffff9778) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff8000ffff9778,ffff8000149f4c28,ffff8000149f4c10) at sys_ioctl+0x638 syscall(ffff8000149f4cc0) at syscall+0x541 Xsyscall(6,0,ffffffffffffff86,0,3,995adf89010) at Xsyscall+0x128 end of kernel end trace frame: 0x99878230380, count: -10 ddb> show registers rdi 0xffffffff8161b027 db_enter+0x17 rsi 0x1c42 __ALIGN_SIZE+0xc42 rbp 0xffff8000149f46b0 rbx 0xffff8000149f4760 rdx 0x1c43 __ALIGN_SIZE+0xc43 rcx 0xffff80000093b000 rax 0xffff80000093b000 r8 0xffff8000149f4670 r9 0x1 r10 0xffff800000936700 r11 0xbfaa3a2c6f72d1d1 r12 0x3000000008 r13 0xffff8000149f46c0 r14 0x100 r15 0x1 rip 0xffffffff8161b028 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000149f46a0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.1) pid=78030 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff8008,0xffffffff82290d98 process=0xffff8000ffff7078 user=0xffff8000149ef000, vmspace=0xfffffd803f014318 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 60309 11970 40765 0 2 0 syz-executor.1 *60309 78030 40765 0 7 0x4000000 syz-executor.1 6502 138419 0 0 3 0x14200 bored sosplice 76132 11223 43277 0 2 0x2 syz-executor.0 40765 284548 43277 0 3 0x82 nanosleep syz-executor.1 43277 376659 55756 0 3 0x82 thrsleep syz-fuzzer 43277 388644 55756 0 2 0x4000482 syz-fuzzer 43277 244885 55756 0 3 0x4000082 thrsleep syz-fuzzer 43277 98329 55756 0 3 0x4000082 thrsleep syz-fuzzer 43277 405854 55756 0 3 0x4000082 thrsleep syz-fuzzer 43277 112248 55756 0 3 0x4000082 kqread syz-fuzzer 43277 177137 55756 0 3 0x4000082 thrsleep syz-fuzzer 55756 4036 73163 0 3 0x10008a pause ksh 73163 333873 87362 0 3 0x92 select sshd 97581 206658 1 0 3 0x100083 ttyin getty 87362 400798 1 0 3 0x80 select sshd 72775 210978 59265 73 3 0x100090 kqread syslogd 59265 382719 1 0 3 0x100082 netio syslogd 9856 198237 1 77 3 0x100090 poll dhclient 36950 35019 1 0 3 0x80 poll dhclient 83499 445335 0 0 2 0x14200 zerothread 84971 423386 0 0 3 0x14200 aiodoned aiodoned 40390 391604 0 0 3 0x14200 syncer update 61405 364761 0 0 3 0x14200 cleaner cleaner 47055 327918 0 0 3 0x14200 reaper reaper 31403 163790 0 0 3 0x14200 pgdaemon pagedaemon 32575 271121 0 0 3 0x14200 bored crynlk 85262 60063 0 0 3 0x14200 bored crypto 64126 302631 0 0 3 0x40014200 acpi0 acpi0 91523 300165 0 0 3 0x14200 bored softnet 61406 100822 0 0 3 0x14200 bored systqmp 93540 263660 0 0 3 0x14200 bored systq 73796 162789 0 0 2 0x40014200 softclock 15327 62973 0 0 3 0x40014200 idle0 2417 396164 0 0 3 0x14200 bored smr 1 346168 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 9460 6724K 6744K 78643K 10725 0 0 pcb 23 9K 10K 78643K 379 0 0 rtable 100 3K 3K 78643K 204 0 0 ifaddr 39 10K 11K 78643K 58 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 0 0K 2K 78643K 19 0 0 iov 0 0K 16K 78643K 18 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1196 75K 75K 78643K 1592 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 4 0 0 VM map 2 0K 0K 78643K 2 0 0 sem 12 0K 0K 78643K 489 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12537 0 0 file desc 5 13K 21K 78643K 485 0 0 sigio 0 0K 0K 78643K 2 0 0 proc 41 30K 46K 78643K 263 0 0 subproc 64 65538K 67586K 78643K 68 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 24 0 0 in_multi 33 2K 2K 78643K 35 0 0 ether_multi 1 0K 0K 78643K 1 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 60 265K 265K 78643K 60 0 0 exec 0 0K 1K 78643K 175 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 71 20K 20K 78643K 1782 0 0 UVM aobj 14 2K 2K 78643K 16 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 NDP 6 0K 0K 78643K 15 0 0 temp 100 2347K 2411K 78643K 4143 0 0 kqueue 0 0K 0K 78643K 2 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 4 0 0 1 0 1 1 0 8 0 inpcbpl 280 327 0 320 1 0 1 1 0 8 0 plimitpl 152 18 0 11 1 0 1 1 0 8 0 rtentry 112 41 0 1 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpcb 544 26 0 22 1 0 1 1 0 8 0 nd6 48 4 0 0 1 0 1 1 0 8 0 ppxss 1128 5 0 5 2 2 0 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 186 0 0 12 0 12 12 0 8 0 art_table 32 187 0 0 2 0 2 2 0 8 0 art_node 16 40 0 6 1 0 1 1 0 8 0 sysvmsgpl 40 4 0 2 1 0 1 1 0 8 0 semapl 112 487 0 477 1 0 1 1 0 8 0 shmpl 112 14 0 2 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2648 0 1240 46 0 46 46 0 8 0 ffsino 240 2648 0 1240 84 0 84 84 0 8 0 nchpl 144 3457 0 1834 61 0 61 61 0 8 0 uvmvnodes 72 2703 0 0 50 0 50 50 0 8 0 vnodes 200 2703 0 0 143 0 143 143 0 8 0 namei 1024 9999 0 9998 2 1 1 1 0 8 0 scxspl 192 9557 0 9557 7 6 1 6 0 8 1 sigapl 432 655 0 642 2 0 2 2 0 8 0 futexpl 56 10147 0 10147 1 0 1 1 0 8 1 knotepl 112 79 0 60 1 0 1 1 0 8 0 kqueuepl 104 34 0 32 1 0 1 1 0 8 0 pipepl 112 662 0 643 2 1 1 1 0 8 0 fdescpl 424 656 0 642 2 0 2 2 0 8 0 filepl 120 4650 0 4555 4 0 4 4 0 8 1 lockfpl 104 59 0 59 3 3 0 1 0 8 0 lockfspl 32 78 0 78 3 3 0 1 0 8 0 sessionpl 112 17 0 7 1 0 1 1 0 8 0 pgrppl 48 19 0 9 1 0 1 1 0 8 0 ucredpl 96 1680 0 1673 1 0 1 1 0 8 0 zombiepl 144 642 0 642 2 1 1 1 0 8 1 processpl 840 671 0 642 4 0 4 4 0 8 0 procpl 600 1207 0 1171 4 1 3 4 0 8 0 sosppl 128 2 0 2 1 1 0 1 0 8 0 sockpl 384 439 0 422 4 2 2 3 0 8 0 mcl64k 65536 1 0 1 1 1 0 1 0 8 0 mcl16k 16384 2 0 2 1 1 0 1 0 8 0 mcl12k 12288 242 0 242 1 0 1 1 0 8 1 mcl9k 9216 1 0 1 1 1 0 1 0 8 0 mcl8k 8192 3 0 3 1 1 0 1 0 8 0 mcl4k 4096 13 0 13 3 3 0 1 0 8 0 mcl2k2 2112 4 0 4 1 1 0 1 0 8 0 mcl2k 2048 48628 0 48594 12 7 5 9 0 8 0 mtagpl 80 2 0 2 1 1 0 1 0 8 0 mbufpl 256 84036 0 83968 12 5 7 8 0 8 0 bufpl 256 6300 0 1833 280 0 280 280 0 8 0 anonpl 16 69425 0 60509 52 9 43 51 0 62 7 amapchunkpl 152 2307 0 2227 5 1 4 5 0 158 0 amappl16 192 3216 0 2739 39 14 25 35 0 8 1 amappl15 184 52 0 47 1 0 1 1 0 8 0 amappl14 176 21 0 19 2 1 1 1 0 8 0 amappl13 168 26 0 23 1 0 1 1 0 8 0 amappl12 160 12 0 9 1 0 1 1 0 8 0 amappl11 152 25 0 14 1 0 1 1 0 8 0 amappl10 144 526 0 522 2 1 1 1 0 8 0 amappl9 136 517 0 513 1 0 1 1 0 8 0 amappl8 128 115 0 101 1 0 1 1 0 8 0 amappl7 120 247 0 243 1 0 1 1 0 8 0 amappl6 112 52 0 44 1 0 1 1 0 8 0 amappl5 104 165 0 154 1 0 1 1 0 8 0 amappl4 96 849 0 825 2 1 1 2 0 8 0 amappl3 88 361 0 356 1 0 1 1 0 8 0 amappl2 80 4839 0 4788 2 0 2 2 0 8 0 amappl1 72 20731 0 20320 24 15 9 19 0 8 0 amappl 72 1418 0 1386 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 15 0 2 1 0 1 1 0 8 0 uaddrrnd 24 656 0 642 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 656 0 642 1 0 1 1 0 8 0 vmmpekpl 168 9466 0 9450 3 2 1 2 0 8 0 vmmpepl 168 75096 0 73703 89 23 66 77 0 357 2 vmsppl 264 655 0 642 2 1 1 2 0 8 0 pdppl 4096 1318 0 1284 5 0 5 5 0 8 0 pvpl 32 223243 0 211278 141 21 120 132 0 265 23 pmappl 192 655 0 642 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 420 0 21 12 0 12 12 0 8 0