panic: malloc: allocation too large, type = 2, size = 671088648 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *147290 85485 0 0 0x4000000 0 syz-executor.0 307042 68912 73 0x100010 0 1K syslogd db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:399 panic() at panic+0x174 sys/kern/subr_prf.c:208 malloc(28000008,2,2) at malloc+0xa6f sys/kern/kern_malloc.c:339 wsmux_getmux(5000000) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(5000000,ffff800000026d00) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd8066075d80,80085761,ffff800020c4add0,42,fffffd807f7c6960,ffff800020b74978) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8067565ef0,80085761,ffff800020c4add0,ffff800020b74978) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b74978,ffff800020c4af18,ffff800020c4af00) at sys_ioctl+0x651 syscall(ffff800020c4afb0) at syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c4afb0) at syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,bec48ddb0d8) at Xsyscall+0x128 end of kernel end trace frame: 0xbef31a021a0, 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 = 671088648 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:399 panic() at panic+0x174 sys/kern/subr_prf.c:208 malloc(28000008,2,2) at malloc+0xa6f sys/kern/kern_malloc.c:339 wsmux_getmux(5000000) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(5000000,ffff800000026d00) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd8066075d80,80085761,ffff800020c4add0,42,fffffd807f7c6960,ffff800020b74978) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8067565ef0,80085761,ffff800020c4add0,ffff800020b74978) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b74978,ffff800020c4af18,ffff800020c4af00) at sys_ioctl+0x651 syscall(ffff800020c4afb0) at syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c4afb0) at syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,bec48ddb0d8) at Xsyscall+0x128 end of kernel end trace frame: 0xbef31a021a0, count: -10 ddb{0}> show registers rdi 0xffffffff81cbd0d7 db_enter+0x17 rsi 0x16fe __ALIGN_SIZE+0x6fe rbp 0xffff800020c4a9a0 rbx 0xffff800020c4aa50 rdx 0x16ff __ALIGN_SIZE+0x6ff rcx 0xffff800000b66000 rax 0xffff800000b66000 r8 0xffffffff813ff913 kprintf+0x183 r9 0x1 r10 0x25 r11 0x1fb1904dda8ff45c r12 0x3000000008 r13 0xffff800020c4a9b0 r14 0x100 r15 0x1 rip 0xffffffff81cbd0d8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c4a990 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=147290 stat=onproc flags process=0 proc=4000000 pri=80, usrpri=80, nice=20 forw=0xffffffffffffffff, list=0xffff800020b759e0,0xffffffff823665c0 process=0xffff800020b8c9f0 user=0xffff800020c46000, vmspace=0xfffffd807effe9d8 estcpu=30, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 85485 300410 41146 0 2 0 syz-executor.0 85485 347474 41146 0 3 0x4000080 fsleep syz-executor.0 *85485 147290 41146 0 7 0x4000000 syz-executor.0 63777 381817 1 0 3 0x100083 ttyin getty 21980 447564 0 0 3 0x14200 bored sosplice 19555 273282 61525 0 3 0x82 nanosleep syz-executor.1 41146 370205 61525 0 3 0x82 nanosleep syz-executor.0 61525 233582 35064 0 3 0x82 thrsleep syz-fuzzer 61525 409653 35064 0 3 0x4000082 nanosleep syz-fuzzer 61525 251974 35064 0 3 0x4000082 thrsleep syz-fuzzer 61525 1898 35064 0 3 0x4000082 thrsleep syz-fuzzer 61525 157289 35064 0 3 0x4000082 thrsleep syz-fuzzer 61525 54617 35064 0 3 0x4000082 thrsleep syz-fuzzer 61525 65015 35064 0 3 0x4000082 kqread syz-fuzzer 61525 161373 35064 0 3 0x4000082 thrsleep syz-fuzzer 61525 201364 35064 0 3 0x4000082 thrsleep syz-fuzzer 61525 199591 35064 0 3 0x4000082 thrsleep syz-fuzzer 61525 179398 35064 0 3 0x4000082 thrsleep syz-fuzzer 35064 216942 69409 0 3 0x10008a pause ksh 69409 303187 36910 0 3 0x92 select sshd 36910 53576 1 0 3 0x80 select sshd 24480 439182 36046 74 3 0x100092 bpf pflogd 36046 514773 1 0 3 0x80 netio pflogd 68912 307042 9834 73 7 0x100010 syslogd 9834 429738 1 0 3 0x100082 netio syslogd 8505 8263 1 77 3 0x100090 poll dhclient 90825 347343 1 0 3 0x80 poll dhclient 15334 160959 0 0 3 0x14200 pgzero zerothread 33909 411700 0 0 3 0x14200 aiodoned aiodoned 74747 170686 0 0 3 0x14200 syncer update 38897 283285 0 0 3 0x14200 cleaner cleaner 56106 201806 0 0 3 0x14200 reaper reaper 23123 205955 0 0 3 0x14200 pgdaemon pagedaemon 58921 154199 0 0 3 0x14200 bored crynlk 35862 178249 0 0 3 0x14200 bored crypto 5606 435684 0 0 3 0x40014200 acpi0 acpi0 61860 404955 0 0 3 0x40014200 idle1 72013 217944 0 0 3 0x14200 bored softnet 13182 362939 0 0 3 0x14200 bored systqmp 69767 246911 0 0 3 0x14200 bored systq 45956 325965 0 0 3 0x40014200 bored softclock 76056 93014 0 0 3 0x40014200 idle0 37555 452507 0 0 3 0x14200 bored smr 1 50138 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 85485 (syz-executor.0) thread 0xffff800020b74978 (147290) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8238ec80) locked @ /syzkaller/managers/pf/kernel/sys/sys/syscall_mi.h:90 #0 witness_lock+0x594 sys/kern/subr_witness.c:1205 #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 Process 68912 (syslogd) thread 0xffff800020b76e20 (307042) exclusive rrwlock inode r = 0 (0xfffffd806ebeeb38) locked @ /syzkaller/managers/pf/kernel/sys/ufs/ufs/ufs_vnops.c:1547 #0 witness_lock+0x594 sys/kern/subr_witness.c:1205 #1 _rw_enter+0x45d sys/kern/kern_rwlock.c:280 #2 _rrw_enter+0x60 sys/kern/kern_rwlock.c:410 #3 VOP_LOCK+0x57 sys/kern/vfs_vops.c:602 #4 vn_lock+0x6e sys/kern/vfs_vnops.c:549 #5 sys_fsync+0x114 sys/kern/vfs_syscalls.c:2704 #6 syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] #6 syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 #7 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9503 26905K 27305K 78643K 10762 0 0 pcb 25 9K 10K 78643K 205 0 0 rtable 100 3K 4K 78643K 229 0 0 ifaddr 46 11K 12K 78643K 74 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1474 0 0 iov 0 0K 24K 78643K 48 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1198 75K 75K 78643K 1521 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 18 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12628 0 0 file desc 5 13K 17K 78643K 406 0 0 sigio 0 0K 0K 78643K 11 0 0 proc 53 50K 71K 78643K 368 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 41 0 0 in_multi 33 2K 2K 78643K 51 0 0 ether_multi 1 0K 0K 78643K 2 0 0 mrt 0 0K 0K 78643K 2 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 234 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 92 21K 22K 78643K 2107 0 0 UVM aobj 10 3K 3K 78643K 13 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 12 0 0 NDP 8 0K 0K 78643K 19 0 0 temp 115 2368K 2434K 78643K 4076 0 0 kqueue 0 0K 0K 78643K 2 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 4 0 0 1 0 1 1 0 8 0 inpcbpl 280 181 0 174 1 0 1 1 0 8 0 plimitpl 152 20 0 12 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 42 0 2 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpcb 544 68 0 64 1 0 1 1 0 8 0 rttmr 72 1 0 1 1 1 0 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 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 14 0 7 1 0 1 1 0 8 0 pfstkey 112 14 0 7 1 0 1 1 0 8 0 pfstate 328 14 0 7 1 0 1 1 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 185 0 0 12 0 12 12 0 8 0 art_table 32 186 0 0 2 0 2 2 0 8 0 art_node 16 41 0 7 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 16 0 6 1 0 1 1 0 8 0 shmpl 112 11 0 3 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2340 0 927 46 0 46 46 0 8 0 ffsino 272 2340 0 927 95 0 95 95 0 8 0 nchpl 144 3094 0 1462 61 0 61 61 0 8 0 uvmvnodes 72 2415 0 0 44 0 44 44 0 8 0 vnodes 200 2415 0 0 128 0 128 128 0 8 0 namei 1024 8133 0 8133 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 8144 0 8143 10 9 1 6 0 8 0 sigapl 432 604 0 588 2 0 2 2 0 8 0 futexpl 56 3562 0 3561 1 0 1 1 0 8 0 knotepl 112 127 0 100 2 1 1 2 0 8 0 kqueuepl 104 93 0 91 1 0 1 1 0 8 0 pipepl 112 336 0 317 3 2 1 2 0 8 0 fdescpl 488 605 0 588 3 0 3 3 0 8 0 filepl 152 3174 0 3073 6 1 5 6 0 8 1 lockfpl 104 347 0 346 2 1 1 1 0 8 0 lockfspl 32 243 0 242 2 1 1 1 0 8 0 sessionpl 112 20 0 9 1 0 1 1 0 8 0 pgrppl 48 30 0 19 1 0 1 1 0 8 0 ucredpl 96 454 0 445 1 0 1 1 0 8 0 zombiepl 144 589 0 588 2 1 1 1 0 8 0 processpl 840 621 0 588 4 0 4 4 0 8 0 procpl 600 1429 0 1384 4 0 4 4 0 8 0 srpgc 64 1 0 1 1 1 0 1 0 8 0 sosppl 128 7 0 7 2 2 0 1 0 8 0 sockpl 384 350 0 331 3 1 2 3 0 8 0 mcl64k 65536 1 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 6 0 0 1 0 1 1 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 8 0 0 1 0 1 1 0 8 0 mcl2k2 2112 5 0 0 1 0 1 1 0 8 0 mcl2k 2048 114 0 0 14 0 14 14 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 135 0 0 8 0 8 8 0 8 0 bufpl 256 6355 0 1044 332 0 332 332 0 8 0 anonpl 16 61797 0 54426 48 17 31 46 0 125 0 amapchunkpl 152 3087 0 2994 9 5 4 9 0 158 0 amappl16 192 2120 0 1743 31 12 19 31 0 8 0 amappl15 184 389 0 384 1 0 1 1 0 8 0 amappl14 176 31 0 26 1 0 1 1 0 8 0 amappl13 168 26 0 23 1 0 1 1 0 8 0 amappl12 160 10 0 9 1 0 1 1 0 8 0 amappl11 152 593 0 577 1 0 1 1 0 8 0 amappl10 144 69 0 64 1 0 1 1 0 8 0 amappl9 136 546 0 541 1 0 1 1 0 8 0 amappl8 128 137 0 121 1 0 1 1 0 8 0 amappl7 120 27 0 24 1 0 1 1 0 8 0 amappl6 112 60 0 50 1 0 1 1 0 8 0 amappl5 104 331 0 315 1 0 1 1 0 8 0 amappl4 96 328 0 304 2 1 1 2 0 8 0 amappl3 88 143 0 138 1 0 1 1 0 8 0 amappl2 80 4535 0 4467 2 0 2 2 0 8 0 amappl1 72 21666 0 21202 24 14 10 19 0 8 0 amappl 72 1677 0 1639 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 12 0 3 1 0 1 1 0 8 0 uaddrrnd 24 605 0 588 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 605 0 588 1 0 1 1 0 8 0 vmmpekpl 168 8751 0 8732 2 0 2 2 0 8 0 vmmpepl 168 68910 0 67434 90 25 65 75 0 357 0 vmsppl 360 604 0 588 2 0 2 2 0 8 0 pdppl 4096 1218 0 1176 6 0 6 6 0 8 0 pvpl 32 214530 0 203894 133 38 95 121 0 265 7 pmappl 224 604 0 588 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 482 0 4 14 0 14 14 0 8 0