panic: malloc: allocation too large, type = 2, size = 536870920 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 520322 7428 0 0 0 0 syz-executor.0 * 6667 7428 0 0 0x4000000 1K syz-executor.0 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(20000008,2,2) at malloc+0xa6f sys/kern/kern_malloc.c:339 wsmux_getmux(4000000) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(4000000,ffff800000026d00) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd80666380c8,80085761,ffff800020c03a00,42,fffffd807f7c69c0,ffff800020b39c38) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8077d8aef0,80085761,ffff800020c03a00,ffff800020b39c38) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b39c38,ffff800020c03b48,ffff800020c03b30) at sys_ioctl+0x651 syscall(ffff800020c03be0) at syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c03be0) at syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff85,0,3,5616e748010) at Xsyscall+0x128 end of kernel end trace frame: 0x5641fd6c6b0, 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{1}> ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic malloc: allocation too large, type = 2, size = 536870920 ddb{1}> 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(20000008,2,2) at malloc+0xa6f sys/kern/kern_malloc.c:339 wsmux_getmux(4000000) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(4000000,ffff800000026d00) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd80666380c8,80085761,ffff800020c03a00,42,fffffd807f7c69c0,ffff800020b39c38) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8077d8aef0,80085761,ffff800020c03a00,ffff800020b39c38) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b39c38,ffff800020c03b48,ffff800020c03b30) at sys_ioctl+0x651 syscall(ffff800020c03be0) at syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c03be0) at syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff85,0,3,5616e748010) at Xsyscall+0x128 end of kernel end trace frame: 0x5641fd6c6b0, count: -10 ddb{1}> show registers rdi 0xffffffff813c20e7 db_enter+0x17 rsi 0x1b09 __ALIGN_SIZE+0xb09 rbp 0xffff800020c035d0 rbx 0xffff800020c03680 rdx 0x1b0a __ALIGN_SIZE+0xb0a rcx 0xffff800003b66000 rax 0xffff800003b66000 r8 0xffffffff811c2a43 kprintf+0x183 r9 0x1 r10 0x25 r11 0x4ed882c267c9abe2 r12 0x3000000008 r13 0xffff800020c035e0 r14 0x100 r15 0x1 rip 0xffffffff813c20e8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c035c0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=6667 stat=onproc flags process=0 proc=4000000 pri=53, usrpri=53, nice=20 forw=0xffffffffffffffff, list=0xffff800020b38bd0,0xffffffff82367ba0 process=0xffff800020b8c9f0 user=0xffff800020bfe000, vmspace=0xfffffd807f00c5a0 estcpu=14, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 7428 520322 2787 0 7 0 syz-executor.0 * 7428 6667 2787 0 7 0x4000000 syz-executor.0 77917 465415 0 0 3 0x14200 bored sosplice 2787 91015 78718 0 3 0x82 nanosleep syz-executor.0 10897 522459 78718 0 3 0x82 nanosleep syz-executor.1 78718 407190 215 0 3 0x82 thrsleep syz-fuzzer 78718 135611 215 0 3 0x4000082 nanosleep syz-fuzzer 78718 142281 215 0 3 0x4000082 thrsleep syz-fuzzer 78718 468546 215 0 3 0x4000082 thrsleep syz-fuzzer 78718 371523 215 0 3 0x4000082 thrsleep syz-fuzzer 78718 379284 215 0 3 0x4000082 kqread syz-fuzzer 78718 462552 215 0 3 0x4000082 thrsleep syz-fuzzer 78718 504648 215 0 3 0x4000082 thrsleep syz-fuzzer 78718 49632 215 0 3 0x4000082 thrsleep syz-fuzzer 78718 77025 215 0 3 0x4000082 thrsleep syz-fuzzer 215 166000 92277 0 3 0x10008a pause ksh 92277 425749 57623 0 3 0x92 select sshd 85212 9524 1 0 3 0x100083 ttyin getty 57623 423635 1 0 3 0x80 select sshd 78159 94068 56948 74 3 0x100092 bpf pflogd 56948 104678 1 0 3 0x80 netio pflogd 49727 194259 52582 73 3 0x100090 kqread syslogd 52582 66151 1 0 3 0x100082 netio syslogd 27198 296655 1 77 3 0x100090 poll dhclient 52858 295244 1 0 3 0x80 poll dhclient 46209 219408 0 0 3 0x14200 pgzero zerothread 36363 67517 0 0 3 0x14200 aiodoned aiodoned 21153 451490 0 0 3 0x14200 syncer update 59581 78362 0 0 3 0x14200 cleaner cleaner 93792 61504 0 0 3 0x14200 reaper reaper 76600 144588 0 0 3 0x14200 pgdaemon pagedaemon 12779 320610 0 0 3 0x14200 bored crynlk 21045 386987 0 0 3 0x14200 bored crypto 19048 142870 0 0 3 0x40014200 acpi0 acpi0 96846 259431 0 0 3 0x40014200 idle1 50385 470138 0 0 3 0x14200 bored softnet 68420 163267 0 0 3 0x14200 bored systqmp 18712 38990 0 0 3 0x14200 bored systq 10134 252562 0 0 3 0x40014200 bored softclock 17911 458644 0 0 3 0x40014200 idle0 82137 180701 0 0 3 0x14200 bored smr 1 59206 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 7428 (syz-executor.0) thread 0xffff800020b39c38 (6667) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82396898) 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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9500 6407K 6415K 78643K 10661 0 0 pcb 25 9K 10K 78643K 130 0 0 rtable 100 3K 4K 78643K 313 0 0 ifaddr 52 12K 13K 78643K 84 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1472 0 0 iov 0 0K 12K 78643K 39 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1205 75K 76K 78643K 1344 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 7 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 26 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12628 0 0 file desc 5 13K 21K 78643K 191 0 0 proc 53 50K 71K 78643K 415 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 20 0 0 in_multi 33 2K 2K 78643K 78 0 0 ether_multi 1 0K 0K 78643K 4 0 0 mrt 0 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 54 238K 238K 78643K 54 0 0 exec 0 0K 1K 78643K 218 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 85 20K 29K 78643K 1455 0 0 UVM aobj 16 2K 2K 78643K 18 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 14 0 0 NDP 10 0K 0K 78643K 26 0 0 temp 133 2369K 2433K 78643K 3832 0 0 kqueue 0 0K 0K 78643K 4 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{1}> 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 121 0 114 1 0 1 1 0 8 0 plimitpl 152 26 0 18 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 tcpcb 544 40 0 36 1 0 1 1 0 8 0 nd6 48 10 0 6 1 0 1 1 0 8 0 ppxss 1128 2 0 2 1 0 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 2 1 0 1 1 0 8 0 pfstkey 112 18 0 2 1 0 1 1 0 8 0 pfstate 328 18 0 2 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 309 0 123 12 0 12 12 0 8 0 art_table 32 310 0 123 2 0 2 2 0 8 0 art_node 16 67 0 33 1 0 1 1 0 8 0 sysvmsgpl 40 4 0 2 2 1 1 1 0 8 0 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 112 22 0 12 1 0 1 1 0 8 0 shmpl 112 16 0 2 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1714 0 283 47 0 47 47 0 8 0 ffsino 272 1714 0 283 96 0 96 96 0 8 0 nchpl 144 2179 0 535 62 0 62 62 0 8 1 uvmvnodes 72 1832 0 0 34 0 34 34 0 8 0 vnodes 200 1832 0 0 97 0 97 97 0 8 0 namei 1024 5920 0 5920 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 5607 0 5607 7 6 1 6 0 8 1 sigapl 432 381 0 366 2 0 2 2 0 8 0 futexpl 56 1902 0 1902 1 0 1 1 0 8 1 knotepl 112 142 0 123 1 0 1 1 0 8 0 kqueuepl 104 44 0 42 1 0 1 1 0 8 0 pipepl 112 262 0 243 2 1 1 1 0 8 0 fdescpl 488 382 0 366 3 0 3 3 0 8 0 filepl 152 2110 0 2010 5 0 5 5 0 8 1 lockfpl 104 66 0 65 2 1 1 1 0 8 0 lockfspl 32 110 0 109 2 1 1 1 0 8 0 sessionpl 112 21 0 10 1 0 1 1 0 8 0 pgrppl 48 21 0 10 1 0 1 1 0 8 0 ucredpl 96 304 0 295 1 0 1 1 0 8 0 zombiepl 144 366 0 365 2 1 1 1 0 8 0 processpl 840 398 0 365 4 0 4 4 0 8 0 procpl 600 743 0 700 4 0 4 4 0 8 0 srpgc 64 18 0 18 1 0 1 1 0 8 1 sosppl 128 2 0 2 1 0 1 1 0 8 1 sockpl 384 213 0 194 3 0 3 3 0 8 1 mcl64k 65536 372 0 0 47 0 47 47 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 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 132 0 0 16 0 16 16 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 447 0 0 28 0 28 28 0 8 0 bufpl 256 6018 0 1143 305 0 305 305 0 8 0 anonpl 16 50493 0 42085 51 2 49 49 0 125 13 amapchunkpl 152 2113 0 2027 9 0 9 9 0 158 4 amappl16 192 1411 0 969 34 4 30 34 0 8 7 amappl15 184 57 0 53 1 0 1 1 0 8 0 amappl14 176 122 0 115 2 1 1 1 0 8 0 amappl13 168 57 0 53 1 0 1 1 0 8 0 amappl12 160 13 0 12 1 0 1 1 0 8 0 amappl11 152 22 0 7 1 0 1 1 0 8 0 amappl10 144 68 0 65 1 0 1 1 0 8 0 amappl9 136 643 0 637 1 0 1 1 0 8 0 amappl8 128 199 0 182 1 0 1 1 0 8 0 amappl7 120 36 0 31 1 0 1 1 0 8 0 amappl6 112 56 0 50 1 0 1 1 0 8 0 amappl5 104 114 0 100 1 0 1 1 0 8 0 amappl4 96 643 0 611 2 0 2 2 0 8 0 amappl3 88 195 0 188 1 0 1 1 0 8 0 amappl2 80 2102 0 2046 2 0 2 2 0 8 0 amappl1 72 17964 0 17529 26 16 10 20 0 8 0 amappl 72 1002 0 967 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 17 0 2 1 0 1 1 0 8 0 uaddrrnd 24 382 0 366 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 382 0 366 1 0 1 1 0 8 0 vmmpekpl 168 7244 0 7219 2 0 2 2 0 8 0 vmmpepl 168 49085 0 47645 91 13 78 78 0 357 13 vmsppl 360 381 0 366 2 0 2 2 0 8 0 pdppl 4096 772 0 732 6 0 6 6 0 8 0 pvpl 32 166156 0 154503 134 5 129 129 0 265 33 pmappl 224 381 0 366 2 1 1 2 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 523 0 4 15 0 15 15 0 8 0