panic: malloc: allocation too large, type = 2, size = 536870968 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *395512 1818 0 0 0x4000000 0 syz-executor.1 427777 80987 0 0x2 0 1 syz-executor.1 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x174 sys/kern/subr_prf.c:208 malloc(20000038,2,2) at malloc+0xa6f sys/kern/kern_malloc.c:339 wsmux_getmux(4000006) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(4000006,ffff800000026d00) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd807e28a170,80085761,ffff800020c0f3a0,3,fffffd807f7c69c0,ffff800020b8b2d8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd807de031e8,80085761,ffff800020c0f3a0,ffff800020b8b2d8) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b8b2d8,ffff800020c0f4e8,ffff800020c0f4d0) at sys_ioctl+0x651 syscall(ffff800020c0f580) at syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c0f580) at syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,4cc29fd9010) at Xsyscall+0x128 end of kernel end trace frame: 0x4cee5ac81a0, 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{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic malloc: allocation too large, type = 2, size = 536870968 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x174 sys/kern/subr_prf.c:208 malloc(20000038,2,2) at malloc+0xa6f sys/kern/kern_malloc.c:339 wsmux_getmux(4000006) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(4000006,ffff800000026d00) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd807e28a170,80085761,ffff800020c0f3a0,3,fffffd807f7c69c0,ffff800020b8b2d8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd807de031e8,80085761,ffff800020c0f3a0,ffff800020b8b2d8) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b8b2d8,ffff800020c0f4e8,ffff800020c0f4d0) at sys_ioctl+0x651 syscall(ffff800020c0f580) at syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c0f580) at syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,4cc29fd9010) at Xsyscall+0x128 end of kernel end trace frame: 0x4cee5ac81a0, count: -10 ddb{0}> show registers rdi 0xffffffff81a91937 db_enter+0x17 rsi 0x1773 __ALIGN_SIZE+0x773 rbp 0xffff800020c0ef70 rbx 0xffff800020c0f020 rdx 0x1774 __ALIGN_SIZE+0x774 rcx 0xffff800001766000 rax 0xffff800001766000 r8 0xffffffff81ad1df3 kprintf+0x183 r9 0x1 r10 0x25 r11 0x2bd029709af86db5 r12 0x3000000008 r13 0xffff800020c0ef80 r14 0x100 r15 0x1 rip 0xffffffff81a91938 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c0ef60 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=395512 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b8b530,0xffffffff823c8d80 process=0xffff800020b7c6a8 user=0xffff800020c0a000, vmspace=0xfffffd807effdb40 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 1818 44544 80987 0 2 0 syz-executor.1 * 1818 395512 80987 0 7 0x4000000 syz-executor.1 12864 39368 12511 0 3 0x80 nanosleep syz-executor.0 12864 22018 12511 0 3 0x4000080 nanosleep syz-executor.0 12864 257490 12511 0 3 0x4000080 fsleep syz-executor.0 12511 361406 71010 0 3 0x82 nanosleep syz-executor.0 80987 427777 71010 0 7 0x2 syz-executor.1 78819 489592 0 0 3 0x14200 bored sosplice 71010 3005 21733 0 3 0x82 thrsleep syz-fuzzer 71010 308753 21733 0 3 0x4000082 nanosleep syz-fuzzer 71010 433219 21733 0 3 0x4000082 thrsleep syz-fuzzer 71010 439434 21733 0 3 0x4000082 thrsleep syz-fuzzer 71010 349403 21733 0 3 0x4000082 thrsleep syz-fuzzer 71010 166989 21733 0 3 0x4000082 kqread syz-fuzzer 71010 112938 21733 0 3 0x4000082 thrsleep syz-fuzzer 71010 392493 21733 0 3 0x4000082 thrsleep syz-fuzzer 71010 377326 21733 0 3 0x4000082 thrsleep syz-fuzzer 71010 337337 21733 0 3 0x4000082 thrsleep syz-fuzzer 21733 131065 83230 0 3 0x10008a pause ksh 83230 141152 90945 0 3 0x92 select sshd 43831 181306 1 0 3 0x100083 ttyin getty 90945 7043 1 0 3 0x80 select sshd 88472 56914 45632 74 3 0x100092 bpf pflogd 45632 475517 1 0 3 0x80 netio pflogd 32416 150576 26227 73 3 0x100090 kqread syslogd 26227 347626 1 0 3 0x100082 netio syslogd 19941 79883 1 77 3 0x100090 poll dhclient 11716 323751 1 0 3 0x80 poll dhclient 19044 202718 0 0 3 0x14200 pgzero zerothread 28584 61793 0 0 3 0x14200 aiodoned aiodoned 93423 290216 0 0 3 0x14200 syncer update 20082 70398 0 0 3 0x14200 cleaner cleaner 91083 56568 0 0 3 0x14200 reaper reaper 44395 79228 0 0 3 0x14200 pgdaemon pagedaemon 3651 465302 0 0 3 0x14200 bored crynlk 1153 128349 0 0 3 0x14200 bored crypto 41712 148777 0 0 3 0x40014200 acpi0 acpi0 57732 387538 0 0 3 0x40014200 idle1 5894 188449 0 0 3 0x14200 bored softnet 40427 13370 0 0 3 0x14200 bored systqmp 63325 21566 0 0 3 0x14200 bored systq 85737 133577 0 0 3 0x40014200 bored softclock 1482 243244 0 0 3 0x40014200 idle0 82963 181917 0 0 3 0x14200 bored smr 1 204453 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 1818 (syz-executor.1) thread 0xffff800020b8b2d8 (395512) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82360b08) locked @ /syzkaller/managers/multicore/kernel/sys/sys/syscall_mi.h:90 #0 witness_lock+0x594 sys/kern/subr_witness.c:1201 #1 syscall+0x48b mi_syscall sys/sys/syscall_mi.h:91 [inline] #1 syscall+0x48b sys/arch/amd64/amd64/trap.c:574 #2 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9503 6411K 6419K 78643K 10721 0 0 pcb 25 9K 11K 78643K 255 0 0 rtable 103 4K 4K 78643K 355 0 0 ifaddr 53 12K 13K 78643K 104 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1476 0 0 iov 0 0K 24K 78643K 50 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1199 75K 75K 78643K 1453 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 6 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 49 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12628 0 0 file desc 6 17K 25K 78643K 391 0 0 sigio 0 0K 0K 78643K 4 0 0 proc 54 51K 71K 78643K 439 0 0 subproc 64 65538K 67586K 78643K 170 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 42 0 0 in_multi 33 2K 2K 78643K 99 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 241 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 86 20K 29K 78643K 2137 0 0 UVM aobj 11 2K 2K 78643K 15 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 NDP 12 0K 0K 78643K 31 0 0 temp 134 2369K 2435K 78643K 4354 0 0 kqueue 0 0K 0K 78643K 12 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 7 0 3 1 0 1 1 0 8 0 inpcbpl 280 233 0 226 1 0 1 1 0 8 0 plimitpl 152 32 0 24 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 68 0 28 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 51 0 51 1 1 0 1 0 8 0 tcpcb 544 88 0 84 1 0 1 1 0 8 0 nd6 48 10 0 6 1 0 1 1 0 8 0 ppxss 1128 7 0 7 2 1 1 1 0 8 1 pfosfp 40 846 0 423 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 18 0 8 1 0 1 1 0 8 0 pfstkey 112 18 0 8 1 0 1 1 0 8 0 pfstate 328 18 0 8 2 0 2 2 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 311 0 123 12 0 12 12 0 8 0 art_table 32 312 0 123 2 0 2 2 0 8 0 art_node 16 67 0 33 1 0 1 1 0 8 0 sysvmsgpl 40 8 0 0 1 0 1 1 0 8 0 semapl 112 47 0 37 1 0 1 1 0 8 0 shmpl 112 13 0 4 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2119 0 686 47 0 47 47 0 8 0 ffsino 272 2119 0 686 96 0 96 96 0 8 0 nchpl 144 2862 0 1220 61 0 61 61 0 8 0 uvmvnodes 72 2236 0 0 41 0 41 41 0 8 0 vnodes 200 2236 0 0 118 0 118 118 0 8 0 namei 1024 8233 0 8233 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 7587 0 7587 11 10 1 6 0 8 1 sigapl 432 581 0 565 3 1 2 3 0 8 0 futexpl 56 4494 0 4493 1 0 1 1 0 8 0 knotepl 112 206 0 187 1 0 1 1 0 8 0 kqueuepl 104 121 0 118 1 0 1 1 0 8 0 pipepl 112 358 0 339 2 1 1 1 0 8 0 fdescpl 488 582 0 565 3 0 3 3 0 8 0 filepl 152 3518 0 3416 5 0 5 5 0 8 0 lockfpl 104 152 0 152 2 1 1 1 0 8 1 lockfspl 32 159 0 159 2 1 1 1 0 8 1 sessionpl 112 21 0 10 1 0 1 1 0 8 0 pgrppl 48 25 0 14 1 0 1 1 0 8 0 ucredpl 96 715 0 706 1 0 1 1 0 8 0 zombiepl 144 565 0 565 2 1 1 1 0 8 1 processpl 840 598 0 565 4 0 4 4 0 8 0 procpl 600 1419 0 1374 4 0 4 4 0 8 0 srpgc 64 18 0 18 2 1 1 1 0 8 1 sosppl 128 6 0 6 3 2 1 1 0 8 1 sockpl 384 439 0 420 4 1 3 4 0 8 1 mcl64k 65536 7 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 5 0 0 1 0 1 1 0 8 0 mcl9k 9216 4 0 0 1 0 1 1 0 8 0 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 6 0 0 1 0 1 1 0 8 0 mcl2k2 2112 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 128 0 0 15 0 15 15 0 8 1 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 164 0 0 8 0 8 8 0 8 0 bufpl 256 6436 0 1145 331 0 331 331 0 8 0 anonpl 16 70511 0 63185 59 10 49 53 0 125 13 amapchunkpl 152 3236 0 3143 11 6 5 9 0 158 0 amappl16 192 2710 0 2245 40 14 26 36 0 8 2 amappl15 184 233 0 227 1 0 1 1 0 8 0 amappl14 176 28 0 26 2 1 1 1 0 8 0 amappl13 168 37 0 32 1 0 1 1 0 8 0 amappl12 160 12 0 10 1 0 1 1 0 8 0 amappl11 152 175 0 160 1 0 1 1 0 8 0 amappl10 144 103 0 96 1 0 1 1 0 8 0 amappl9 136 601 0 597 1 0 1 1 0 8 0 amappl8 128 149 0 135 1 0 1 1 0 8 0 amappl7 120 69 0 62 1 0 1 1 0 8 0 amappl6 112 214 0 207 1 0 1 1 0 8 0 amappl5 104 115 0 101 1 0 1 1 0 8 0 amappl4 96 810 0 779 2 1 1 2 0 8 0 amappl3 88 144 0 136 1 0 1 1 0 8 0 amappl2 80 3907 0 3842 2 0 2 2 0 8 0 amappl1 72 22020 0 21570 26 16 10 20 0 8 0 amappl 72 1679 0 1640 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 14 0 4 1 0 1 1 0 8 0 uaddrrnd 24 582 0 565 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 582 0 565 1 0 1 1 0 8 0 vmmpekpl 168 9078 0 9054 2 0 2 2 0 8 0 vmmpepl 168 69196 0 67644 103 22 81 81 0 357 13 vmsppl 360 581 0 565 2 0 2 2 0 8 0 pdppl 4096 1172 0 1130 6 0 6 6 0 8 0 pvpl 32 224083 0 213428 146 14 132 137 0 265 33 pmappl 224 581 0 565 2 1 1 2 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 483 0 4 14 0 14 14 0 8 0