panic: tcp_output: template len != hdrlen - optlen Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *270634 99517 0 0x12 0 0 sshd db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff823f4d19) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac2980) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac2980) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da6b4b8,9,fffffd805bb0b000,0,0,ffff80001d717760) at tcp_usrreq+0xa54 sosend(fffffd805da6b4b8,0,ffff80001d71e418,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d717760,4,ffff80001d71e418,0,ffff80001d71e500) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d717760,ffff80001d71e4b0,ffff80001d71e500) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d71e580) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffbed70, 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(ffffffff823f4d19) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac2980) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac2980) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da6b4b8,9,fffffd805bb0b000,0,0,ffff80001d717760) at tcp_usrreq+0xa54 sosend(fffffd805da6b4b8,0,ffff80001d71e418,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d717760,4,ffff80001d71e418,0,ffff80001d71e500) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d717760,ffff80001d71e4b0,ffff80001d71e500) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d71e580) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffbed70, count: -9 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80001d71df80 rbx 0xffff80001d71e030 rdx 0x2 rcx 0 rax 0x1 r8 0xffffffff811c348f kprintf+0x15f r9 0x1 r10 0x2 r11 0x6d9497bd9788d6d2 r12 0x3000000008 r13 0xffff80001d71df90 r14 0x100 r15 0x1 rip 0xffffffff813bfda8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80001d71df70 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (sshd) pid=270634 stat=onproc flags process=12 proc=0 pri=24, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff80001d717280,0xffff80001d717c50 process=0xffff8000ffff8748 user=0xffff80001d719000, vmspace=0xfffffd806bc0a990 estcpu=0, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 18026 216682 0 0 3 0x14200 bored sosplice 44359 188680 93091 0 3 0x82 piperd syz-executor.1 63386 322511 93091 0 3 0x82 piperd syz-executor.0 93091 175584 21608 0 3 0x82 thrsleep syz-fuzzer 93091 288302 21608 0 3 0x4000082 nanosleep syz-fuzzer 93091 303868 21608 0 3 0x4000082 thrsleep syz-fuzzer 93091 76947 21608 0 3 0x4000082 thrsleep syz-fuzzer 93091 401329 21608 0 2 0x4000002 syz-fuzzer 93091 513608 21608 0 3 0x4000082 thrsleep syz-fuzzer 93091 165960 21608 0 3 0x4000082 thrsleep syz-fuzzer 93091 521593 21608 0 3 0x4000082 thrsleep syz-fuzzer 21608 283986 99517 0 3 0x10008a pause ksh *99517 270634 15311 0 7 0x12 sshd 3182 133928 1 0 3 0x100083 ttyin getty 15311 313512 1 0 3 0x80 select sshd 97173 522183 20990 73 3 0x100090 kqread syslogd 20990 117149 1 0 3 0x100082 netio syslogd 63368 238708 1 77 3 0x100090 poll dhclient 69844 218846 1 0 3 0x80 poll dhclient 39529 111774 0 0 3 0x14200 bored smr 36317 259593 0 0 2 0x14200 zerothread 33630 13267 0 0 3 0x14200 aiodoned aiodoned 32763 336066 0 0 3 0x14200 syncer update 42993 279853 0 0 3 0x14200 cleaner cleaner 85393 8475 0 0 3 0x14200 reaper reaper 40237 476498 0 0 3 0x14200 pgdaemon pagedaemon 71616 400236 0 0 3 0x14200 bored crynlk 94796 344320 0 0 3 0x14200 bored crypto 78872 52610 0 0 3 0x40014200 acpi0 acpi0 74901 282031 0 0 3 0x14200 bored softnet 10805 113481 0 0 3 0x14200 bored systqmp 69197 6366 0 0 3 0x14200 bored systq 4622 317807 0 0 3 0x40014200 bored softclock 69771 19263 0 0 3 0x40014200 idle0 1 377745 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 9494 6349K 6610K 78643K 10867 0 pcb 13 8K 8K 78643K 65 0 rtable 129 9K 10K 78643K 487 0 ifaddr 76 15K 16K 78643K 166 0 counters 21 16K 17K 78643K 26 0 ioctlops 0 0K 4K 78643K 63 0 iov 0 0K 12K 78643K 20 0 mount 1 1K 1K 78643K 1 0 vnodes 1223 77K 77K 78643K 1324 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 1K 78643K 2 0 VM map 2 0K 0K 78643K 2 0 sem 12 0K 1K 78643K 38 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1809 195K 288K 78643K 12938 0 file desc 4 9K 25K 78643K 231 0 sigio 0 0K 0K 78643K 2 0 proc 50 38K 63K 78643K 371 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 21 0 in_multi 52 2K 2K 78643K 119 0 ether_multi 1 0K 0K 78643K 9 0 mrt 0 0K 0K 78643K 7 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 49 228K 228K 78643K 49 0 exec 0 0K 1K 78643K 190 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 126 39K 55K 78643K 1380 0 UVM aobj 8 2K 2K 78643K 10 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 26 0 NDP 11 0K 0K 78643K 31 0 temp 107 3857K 3925K 78643K 4206 0 kqueue 3 4K 12K 78643K 15 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 2 1 0 1 1 0 8 0 rtpcb 80 25 0 23 1 0 1 1 0 8 0 rtentry 112 66 0 24 2 0 2 2 0 8 0 unpcb 120 115 0 107 1 0 1 1 0 8 0 syncache 264 6 0 6 2 1 1 1 0 8 1 tcpqe 32 98 0 98 1 0 1 1 0 8 1 tcpcb 544 68 0 64 1 0 1 1 0 8 0 inpcb 296 232 0 225 2 0 2 2 0 8 1 rttmr 72 2 0 2 1 1 0 1 0 8 0 nd6 48 18 0 13 1 0 1 1 0 8 0 pfrke_plain 160 5 0 0 1 0 1 1 0 8 0 pfrktable 1344 92 0 81 2 0 2 2 0 8 1 pftag 88 14 0 12 1 0 1 1 0 8 0 pfrule 1360 26 0 18 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 272 0 44 15 0 15 15 0 8 0 art_table 32 273 0 44 2 0 2 2 0 8 0 art_node 16 65 0 26 1 0 1 1 0 8 0 sysvmsgpl 40 10 0 5 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 34 0 24 1 0 1 1 0 8 0 shmpl 112 8 0 2 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1711 0 311 88 0 88 88 0 8 0 ffsino 240 1711 0 311 83 0 83 83 0 8 0 nchpl 144 2323 0 722 60 0 60 60 0 8 0 rtmask 32 6 0 3 1 0 1 1 0 8 0 uvmvnodes 72 1812 0 0 33 0 33 33 0 8 0 vnodes 208 1812 0 0 96 0 96 96 0 8 0 namei 1024 6077 0 6077 1 0 1 1 0 8 1 vcpupl 1984 1 0 0 1 0 1 1 0 8 0 vmpool 528 5 0 4 1 0 1 1 0 8 0 pfiaddrpl 120 28 0 20 1 0 1 1 0 8 0 scxspl 192 6287 0 6287 1 0 1 1 0 8 1 plimitpl 152 25 0 18 1 0 1 1 0 8 0 sigapl 424 418 0 390 4 0 4 4 0 8 0 futexpl 56 4237 0 4237 1 0 1 1 0 8 1 knotepl 112 83 0 64 1 0 1 1 0 8 0 kqueuepl 144 42 0 40 1 0 1 1 0 8 0 pipepl 272 85 0 75 1 0 1 1 0 8 0 fdescpl 432 403 0 390 2 0 2 2 0 8 0 filepl 120 2438 0 2343 4 0 4 4 0 8 1 lockfpl 104 63 0 62 1 0 1 1 0 8 0 lockfspl 48 22 0 21 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 255 0 248 1 0 1 1 0 8 0 zombiepl 144 390 0 390 1 0 1 1 0 8 1 processpl 920 418 0 390 4 0 4 4 0 8 0 procpl 624 676 0 641 4 0 4 4 0 8 1 sosppl 128 4 0 4 1 0 1 1 0 8 1 sockpl 400 376 0 359 3 0 3 3 0 8 1 mcl64k 65536 17 0 17 1 0 1 1 0 8 1 mcl16k 16384 3 0 3 1 0 1 1 0 8 1 mcl12k 12288 1 0 1 1 1 0 1 0 8 0 mcl9k 9216 6 0 5 1 0 1 1 0 8 0 mcl8k 8192 7 0 7 1 0 1 1 0 8 1 mcl4k 4096 23 0 23 2 1 1 1 0 8 1 mcl2k2 2112 1 0 1 1 1 0 1 0 8 0 mcl2k 2048 77142 0 77098 16 8 8 14 0 8 1 mtagpl 96 22 0 10 2 1 1 1 0 8 0 mbufpl 256 123620 0 123455 15 3 12 12 0 8 0 bufpl 280 3609 0 126 249 0 249 249 0 8 0 anonpl 16 49761 0 33747 70 2 68 68 0 107 3 amapchunkpl 152 1619 0 1477 8 1 7 8 0 158 0 amappl16 192 1870 0 1006 46 0 46 46 0 8 2 amappl15 184 2 0 1 1 0 1 1 0 8 0 amappl14 176 122 0 116 1 0 1 1 0 8 0 amappl13 168 26 0 23 1 0 1 1 0 8 0 amappl12 160 20 0 18 1 0 1 1 0 8 0 amappl11 152 142 0 132 1 0 1 1 0 8 0 amappl10 144 12 0 6 1 0 1 1 0 8 0 amappl9 136 362 0 360 1 0 1 1 0 8 0 amappl8 128 332 0 288 2 0 2 2 0 8 0 amappl7 120 106 0 94 1 0 1 1 0 8 0 amappl6 112 121 0 116 1 0 1 1 0 8 0 amappl5 104 380 0 369 1 0 1 1 0 8 0 amappl4 96 423 0 393 1 0 1 1 0 8 0 amappl3 88 202 0 197 1 0 1 1 0 8 0 amappl2 80 2409 0 2354 2 0 2 2 0 8 0 amappl1 72 16498 0 16102 24 15 9 17 0 8 0 amappl 80 901 0 859 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 9 0 2 1 0 1 1 0 8 0 uaddrrnd 24 408 0 394 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 408 0 394 1 0 1 1 0 8 0 vmmpekpl 168 6658 0 6630 2 0 2 2 0 8 0 vmmpepl 168 54515 0 52667 116 12 104 109 0 357 18 vmsppl 272 407 0 394 2 0 2 2 0 8 1 pdppl 4096 822 0 789 6 1 5 6 0 8 0 pvpl 32 166515 0 147610 163 0 163 163 0 265 9 pmappl 200 407 0 394 1 0 1 1 0 8 0 extentpl 40 53 0 36 1 0 1 1 0 8 0 phpool 112 247 0 15 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(ffffffff823f4d19) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac2980) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac2980) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da6b4b8,9,fffffd805bb0b000,0,0,ffff80001d717760) at tcp_usrreq+0xa54 sosend(fffffd805da6b4b8,0,ffff80001d71e418,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d717760,4,ffff80001d71e418,0,ffff80001d71e500) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d717760,ffff80001d71e4b0,ffff80001d71e500) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d71e580) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffbed70, 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(ffffffff823f4d19) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac2980) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac2980) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da6b4b8,9,fffffd805bb0b000,0,0,ffff80001d717760) at tcp_usrreq+0xa54 sosend(fffffd805da6b4b8,0,ffff80001d71e418,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d717760,4,ffff80001d71e418,0,ffff80001d71e500) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d717760,ffff80001d71e4b0,ffff80001d71e500) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d71e580) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffbed70, count: -9