panic: mallocarray: overflow 18446744071562067968 * 8 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 47929 38759 0 0 0x4000000 0 syz-executor.0 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:208 drm_prime_remove_buf_handle_locked(ffffffff80000000,8) at drm_prime_remove_buf_handle_locked wsmux_getmux(7fffffff) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(7fffffff,ffff800000669100) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd803de7e820,80085761,ffff8000149f8530,3,fffffd803f7c6cc0,ffff8000ffff9778) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd802f798d30,80085761,ffff8000149f8530,ffff8000ffff9778) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff8000ffff9778,ffff8000149f8678,ffff8000149f8660) at sys_ioctl+0x638 syscall(ffff8000149f8710) at syscall+0x541 Xsyscall(6,0,ffffffffffffff86,0,3,fabc628f010) at Xsyscall+0x128 end of kernel end trace frame: 0xfadd15a73c0, 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> ddb> set $lines = 0 ddb> set $maxwidth = 0 ddb> show panic mallocarray: overflow 18446744071562067968 * 8 ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:208 drm_prime_remove_buf_handle_locked(ffffffff80000000,8) at drm_prime_remove_buf_handle_locked wsmux_getmux(7fffffff) at wsmux_getmux+0x71 sys/dev/wscons/wsmux.c:152 wsmux_add_mux(7fffffff,ffff800000669100) at wsmux_add_mux+0x2f sys/dev/wscons/wsmux.c:594 VOP_IOCTL(fffffd803de7e820,80085761,ffff8000149f8530,3,fffffd803f7c6cc0,ffff8000ffff9778) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd802f798d30,80085761,ffff8000149f8530,ffff8000ffff9778) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff8000ffff9778,ffff8000149f8678,ffff8000149f8660) at sys_ioctl+0x638 syscall(ffff8000149f8710) at syscall+0x541 Xsyscall(6,0,ffffffffffffff86,0,3,fabc628f010) at Xsyscall+0x128 end of kernel end trace frame: 0xfadd15a73c0, count: -10 ddb> show registers rdi 0xffffffff819129c7 db_enter+0x17 rsi 0x1908 __ALIGN_SIZE+0x908 rbp 0xffff8000149f8170 rbx 0xffff8000149f8220 rdx 0x1909 __ALIGN_SIZE+0x909 rcx 0xffff800002b3d000 rax 0xffff800002b3d000 r8 0xffff8000149f8130 r9 0x1 r10 0xffff800001b3cb00 r11 0x944b61685689bd10 r12 0x3000000008 r13 0xffff8000149f8180 r14 0x100 r15 0x1 rip 0xffffffff819129c8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000149f8160 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=47929 stat=onproc flags process=0 proc=4000000 pri=73, usrpri=73, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff8008,0xffff8000ffff8720 process=0xffff8000ffff7078 user=0xffff8000149f3000, vmspace=0xfffffd803f013c60 estcpu=23, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 29031 440887 68167 0 2 0 syz-executor.1 29031 262298 68167 0 2 0x4000000 syz-executor.1 29031 410541 68167 0 3 0x4000080 fsleep syz-executor.1 38759 305871 39685 0 2 0 syz-executor.0 *38759 47929 39685 0 7 0x4000000 syz-executor.0 39685 300043 2622 0 3 0x82 nanosleep syz-executor.0 68167 379499 2622 0 3 0x82 nanosleep syz-executor.1 2622 61501 71755 0 3 0x82 thrsleep syz-fuzzer 2622 234961 71755 0 3 0x4000082 thrsleep syz-fuzzer 2622 467485 71755 0 3 0x4000082 kqread syz-fuzzer 2622 242306 71755 0 3 0x4000082 thrsleep syz-fuzzer 2622 315936 71755 0 3 0x4000082 thrsleep syz-fuzzer 2622 21711 71755 0 3 0x4000082 thrsleep syz-fuzzer 2622 434352 71755 0 3 0x4000082 thrsleep syz-fuzzer 71755 101792 10689 0 3 0x10008a pause ksh 10689 29258 75085 0 3 0x92 select sshd 89196 482933 1 0 3 0x100083 ttyin getty 75085 364754 1 0 3 0x80 select sshd 17185 131061 26549 73 3 0x100090 kqread syslogd 26549 341174 1 0 3 0x100082 netio syslogd 29086 462510 1 77 3 0x100090 poll dhclient 81357 452378 1 0 3 0x80 poll dhclient 36840 408595 0 0 2 0x14200 zerothread 53554 463223 0 0 3 0x14200 aiodoned aiodoned 46332 171693 0 0 3 0x14200 syncer update 90891 90278 0 0 3 0x14200 cleaner cleaner 44319 395428 0 0 3 0x14200 reaper reaper 22084 49662 0 0 3 0x14200 pgdaemon pagedaemon 64875 282561 0 0 3 0x14200 bored crynlk 198 370557 0 0 3 0x14200 bored crypto 11500 7437 0 0 3 0x40014200 acpi0 acpi0 7357 337483 0 0 3 0x14200 bored softnet 80709 332358 0 0 3 0x14200 bored systqmp 865 59974 0 0 3 0x14200 bored systq 70078 348502 0 0 3 0x40014200 bored softclock 65114 446094 0 0 3 0x40014200 idle0 3366 419371 0 0 3 0x14200 bored smr 1 294949 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9450 6330K 6338K 78643K 10556 0 0 pcb 23 9K 9K 78643K 89 0 0 rtable 97 2K 3K 78643K 169 0 0 ifaddr 38 10K 10K 78643K 38 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 0 0K 2K 78643K 15 0 0 iov 0 0K 16K 78643K 14 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1196 75K 75K 78643K 1233 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 1K 78643K 2 0 0 VM map 2 0K 0K 78643K 2 0 0 sem 12 0K 0K 78643K 12 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12537 0 0 file desc 6 17K 21K 78643K 69 0 0 sigio 1 0K 0K 78643K 9 0 0 proc 41 30K 46K 78643K 255 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 13 0 0 in_multi 33 2K 2K 78643K 41 0 0 ether_multi 1 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 48 212K 212K 78643K 48 0 0 exec 0 0K 1K 78643K 169 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 77 20K 22K 78643K 925 0 0 UVM aobj 6 2K 2K 78643K 6 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 6 0 0 NDP 6 0K 0K 78643K 10 0 0 temp 93 2349K 2413K 78643K 3012 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb> 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 64 0 57 1 0 1 1 0 8 0 plimitpl 152 16 0 9 1 0 1 1 0 8 0 rtentry 112 41 0 1 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpcb 544 24 0 20 1 0 1 1 0 8 0 nd6 48 4 0 0 1 0 1 1 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 40 0 6 1 0 1 1 0 8 0 sysvmsgpl 40 2 0 0 1 0 1 1 0 8 0 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 112 10 0 0 1 0 1 1 0 8 0 shmpl 112 4 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1528 0 125 46 0 46 46 0 8 0 ffsino 240 1528 0 125 84 0 84 84 0 8 1 nchpl 144 1832 0 208 61 0 61 61 0 8 0 uvmvnodes 72 1574 0 0 29 0 29 29 0 8 0 vnodes 200 1574 0 0 83 0 83 83 0 8 0 namei 1024 4491 0 4491 2 1 1 1 0 8 1 scxspl 192 4739 0 4739 7 4 3 6 0 8 3 sigapl 432 239 0 225 2 0 2 2 0 8 0 futexpl 56 1012 0 1011 1 0 1 1 0 8 0 knotepl 112 53 0 34 1 0 1 1 0 8 0 kqueuepl 104 14 0 12 1 0 1 1 0 8 0 pipepl 112 154 0 135 2 1 1 1 0 8 0 fdescpl 424 240 0 225 2 0 2 2 0 8 0 filepl 120 1286 0 1191 4 0 4 4 0 8 1 lockfpl 104 25 0 25 2 1 1 1 0 8 1 lockfspl 32 10 0 10 2 1 1 1 0 8 1 sessionpl 112 17 0 7 1 0 1 1 0 8 0 pgrppl 48 17 0 7 1 0 1 1 0 8 0 ucredpl 96 145 0 138 1 0 1 1 0 8 0 zombiepl 144 225 0 225 2 1 1 1 0 8 1 processpl 840 254 0 225 4 0 4 4 0 8 0 procpl 600 337 0 299 4 0 4 4 0 8 1 sockpl 384 130 0 113 3 0 3 3 0 8 1 mcl64k 65536 4 0 4 1 0 1 1 0 8 1 mcl9k 9216 2 0 2 1 0 1 1 0 8 1 mcl4k 4096 14 0 14 2 1 1 1 0 8 1 mcl2k2 2112 1 0 1 1 0 1 1 0 8 1 mcl2k 2048 47298 0 47266 16 5 11 12 0 8 6 mtagpl 80 2 0 2 1 1 0 1 0 8 0 mbufpl 256 77442 0 77381 11 5 6 7 0 8 0 bufpl 256 6949 0 1338 351 0 351 351 0 8 0 anonpl 16 36645 0 28067 53 2 51 51 0 62 16 amapchunkpl 152 1283 0 1189 14 0 14 14 0 158 10 amappl16 192 726 0 280 24 0 24 24 0 8 1 amappl15 184 49 0 45 1 0 1 1 0 8 0 amappl14 176 47 0 44 2 1 1 1 0 8 0 amappl13 168 26 0 23 1 0 1 1 0 8 0 amappl12 160 44 0 39 1 0 1 1 0 8 0 amappl11 152 19 0 8 1 0 1 1 0 8 0 amappl10 144 82 0 79 2 1 1 1 0 8 0 amappl9 136 530 0 527 1 0 1 1 0 8 0 amappl8 128 109 0 98 1 0 1 1 0 8 0 amappl7 120 26 0 22 1 0 1 1 0 8 0 amappl6 112 51 0 44 1 0 1 1 0 8 0 amappl5 104 134 0 123 1 0 1 1 0 8 0 amappl4 96 391 0 367 2 1 1 2 0 8 0 amappl3 88 175 0 166 1 0 1 1 0 8 0 amappl2 80 1078 0 1019 2 0 2 2 0 8 0 amappl1 72 13692 0 13252 26 13 13 19 0 8 4 amappl 72 562 0 525 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 5 0 0 1 0 1 1 0 8 0 uaddrrnd 24 240 0 225 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 240 0 225 1 0 1 1 0 8 0 vmmpekpl 168 5872 0 5854 1 0 1 1 0 8 0 vmmpepl 168 32334 0 30865 85 14 71 72 0 357 7 vmsppl 264 239 0 225 2 0 2 2 0 8 1 pdppl 4096 486 0 450 5 0 5 5 0 8 0 pvpl 32 157730 0 146006 223 5 218 218 0 265 123 pmappl 192 239 0 225 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 491 0 14 14 0 14 14 0 8 0