panic: malloc: allocation too large, type = 2, size = 538968072 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *333290 85013 0 0 0x4000000 0K syz-executor.0 439130 76384 0 0x2 0 1 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(20200008,2,2) at malloc+0xa6f sys/kern/kern_malloc.c:339 wsmux_getmux(4040000) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(4040000,ffff800000026f00) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd80652bd268,80085761,ffff800020c577a0,2,fffffd807f7c69c0,ffff800020b38e28) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8066eb6998,80085761,ffff800020c577a0,ffff800020b38e28) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b38e28,ffff800020c578e8,ffff800020c578d0) at sys_ioctl+0x651 syscall(ffff800020c57980) at syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c57980) at syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,18b9c658010) at Xsyscall+0x128 end of kernel end trace frame: 0x18e922529e0, 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 = 538968072 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(20200008,2,2) at malloc+0xa6f sys/kern/kern_malloc.c:339 wsmux_getmux(4040000) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(4040000,ffff800000026f00) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd80652bd268,80085761,ffff800020c577a0,2,fffffd807f7c69c0,ffff800020b38e28) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8066eb6998,80085761,ffff800020c577a0,ffff800020b38e28) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b38e28,ffff800020c578e8,ffff800020c578d0) at sys_ioctl+0x651 syscall(ffff800020c57980) at syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c57980) at syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,18b9c658010) at Xsyscall+0x128 end of kernel end trace frame: 0x18e922529e0, count: -10 ddb{0}> show registers rdi 0xffffffff81215977 db_enter+0x17 rsi 0x1881 __ALIGN_SIZE+0x881 rbp 0xffff800020c57370 rbx 0xffff800020c57420 rdx 0x1882 __ALIGN_SIZE+0x882 rcx 0xffff8000035cd000 rax 0xffff8000035cd000 r8 0xffffffff81471d03 kprintf+0x183 r9 0x1 r10 0x25 r11 0xb560e2349e6e0212 r12 0x3000000008 r13 0xffff800020c57380 r14 0x100 r15 0x1 rip 0xffffffff81215978 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c57360 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=333290 stat=onproc flags process=0 proc=4000000 pri=83, usrpri=83, nice=20 forw=0xffffffffffffffff, list=0xffff800020b39530,0xffffffff82383278 process=0xffff800020b8c9f0 user=0xffff800020c52000, vmspace=0xfffffd807f00b000 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 85013 276216 76384 0 2 0 syz-executor.0 *85013 333290 76384 0 7 0x4000000 syz-executor.0 85393 283790 72230 0 3 0x82 nanosleep syz-executor.1 76384 439130 72230 0 7 0x2 syz-executor.0 77069 428415 1 0 3 0x100083 ttyin getty 90554 258824 0 0 3 0x14200 bored sosplice 72230 309275 47991 0 3 0x82 thrsleep syz-fuzzer 72230 182915 47991 0 3 0x4000082 thrsleep syz-fuzzer 72230 244363 47991 0 3 0x4000082 thrsleep syz-fuzzer 72230 93472 47991 0 3 0x4000082 thrsleep syz-fuzzer 72230 472736 47991 0 3 0x4000082 kqread syz-fuzzer 72230 506155 47991 0 3 0x4000082 thrsleep syz-fuzzer 72230 462791 47991 0 3 0x4000082 thrsleep syz-fuzzer 72230 310683 47991 0 3 0x4000082 thrsleep syz-fuzzer 72230 305456 47991 0 3 0x4000082 thrsleep syz-fuzzer 72230 176626 47991 0 3 0x4000082 thrsleep syz-fuzzer 47991 274164 75845 0 3 0x10008a pause ksh 75845 486347 68893 0 3 0x92 select sshd 68893 113359 1 0 3 0x80 select sshd 32113 119276 14482 74 3 0x100092 bpf pflogd 14482 168449 1 0 3 0x80 netio pflogd 83694 230397 64416 73 3 0x100090 kqread syslogd 64416 463555 1 0 3 0x100082 netio syslogd 44375 520658 1 77 3 0x100090 poll dhclient 56612 134676 1 0 3 0x80 poll dhclient 31446 288015 0 0 3 0x14200 pgzero zerothread 62224 88571 0 0 3 0x14200 aiodoned aiodoned 19445 125771 0 0 3 0x14200 syncer update 74208 482044 0 0 3 0x14200 cleaner cleaner 72216 173309 0 0 3 0x14200 reaper reaper 84019 382194 0 0 3 0x14200 pgdaemon pagedaemon 12101 328463 0 0 3 0x14200 bored crynlk 77727 177527 0 0 3 0x14200 bored crypto 91111 200209 0 0 3 0x40014200 acpi0 acpi0 62969 127928 0 0 3 0x40014200 idle1 25738 148364 0 0 3 0x14200 bored softnet 28768 25064 0 0 3 0x14200 bored systqmp 41465 203526 0 0 3 0x14200 bored systq 27148 406373 0 0 3 0x40014200 bored softclock 30140 376920 0 0 3 0x40014200 idle0 89567 431635 0 0 3 0x14200 bored smr 1 286569 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 85013 (syz-executor.0) thread 0xffff800020b38e28 (333290) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8235f818) 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 9557 26912K 27311K 78643K 11394 0 0 pcb 25 9K 11K 78643K 563 0 0 rtable 100 3K 4K 78643K 848 0 0 ifaddr 66 14K 15K 78643K 263 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1499 0 0 iov 0 0K 28K 78643K 113 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1198 75K 76K 78643K 3290 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 26 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 198 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12628 0 0 file desc 5 13K 21K 78643K 2433 0 0 sigio 0 0K 0K 78643K 15 0 0 proc 54 51K 79K 78643K 802 0 0 subproc 64 65538K 67586K 78643K 584 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 123 0 0 in_multi 33 2K 2K 78643K 230 0 0 ether_multi 1 0K 0K 78643K 6 0 0 mrt 0 0K 0K 78643K 4 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 84 371K 371K 78643K 84 0 0 exec 0 0K 1K 78643K 621 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 91 21K 25K 78643K 8007 0 0 UVM aobj 61 3K 3K 78643K 66 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 71 0 0 NDP 14 0K 0K 78643K 90 0 0 temp 186 2380K 2507K 78643K 10118 0 0 kqueue 0 0K 0K 78643K 18 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 19 0 15 1 0 1 1 0 8 0 inpcbpl 280 540 0 533 1 0 1 1 0 8 0 plimitpl 152 63 0 55 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 177 0 137 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 9 0 9 1 1 0 1 0 8 0 tcpcb 544 197 0 193 1 0 1 1 0 8 0 rttmr 72 1 0 1 1 1 0 1 0 8 0 nd6 48 34 0 30 1 0 1 1 0 8 0 ppxss 1128 26 0 26 7 7 0 1 0 8 0 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 43 0 41 1 0 1 1 0 8 0 pfstkey 112 43 0 41 1 0 1 1 0 8 0 pfstate 328 43 0 41 2 1 1 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 831 0 642 13 1 12 13 0 8 0 art_table 32 832 0 642 2 0 2 2 0 8 0 art_node 16 176 0 142 1 0 1 1 0 8 0 sysvmsgpl 40 26 0 7 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 196 0 186 1 0 1 1 0 8 0 shmpl 112 64 0 5 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 6852 0 5365 49 0 49 49 0 8 0 ffsino 272 6852 0 5365 100 0 100 100 0 8 0 nchpl 144 10156 0 8459 63 0 63 63 0 8 0 uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0 vnodes 200 5926 0 0 312 0 312 312 0 8 0 namei 1024 28574 0 28574 1 0 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 3 0 3 2 2 0 1 0 8 0 scxspl 192 25427 0 25427 9 8 1 7 0 8 1 sigapl 432 2588 0 2573 2 0 2 2 0 8 0 futexpl 56 20192 0 20192 1 0 1 1 0 8 1 knotepl 112 548 0 529 3 2 1 2 0 8 0 kqueuepl 104 288 0 286 1 0 1 1 0 8 0 pipepl 112 1006 0 987 3 2 1 2 0 8 0 fdescpl 488 2589 0 2573 3 0 3 3 0 8 0 filepl 152 12064 0 11964 9 4 5 6 0 8 1 lockfpl 104 1312 0 1312 7 7 0 1 0 8 0 lockfspl 32 629 0 629 7 7 0 1 0 8 0 sessionpl 112 34 0 23 1 0 1 1 0 8 0 pgrppl 48 51 0 40 1 0 1 1 0 8 0 ucredpl 96 1875 0 1866 1 0 1 1 0 8 0 zombiepl 144 2573 0 2572 1 0 1 1 0 8 0 processpl 840 2605 0 2572 4 0 4 4 0 8 0 procpl 600 7029 0 6986 4 0 4 4 0 8 0 srpgc 64 91 0 91 7 7 0 1 0 8 0 sosppl 128 20 0 20 6 6 0 1 0 8 0 sockpl 384 1033 0 1014 6 4 2 4 0 8 0 mcl64k 65536 12 0 0 2 0 2 2 0 8 0 mcl16k 16384 2 0 0 1 0 1 1 0 8 0 mcl12k 12288 10 0 0 1 0 1 1 0 8 0 mcl9k 9216 11 0 0 1 0 1 1 0 8 0 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 13 0 0 2 0 2 2 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 144 0 0 14 1 13 14 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 273 0 0 8 0 8 8 0 8 0 bufpl 256 9216 0 2192 440 0 440 440 0 8 0 anonpl 16 211859 0 202902 73 35 38 52 0 125 0 amapchunkpl 152 13396 0 13310 26 21 5 9 0 158 0 amappl16 192 11083 0 10615 51 27 24 36 0 8 0 amappl15 184 222 0 218 1 0 1 1 0 8 0 amappl14 176 933 0 929 1 0 1 1 0 8 0 amappl13 168 482 0 479 1 0 1 1 0 8 0 amappl12 160 169 0 166 1 0 1 1 0 8 0 amappl11 152 408 0 393 1 0 1 1 0 8 0 amappl10 144 174 0 170 1 0 1 1 0 8 0 amappl9 136 1075 0 1070 1 0 1 1 0 8 0 amappl8 128 673 0 648 1 0 1 1 0 8 0 amappl7 120 172 0 163 1 0 1 1 0 8 0 amappl6 112 296 0 286 1 0 1 1 0 8 0 amappl5 104 241 0 227 1 0 1 1 0 8 0 amappl4 96 3156 0 3124 2 1 1 2 0 8 0 amappl3 88 1080 0 1074 1 0 1 1 0 8 0 amappl2 80 21599 0 21542 2 0 2 2 0 8 0 amappl1 72 60302 0 59864 25 15 10 20 0 8 0 amappl 72 7375 0 7340 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 65 0 5 1 0 1 1 0 8 0 uaddrrnd 24 2589 0 2573 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2589 0 2573 1 0 1 1 0 8 0 vmmpekpl 168 21855 0 21830 2 0 2 2 0 8 0 vmmpepl 168 271406 0 269925 148 78 70 85 0 357 0 vmsppl 360 2588 0 2573 2 0 2 2 0 8 0 pdppl 4096 5185 0 5146 6 0 6 6 0 8 0 pvpl 32 688929 0 676584 211 102 109 135 0 265 8 pmappl 224 2588 0 2573 2 1 1 2 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 597 0 5 17 0 17 17 0 8 0