panic: tcp_output: template len != hdrlen - optlen Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *369490 12143 0 0x2 0x4000000 0 syz-fuzzer db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff823f4d9e) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac2320) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac2320) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da86af8,9,fffffd805e5a7000,0,0,ffff80001d717280) at tcp_usrreq+0xa54 sosend(fffffd805da86af8,0,ffff80001d73fed8,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d717280,3,ffff80001d73fed8,0,ffff80001d73ffc0) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d717280,ffff80001d73ff70,ffff80001d73ffc0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d740040) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0001613c8, 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(ffffffff823f4d9e) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac2320) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac2320) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da86af8,9,fffffd805e5a7000,0,0,ffff80001d717280) at tcp_usrreq+0xa54 sosend(fffffd805da86af8,0,ffff80001d73fed8,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d717280,3,ffff80001d73fed8,0,ffff80001d73ffc0) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d717280,ffff80001d73ff70,ffff80001d73ffc0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d740040) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0001613c8, count: -9 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80001d73fa40 rbx 0xffff80001d73faf0 rdx 0x2 rcx 0 rax 0x1 r8 0xffffffff8201b2ff kprintf+0x15f r9 0x1 r10 0x2 r11 0xd2f1b5b18d08581d r12 0x3000000008 r13 0xffff80001d73fa50 r14 0x100 r15 0x1 rip 0xffffffff822f9738 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80001d73fa30 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-fuzzer) pid=369490 stat=onproc flags process=2 proc=4000000 pri=50, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff80001d718120,0xffff80001d7179e0 process=0xffff8000ffff8ae0 user=0xffff80001d73b000, vmspace=0xfffffd806bc0a660 estcpu=0, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 55411 322423 16786 0 3 0x3000 suspend syz-executor.0 55411 144817 16786 0 3 0x4081000 smrbar syz-executor.0 61457 11543 0 0 3 0x14200 bored sosplice 16786 90323 12143 0 3 0x82 nanosleep syz-executor.0 95154 341487 12143 0 2 0x2 syz-executor.1 12143 301572 47510 0 3 0x82 thrsleep syz-fuzzer 12143 32214 47510 0 3 0x4000082 nanosleep syz-fuzzer *12143 369490 47510 0 7 0x4000002 syz-fuzzer 12143 296789 47510 0 3 0x4000082 thrsleep syz-fuzzer 12143 88365 47510 0 3 0x4000082 kqread syz-fuzzer 12143 335385 47510 0 3 0x4000082 thrsleep syz-fuzzer 12143 304348 47510 0 3 0x4000082 thrsleep syz-fuzzer 12143 104369 47510 0 3 0x4000082 thrsleep syz-fuzzer 47510 276774 8560 0 3 0x10008a pause ksh 8560 307367 71157 0 3 0x92 select sshd 52474 322591 1 0 3 0x100083 ttyin getty 71157 75051 1 0 3 0x80 select sshd 64759 270901 91837 73 3 0x100090 kqread syslogd 91837 191578 1 0 3 0x100082 netio syslogd 20279 20735 1 77 3 0x100090 poll dhclient 72478 51954 1 0 3 0x80 poll dhclient 73383 458686 0 0 3 0x14200 bored smr 25255 375458 0 0 3 0x14200 pgzero zerothread 34904 454040 0 0 3 0x14200 aiodoned aiodoned 56988 500306 0 0 3 0x14200 syncer update 21848 113000 0 0 3 0x14200 cleaner cleaner 1878 298159 0 0 3 0x14200 reaper reaper 42236 379022 0 0 3 0x14200 pgdaemon pagedaemon 29651 426929 0 0 3 0x14200 bored crynlk 58625 393013 0 0 3 0x14200 bored crypto 53905 30408 0 0 3 0x40014200 acpi0 acpi0 2119 134114 0 0 3 0x14200 bored softnet 77760 246004 0 0 3 0x14200 bored systqmp 81085 28307 0 0 3 0x14200 bored systq 90264 13526 0 0 3 0x40014200 bored softclock 80666 486970 0 0 3 0x40014200 idle0 1 186967 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 9477 6335K 6593K 78643K 10675 0 pcb 13 8K 8K 78643K 41 0 rtable 122 7K 7K 78643K 337 0 ifaddr 65 14K 14K 78643K 114 0 counters 22 16K 16K 78643K 26 0 ioctlops 0 0K 4K 78643K 37 0 iov 0 0K 12K 78643K 16 0 mount 1 1K 1K 78643K 1 0 vnodes 1217 77K 77K 78643K 1257 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 3 0 VM map 2 0K 0K 78643K 2 0 sem 12 0K 0K 78643K 22 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1809 195K 288K 78643K 12938 0 file desc 5 13K 25K 78643K 132 0 proc 49 38K 63K 78643K 367 0 subproc 32 2K 2K 78643K 34 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 5 0 in_multi 40 2K 2K 78643K 58 0 ether_multi 1 0K 0K 78643K 2 0 mrt 0 0K 0K 78643K 5 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 37 175K 175K 78643K 37 0 exec 0 0K 1K 78643K 185 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 123 39K 39K 78643K 1147 0 UVM aobj 12 4K 4K 78643K 12 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 14 0 NDP 9 0K 0K 78643K 19 0 temp 84 3852K 3916K 78643K 3289 0 kqueue 3 4K 4K 78643K 3 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 7 0 1 1 0 1 1 0 8 0 rtpcb 80 33 0 31 1 0 1 1 0 8 0 rtentry 112 56 0 12 2 0 2 2 0 8 0 unpcb 120 63 0 55 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 95 0 95 1 1 0 1 0 8 0 tcpcb 544 44 0 38 1 0 1 1 0 8 0 inpcb 296 160 0 149 3 1 2 2 0 8 1 nd6 48 10 0 4 1 0 1 1 0 8 0 ppxss 1128 1 0 1 1 0 1 1 0 8 1 pfrktable 1344 40 0 33 2 1 1 1 0 8 0 pftag 88 10 0 8 2 1 1 1 0 8 0 pfrule 1360 10 0 6 2 1 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 197 0 3 13 0 13 13 0 8 0 art_table 32 198 0 3 2 0 2 2 0 8 0 art_node 16 55 0 15 1 0 1 1 0 8 0 semupl 112 4 0 4 1 1 0 1 0 8 0 semapl 112 14 0 4 1 0 1 1 0 8 0 shmpl 112 10 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1566 0 170 88 0 88 88 0 8 0 ffsino 240 1566 0 170 83 0 83 83 0 8 0 nchpl 144 1997 0 405 60 0 60 60 0 8 0 uvmvnodes 72 1632 0 0 30 0 30 30 0 8 0 vnodes 208 1632 0 0 86 0 86 86 0 8 0 namei 1024 5092 0 5091 2 1 1 1 0 8 0 vcpupl 1984 2 0 0 1 0 1 1 0 8 0 vmpool 528 2 0 0 1 0 1 1 0 8 0 pfiaddrpl 120 14 0 8 2 1 1 1 0 8 0 scxspl 192 5674 0 5674 1 0 1 1 0 8 1 plimitpl 152 22 0 15 1 0 1 1 0 8 0 sigapl 424 319 0 290 4 0 4 4 0 8 0 futexpl 56 2350 0 2350 1 0 1 1 0 8 1 knotepl 112 61 0 42 1 0 1 1 0 8 0 kqueuepl 144 8 0 6 1 0 1 1 0 8 0 pipepl 272 80 0 70 1 0 1 1 0 8 0 fdescpl 432 304 0 290 2 0 2 2 0 8 0 filepl 120 1766 0 1667 4 0 4 4 0 8 0 lockfpl 104 37 0 36 1 0 1 1 0 8 0 lockfspl 48 13 0 12 1 0 1 1 0 8 0 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 112 0 105 1 0 1 1 0 8 0 zombiepl 144 291 0 290 2 1 1 1 0 8 0 processpl 920 319 0 290 4 0 4 4 0 8 0 procpl 624 449 0 412 4 0 4 4 0 8 1 sosppl 128 2 0 2 1 1 0 1 0 8 0 sockpl 400 256 0 235 3 0 3 3 0 8 0 mcl64k 65536 9 0 9 1 0 1 1 0 8 1 mcl12k 12288 3 0 3 1 0 1 1 0 8 1 mcl9k 9216 3 0 3 2 1 1 1 0 8 1 mcl8k 8192 1 0 1 1 0 1 1 0 8 1 mcl4k 4096 18 0 17 2 1 1 1 0 8 0 mcl2k2 2112 2 0 2 1 1 0 1 0 8 0 mcl2k 2048 79213 0 79163 16 7 9 15 0 8 1 mtagpl 96 8 0 2 2 1 1 1 0 8 0 mbufpl 256 125728 0 125600 11 0 11 11 0 8 0 bufpl 280 3542 0 125 245 0 245 245 0 8 0 anonpl 16 48122 0 31888 80 2 78 78 0 107 12 amapchunkpl 152 1370 0 1239 8 0 8 8 0 158 1 amappl16 192 1653 0 759 53 1 52 53 0 8 7 amappl15 184 2 0 1 1 0 1 1 0 8 0 amappl14 176 28 0 21 1 0 1 1 0 8 0 amappl13 168 78 0 73 1 0 1 1 0 8 0 amappl12 160 3 0 0 1 0 1 1 0 8 0 amappl11 152 42 0 33 1 0 1 1 0 8 0 amappl10 144 78 0 69 1 0 1 1 0 8 0 amappl9 136 20 0 19 1 0 1 1 0 8 0 amappl8 128 317 0 279 2 0 2 2 0 8 0 amappl7 120 160 0 148 1 0 1 1 0 8 0 amappl6 112 22 0 18 1 0 1 1 0 8 0 amappl5 104 952 0 939 1 0 1 1 0 8 0 amappl4 96 459 0 432 1 0 1 1 0 8 0 amappl3 88 108 0 102 1 0 1 1 0 8 0 amappl2 80 1575 0 1511 2 0 2 2 0 8 0 amappl1 72 14921 0 14504 23 14 9 17 0 8 0 amappl 80 672 0 630 1 0 1 1 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 11 0 0 1 0 1 1 0 8 0 uaddrrnd 24 306 0 290 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 306 0 290 1 0 1 1 0 8 0 vmmpekpl 168 6111 0 6080 2 0 2 2 0 8 0 vmmpepl 168 44150 0 42164 115 14 101 105 0 357 13 vmsppl 272 305 0 290 3 1 2 2 0 8 1 pdppl 4096 618 0 582 6 1 5 6 0 8 0 pvpl 32 149476 0 130273 184 1 183 183 0 265 28 pmappl 200 305 0 290 1 0 1 1 0 8 0 extentpl 40 53 0 36 1 0 1 1 0 8 0 phpool 112 243 0 14 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(ffffffff823f4d9e) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac2320) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac2320) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da86af8,9,fffffd805e5a7000,0,0,ffff80001d717280) at tcp_usrreq+0xa54 sosend(fffffd805da86af8,0,ffff80001d73fed8,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d717280,3,ffff80001d73fed8,0,ffff80001d73ffc0) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d717280,ffff80001d73ff70,ffff80001d73ffc0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d740040) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0001613c8, 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(ffffffff823f4d9e) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac2320) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac2320) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da86af8,9,fffffd805e5a7000,0,0,ffff80001d717280) at tcp_usrreq+0xa54 sosend(fffffd805da86af8,0,ffff80001d73fed8,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d717280,3,ffff80001d73fed8,0,ffff80001d73ffc0) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d717280,ffff80001d73ff70,ffff80001d73ffc0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d740040) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0001613c8, count: -9