panic: mallocarray: overflow 18446744071562067968 * 8 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 402134 75952 0 0 0 0 syz-executor.0 *272708 75952 0 0 0x4000000 1K syz-executor.0 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:399 panic() at panic+0x174 sys/kern/subr_prf.c:208 krpc_get_xid() at krpc_get_xid wsmux_getmux(7fffffff) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(7fffffff,ffff800000026d00) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd80666440e8,80085761,ffff800020bfcf50,3,fffffd807f7c69c0,ffff800020b659e0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd806cbea270,80085761,ffff800020bfcf50,ffff800020b659e0) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b659e0,ffff800020bfd098,ffff800020bfd080) at sys_ioctl+0x651 syscall(ffff800020bfd130) at syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020bfd130) at syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,20aa98d6010) at Xsyscall+0x128 end of kernel end trace frame: 0x20ceb090d60, 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 mallocarray: overflow 18446744071562067968 * 8 ddb{1}> 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 krpc_get_xid() at krpc_get_xid wsmux_getmux(7fffffff) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(7fffffff,ffff800000026d00) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd80666440e8,80085761,ffff800020bfcf50,3,fffffd807f7c69c0,ffff800020b659e0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd806cbea270,80085761,ffff800020bfcf50,ffff800020b659e0) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b659e0,ffff800020bfd098,ffff800020bfd080) at sys_ioctl+0x651 syscall(ffff800020bfd130) at syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020bfd130) at syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,20aa98d6010) at Xsyscall+0x128 end of kernel end trace frame: 0x20ceb090d60, count: -10 ddb{1}> show registers rdi 0xffffffff81896607 db_enter+0x17 rsi 0x14a5 __ALIGN_SIZE+0x4a5 rbp 0xffff800020bfcb90 rbx 0xffff800020bfcc40 rdx 0x14a6 __ALIGN_SIZE+0x4a6 rcx 0xffff800000966000 rax 0xffff800000966000 r8 0xffffffff81cff133 kprintf+0x183 r9 0x1 r10 0x25 r11 0x601488c9cb29b98f r12 0x3000000008 r13 0xffff800020bfcba0 r14 0x100 r15 0x1 rip 0xffffffff81896608 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020bfcb80 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=272708 stat=onproc flags process=0 proc=4000000 pri=75, usrpri=75, nice=20 forw=0xffffffffffffffff, list=0xffff800020b64018,0xffff800020b65798 process=0xffff800020b7d710 user=0xffff800020bf8000, vmspace=0xfffffd807f00bb40 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 60190 49943 60541 0 2 0 syz-executor.1 75952 402134 34982 0 7 0 syz-executor.0 *75952 272708 34982 0 7 0x4000000 syz-executor.0 60541 488124 28747 0 3 0x82 nanosleep syz-executor.1 34982 9603 28747 0 3 0x82 nanosleep syz-executor.0 5508 439214 0 0 3 0x14200 bored sosplice 43259 478543 1 0 3 0x100083 ttyin getty 28747 501140 35802 0 3 0x82 thrsleep syz-fuzzer 28747 266864 35802 0 3 0x4000082 thrsleep syz-fuzzer 28747 297627 35802 0 3 0x4000082 thrsleep syz-fuzzer 28747 48583 35802 0 3 0x4000082 thrsleep syz-fuzzer 28747 233409 35802 0 3 0x4000082 kqread syz-fuzzer 28747 53640 35802 0 3 0x4000082 thrsleep syz-fuzzer 28747 470282 35802 0 3 0x4000082 thrsleep syz-fuzzer 28747 11962 35802 0 3 0x4000082 thrsleep syz-fuzzer 28747 322070 35802 0 3 0x4000082 thrsleep syz-fuzzer 28747 506064 35802 0 3 0x4000082 thrsleep syz-fuzzer 28747 462145 35802 0 3 0x4000082 thrsleep syz-fuzzer 35802 368717 67046 0 3 0x10008a pause ksh 67046 150487 77248 0 3 0x92 select sshd 77248 262491 1 0 3 0x80 select sshd 15895 186129 17835 74 3 0x100092 bpf pflogd 17835 131152 1 0 3 0x80 netio pflogd 97925 296565 27456 73 3 0x100090 kqread syslogd 27456 430057 1 0 3 0x100082 netio syslogd 57047 368418 1 77 3 0x100090 poll dhclient 80863 273690 1 0 3 0x80 poll dhclient 87808 207468 0 0 2 0x14200 zerothread 29889 150551 0 0 3 0x14200 aiodoned aiodoned 13253 439959 0 0 3 0x14200 syncer update 46634 9202 0 0 3 0x14200 cleaner cleaner 73761 115404 0 0 3 0x14200 reaper reaper 33315 64345 0 0 3 0x14200 pgdaemon pagedaemon 37925 73117 0 0 3 0x14200 bored crynlk 38982 219672 0 0 3 0x14200 bored crypto 46362 347249 0 0 3 0x40014200 acpi0 acpi0 37630 101726 0 0 3 0x40014200 idle1 11113 420589 0 0 3 0x14200 bored softnet 44800 86780 0 0 3 0x14200 bored systqmp 87164 345662 0 0 3 0x14200 bored systq 62697 299688 0 0 3 0x40014200 bored softclock 60070 279522 0 0 3 0x40014200 idle0 46731 342028 0 0 3 0x14200 bored smr 1 149027 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 75952 (syz-executor.0) thread 0xffff800020b659e0 (272708) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82373b28) 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 9521 6436K 6436K 78643K 10895 0 0 pcb 25 9K 12K 78643K 423 0 0 rtable 100 3K 4K 78643K 480 0 0 ifaddr 56 13K 13K 78643K 194 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1486 0 0 iov 0 0K 16K 78643K 69 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1204 75K 76K 78643K 1607 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 23 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 77 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12628 0 0 file desc 6 17K 21K 78643K 690 0 0 sigio 0 0K 0K 78643K 17 0 0 proc 54 51K 71K 78643K 450 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 57 0 0 in_multi 33 2K 2K 78643K 85 0 0 ether_multi 1 0K 0K 78643K 3 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 90 397K 397K 78643K 90 0 0 exec 0 0K 1K 78643K 254 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 30K 78643K 3185 0 0 UVM aobj 32 4K 4K 78643K 38 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 26 0 0 NDP 11 0K 0K 78643K 54 0 0 temp 164 2375K 2443K 78643K 5212 0 0 kqueue 0 0K 0K 78643K 16 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 368 0 361 1 0 1 1 0 8 0 plimitpl 152 42 0 34 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 124 0 120 1 0 1 1 0 8 0 nd6 48 10 0 6 1 0 1 1 0 8 0 ppxss 1128 28 0 28 3 3 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 27 0 18 1 0 1 1 0 8 0 pfstkey 112 27 0 18 1 0 1 1 0 8 0 pfstate 328 27 0 18 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 314 0 126 12 0 12 12 0 8 0 art_table 32 315 0 126 2 0 2 2 0 8 0 art_node 16 67 0 33 1 0 1 1 0 8 0 sysvmsgpl 40 10 0 6 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 73 0 63 1 0 1 1 0 8 0 shmpl 112 36 0 6 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2673 0 1245 47 0 47 47 0 8 0 ffsino 272 2673 0 1245 96 0 96 96 0 8 0 nchpl 144 3852 0 2209 61 0 61 61 0 8 0 uvmvnodes 72 2822 0 0 52 0 52 52 0 8 0 vnodes 200 2822 0 0 149 0 149 149 0 8 0 namei 1024 11314 0 11314 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 9945 0 9945 10 9 1 6 0 8 1 sigapl 432 878 0 862 2 0 2 2 0 8 0 futexpl 56 7728 0 7728 1 0 1 1 0 8 1 knotepl 112 312 0 285 3 2 1 2 0 8 0 kqueuepl 104 220 0 218 1 0 1 1 0 8 0 pipepl 112 630 0 611 3 2 1 2 0 8 0 fdescpl 488 879 0 862 3 0 3 3 0 8 0 filepl 152 5432 0 5332 7 2 5 7 0 8 1 lockfpl 104 275 0 275 4 3 1 1 0 8 1 lockfspl 32 386 0 386 4 3 1 1 0 8 1 sessionpl 112 22 0 11 1 0 1 1 0 8 0 pgrppl 48 33 0 22 1 0 1 1 0 8 0 ucredpl 96 1153 0 1144 1 0 1 1 0 8 0 zombiepl 144 862 0 862 2 1 1 1 0 8 1 processpl 840 895 0 862 4 0 4 4 0 8 0 procpl 600 2430 0 2386 4 0 4 4 0 8 0 srpgc 64 18 0 18 2 2 0 1 0 8 0 sosppl 128 5 0 5 2 1 1 1 0 8 1 sockpl 384 718 0 699 4 1 3 4 0 8 1 mcl64k 65536 6 0 0 1 0 1 1 0 8 0 mcl16k 16384 5 0 0 1 0 1 1 0 8 0 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl9k 9216 5 0 0 1 0 1 1 0 8 0 mcl8k 8192 5 0 0 1 0 1 1 0 8 0 mcl4k 4096 10 0 0 2 0 2 2 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 119 0 0 14 0 14 14 0 8 0 mtagpl 80 2 0 0 1 0 1 1 0 8 0 mbufpl 256 204 0 0 9 0 9 9 0 8 0 bufpl 256 6621 0 1048 349 0 349 349 0 8 0 anonpl 16 97907 0 89024 82 22 60 69 0 125 21 amapchunkpl 152 5277 0 5191 17 13 4 9 0 158 0 amappl16 192 4014 0 3537 59 33 26 48 0 8 1 amappl15 184 7 0 5 1 0 1 1 0 8 0 amappl14 176 144 0 141 1 0 1 1 0 8 0 amappl13 168 625 0 621 1 0 1 1 0 8 0 amappl12 160 139 0 136 1 0 1 1 0 8 0 amappl11 152 279 0 264 1 0 1 1 0 8 0 amappl10 144 168 0 162 1 0 1 1 0 8 0 amappl9 136 411 0 407 1 0 1 1 0 8 0 amappl8 128 279 0 260 1 0 1 1 0 8 0 amappl7 120 467 0 461 1 0 1 1 0 8 0 amappl6 112 59 0 51 1 0 1 1 0 8 0 amappl5 104 144 0 129 1 0 1 1 0 8 0 amappl4 96 335 0 309 2 1 1 2 0 8 0 amappl3 88 142 0 136 1 0 1 1 0 8 0 amappl2 80 7214 0 7153 2 0 2 2 0 8 0 amappl1 72 28513 0 28070 24 14 10 19 0 8 0 amappl 72 2702 0 2667 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 37 0 6 1 0 1 1 0 8 0 uaddrrnd 24 879 0 862 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 879 0 862 1 0 1 1 0 8 0 vmmpekpl 168 11421 0 11401 2 0 2 2 0 8 0 vmmpepl 168 99988 0 98463 124 43 81 90 0 357 11 vmsppl 360 878 0 862 2 0 2 2 0 8 0 pdppl 4096 1766 0 1724 6 0 6 6 0 8 0 pvpl 32 290725 0 278570 186 26 160 169 0 265 58 pmappl 224 878 0 862 2 1 1 2 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 502 0 4 15 0 15 15 0 8 0