panic: tcp_output: template len != hdrlen - optlen Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 5749 88697 0 0x2 0x4000000 0 syz-fuzzer db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff823f875f) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac3320) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac3320) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da73c88,9,fffffd8057c7c600,0,0,ffff80001d6a9758) at tcp_usrreq+0xa54 sosend(fffffd805da73c88,0,ffff80001d77d1b8,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d6a9758,3,ffff80001d77d1b8,0,ffff80001d77d2a0) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d6a9758,ffff80001d77d250,ffff80001d77d2a0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d77d320) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc00015d3c8, count: 6 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 tcp_output: template len != hdrlen - optlen ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff823f875f) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac3320) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac3320) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da73c88,9,fffffd8057c7c600,0,0,ffff80001d6a9758) at tcp_usrreq+0xa54 sosend(fffffd805da73c88,0,ffff80001d77d1b8,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d6a9758,3,ffff80001d77d1b8,0,ffff80001d77d2a0) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d6a9758,ffff80001d77d250,ffff80001d77d2a0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d77d320) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc00015d3c8, count: -9 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80001d77cd20 rbx 0xffff80001d77cdd0 rdx 0x2 rcx 0 rax 0x1 r8 0xffffffff813428af kprintf+0x15f r9 0x1 r10 0x2 r11 0xc22befae91b3e1a4 r12 0x3000000008 r13 0xffff80001d77cd30 r14 0x100 r15 0x1 rip 0xffffffff81f2faa8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80001d77cd10 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-fuzzer) pid=5749 stat=onproc flags process=2 proc=4000000 pri=32, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff80001d6a94e8,0xffff80001d6c3620 process=0xffff80001d706af8 user=0xffff80001d778000, vmspace=0xfffffd806bc09770 estcpu=0, cpticks=0, pctcpu=0.18 user=0, sys=0, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 6504 303995 56136 0 2 0 syz-executor.1 6504 107018 56136 0 3 0x4000080 fsleep syz-executor.1 6504 338560 56136 0 2 0x4000000 syz-executor.1 79181 157926 0 0 3 0x14280 nfsidl nfsio 2270 297325 0 0 3 0x14280 nfsidl nfsio 28275 357829 0 0 3 0x14280 nfsidl nfsio 36742 232948 0 0 3 0x14280 nfsidl nfsio 87680 489535 0 0 3 0x14280 nfsidl nfsio 48381 459303 0 0 3 0x14280 nfsidl nfsio 31084 32562 0 0 3 0x14280 nfsidl nfsio 84582 435658 0 0 3 0x14280 nfsidl nfsio 51933 45592 0 0 3 0x14280 nfsidl nfsio 46569 115781 0 0 3 0x14280 nfsidl nfsio 87932 148079 0 0 3 0x14280 nfsidl nfsio 15655 372241 0 0 3 0x14280 nfsidl nfsio 60938 21379 0 0 3 0x14280 nfsidl nfsio 43800 441435 0 0 3 0x14280 nfsidl nfsio 38767 91427 0 0 3 0x14280 nfsidl nfsio 31599 293716 0 0 3 0x14280 nfsidl nfsio 38982 387254 0 0 3 0x14280 nfsidl nfsio 47170 403855 0 0 3 0x14280 nfsidl nfsio 24338 512687 0 0 3 0x14280 nfsidl nfsio 77828 152856 0 0 3 0x14280 nfsidl nfsio 58195 494405 0 0 3 0x14200 bored sosplice 56136 521990 88697 0 3 0x82 nanosleep syz-executor.1 94290 413347 88697 0 3 0x82 nanosleep syz-executor.0 88697 110120 87584 0 3 0x82 thrsleep syz-fuzzer 88697 50208 87584 0 2 0x4000002 syz-fuzzer 88697 441047 87584 0 2 0x4000002 syz-fuzzer 88697 392267 87584 0 3 0x4000082 thrsleep syz-fuzzer 88697 137062 87584 0 3 0x4000082 thrsleep syz-fuzzer 88697 501567 87584 0 3 0x4000082 kqread syz-fuzzer 88697 304127 87584 0 3 0x4000082 thrsleep syz-fuzzer *88697 5749 87584 0 7 0x4000002 syz-fuzzer 87584 462295 88790 0 3 0x10008a pause ksh 88790 255796 86989 0 3 0x92 select sshd 96902 277588 1 0 3 0x100083 ttyin getty 86989 209405 1 0 3 0x80 select sshd 52525 451140 29336 73 3 0x100090 kqread syslogd 29336 231409 1 0 3 0x100082 netio syslogd 91699 149181 1 77 3 0x100090 poll dhclient 71197 264592 1 0 3 0x80 poll dhclient 1011 8201 0 0 3 0x14200 bored smr 54248 506964 0 0 2 0x14200 zerothread 87243 460516 0 0 3 0x14200 aiodoned aiodoned 83740 110786 0 0 3 0x14200 syncer update 3261 377367 0 0 3 0x14200 cleaner cleaner 77849 214832 0 0 3 0x14200 reaper reaper 56186 75294 0 0 3 0x14200 pgdaemon pagedaemon 72079 450251 0 0 3 0x14200 bored crynlk 62709 40227 0 0 3 0x14200 bored crypto 12892 488587 0 0 3 0x40014200 acpi0 acpi0 81702 468929 0 0 3 0x14200 bored softnet 45740 259923 0 0 3 0x14200 bored systqmp 53083 308065 0 0 3 0x14200 bored systq 72615 77047 0 0 3 0x40014200 bored softclock 15508 240895 0 0 3 0x40014200 idle0 1 433982 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 devbuf 9480 6351K 7045K 78643K 11585 0 pcb 13 8K 8K 78643K 37 0 rtable 129 5K 8K 78643K 385 0 ifaddr 62 13K 14K 78643K 128 0 sysctl 2 0K 0K 78643K 2 0 counters 21 16K 16K 78643K 26 0 ioctlops 0 0K 4K 78643K 44 0 iov 0 0K 24K 78643K 25 0 mount 1 1K 1K 78643K 1 0 vnodes 1224 77K 77K 78643K 1486 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 4 0 VM map 2 0K 0K 78643K 2 0 sem 12 0K 0K 78643K 44 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1809 195K 288K 78643K 12938 0 file desc 5 13K 25K 78643K 286 0 proc 50 38K 63K 78643K 406 0 subproc 32 2K 2K 78643K 51 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 14 0 in_multi 53 3K 3K 78643K 74 0 ether_multi 1 0K 0K 78643K 5 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 43 201K 201K 78643K 43 0 exec 0 0K 1K 78643K 210 0 pagedep 1 8K 8K 78643K 1 0 inodedep 1 32K 32K 78643K 1 0 newblk 1 0K 0K 78643K 1 0 VM swap 7 26K 26K 78643K 7 0 UVM amap 133 55K 56K 78643K 1511 0 UVM aobj 19 2K 2K 78643K 21 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 16 0 NDP 10 0K 0K 78643K 21 0 temp 87 3851K 3916K 78643K 2998 0 kqueue 3 4K 8K 78643K 11 0 SYN cache 2 16K 16K 78643K 2 0 ddb> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 10 0 2 1 0 1 1 0 8 0 rtpcb 80 32 0 30 1 0 1 1 0 8 0 rtentry 112 65 0 14 2 0 2 2 0 8 0 unpcb 120 159 0 148 1 0 1 1 0 8 0 syncache 264 6 0 6 2 1 1 1 0 8 1 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 58 0 58 3 2 1 1 0 8 1 tcpcb 544 60 0 55 1 0 1 1 0 8 0 ipq 40 2 0 2 1 0 1 1 0 8 1 ipqe 40 4 0 4 1 0 1 1 0 8 1 inpcb 296 210 0 200 3 1 2 2 0 8 1 nd6 48 11 0 4 1 0 1 1 0 8 0 pkpcb 40 8 0 8 2 1 1 1 0 8 1 ppxss 1136 1 0 1 1 1 0 1 0 8 0 pfrktable 1344 43 0 41 1 0 1 1 0 8 0 pftag 88 6 0 6 1 0 1 1 0 8 1 pfrule 1360 7 0 5 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 247 0 46 13 0 13 13 0 8 0 art_table 32 248 0 46 2 0 2 2 0 8 0 art_node 16 64 0 19 1 0 1 1 0 8 0 sysvmsgpl 40 6 0 4 1 0 1 1 0 8 0 semupl 112 4 0 4 2 2 0 1 0 8 0 semapl 112 42 0 32 1 0 1 1 0 8 0 shmpl 112 18 0 2 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1716 0 315 88 0 88 88 0 8 0 ffsino 240 1716 0 315 83 0 83 83 0 8 0 nchpl 144 2415 0 822 60 0 60 60 0 8 0 uvmvnodes 72 2007 0 0 37 0 37 37 0 8 0 vnodes 208 2007 0 0 106 0 106 106 0 8 0 namei 1024 6834 0 6834 2 1 1 1 0 8 1 vcpupl 1984 3 0 0 1 0 1 1 0 8 0 vmpool 528 3 0 0 1 0 1 1 0 8 0 pfiaddrpl 120 14 0 12 1 0 1 1 0 8 0 scxspl 192 6823 0 6823 1 0 1 1 0 8 1 plimitpl 152 37 0 30 1 0 1 1 0 8 0 sigapl 424 490 0 441 6 0 6 6 0 8 0 futexpl 56 4965 0 4964 2 1 1 1 0 8 0 knotepl 112 82 0 63 1 0 1 1 0 8 0 kqueuepl 144 24 0 22 1 0 1 1 0 8 0 pipepl 272 116 0 106 1 0 1 1 0 8 0 fdescpl 432 455 0 441 2 0 2 2 0 8 0 filepl 120 2643 0 2545 4 0 4 4 0 8 0 lockfpl 104 51 0 50 1 0 1 1 0 8 0 lockfspl 48 20 0 19 1 0 1 1 0 8 0 sessionpl 112 18 0 8 1 0 1 1 0 8 0 pgrppl 48 22 0 12 1 0 1 1 0 8 0 ucredpl 96 190 0 183 1 0 1 1 0 8 0 zombiepl 144 441 0 440 1 0 1 1 0 8 0 processpl 928 490 0 440 7 0 7 7 0 8 0 procpl 624 777 0 718 6 1 5 5 0 8 0 sosppl 128 2 0 2 1 0 1 1 0 8 1 sockpl 400 409 0 388 5 1 4 4 0 8 1 mcl64k 65536 9 0 9 2 1 1 1 0 8 1 mcl16k 16384 1 0 1 1 0 1 1 0 8 1 mcl12k 12288 4 0 4 1 0 1 1 0 8 1 mcl9k 9216 5 0 5 2 1 1 1 0 8 1 mcl8k 8192 8 0 8 2 1 1 1 0 8 1 mcl4k 4096 33 0 33 3 2 1 1 0 8 1 mcl2k 2048 90896 0 90845 16 8 8 12 0 8 0 mtagpl 96 150 0 33 4 1 3 3 0 8 0 mbufpl 256 145051 0 144723 25 3 22 22 0 8 0 bufpl 280 3882 0 126 269 0 269 269 0 8 0 anonpl 16 59660 0 43162 77 2 75 75 0 107 0 amapchunkpl 152 2026 0 1879 8 1 7 8 0 158 0 amappl16 192 2183 0 1171 52 0 52 52 0 8 1 amappl15 184 1 0 0 1 0 1 1 0 8 0 amappl14 176 154 0 148 1 0 1 1 0 8 0 amappl13 168 43 0 38 1 0 1 1 0 8 0 amappl12 160 11 0 8 1 0 1 1 0 8 0 amappl11 152 181 0 170 1 0 1 1 0 8 0 amappl10 144 117 0 112 1 0 1 1 0 8 0 amappl9 136 367 0 366 1 0 1 1 0 8 0 amappl8 128 351 0 310 2 0 2 2 0 8 0 amappl7 120 218 0 206 1 0 1 1 0 8 0 amappl6 112 97 0 88 1 0 1 1 0 8 0 amappl5 104 273 0 263 1 0 1 1 0 8 0 amappl4 96 565 0 535 1 0 1 1 0 8 0 amappl3 88 169 0 164 1 0 1 1 0 8 0 amappl2 80 2751 0 2685 2 0 2 2 0 8 0 amappl1 72 18938 0 18518 24 15 9 17 0 8 0 amappl 80 998 0 951 2 0 2 2 0 84 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 dma128 128 253 0 253 1 1 0 1 0 8 0 dma64 64 6 0 6 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 64 20 0 2 1 0 1 1 0 8 0 uaddrrnd 24 458 0 441 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 458 0 441 1 0 1 1 0 8 0 vmmpekpl 168 6957 0 6926 2 0 2 2 0 8 0 vmmpepl 168 62905 0 60785 148 16 132 132 0 357 35 vmsppl 272 457 0 441 2 0 2 2 0 8 0 pdppl 4096 922 0 885 6 1 5 6 0 8 0 pvpl 32 187111 0 167501 181 7 174 181 0 265 1 pmappl 200 457 0 441 1 0 1 1 0 8 0 extentpl 40 53 0 36 1 0 1 1 0 8 0 phpool 112 263 0 21 7 0 7 7 0 8 0 ddb> machine ddbcpu 0 No such command ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff823f875f) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac3320) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac3320) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da73c88,9,fffffd8057c7c600,0,0,ffff80001d6a9758) at tcp_usrreq+0xa54 sosend(fffffd805da73c88,0,ffff80001d77d1b8,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d6a9758,3,ffff80001d77d1b8,0,ffff80001d77d2a0) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d6a9758,ffff80001d77d250,ffff80001d77d2a0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d77d320) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc00015d3c8, count: -9 ddb> machine ddbcpu 1 No such command ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff823f875f) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac3320) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac3320) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da73c88,9,fffffd8057c7c600,0,0,ffff80001d6a9758) at tcp_usrreq+0xa54 sosend(fffffd805da73c88,0,ffff80001d77d1b8,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d6a9758,3,ffff80001d77d1b8,0,ffff80001d77d2a0) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d6a9758,ffff80001d77d250,ffff80001d77d2a0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d77d320) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc00015d3c8, count: -9