panic: tcp_output: template len != hdrlen - optlen Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *523829 19573 0 0x12 0 0 sshd db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff824145c2) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ada320) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ada320) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806eae27d8,9,fffffd806f117d00,0,0,ffff800020e409d0) at tcp_usrreq+0xa55 sosend(fffffd806eae27d8,0,ffff800020e634a8,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020e409d0,4,ffff800020e634a8,0,ffff800020e63590) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020e409d0,ffff800020e63540,ffff800020e63590) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020e63610) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020e63610) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffdc870, 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{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic tcp_output: template len != hdrlen - optlen ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff824145c2) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ada320) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ada320) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806eae27d8,9,fffffd806f117d00,0,0,ffff800020e409d0) at tcp_usrreq+0xa55 sosend(fffffd806eae27d8,0,ffff800020e634a8,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020e409d0,4,ffff800020e634a8,0,ffff800020e63590) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020e409d0,ffff800020e63540,ffff800020e63590) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020e63610) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020e63610) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffdc870, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff800020e63010 rbx 0xffff800020e630c0 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff8239351f kprintf+0x16f r9 0x1 r10 0x2 r11 0x2615e1e7a3aa95c2 r12 0x3000000008 r13 0xffff800020e63020 r14 0x100 r15 0x1 rip 0xffffffff81ef4318 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020e63000 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (sshd) pid=523829 stat=onproc flags process=12 proc=0 pri=24, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff800020e40010,0xffff800020e40ec0 process=0xffff800020e383f0 user=0xffff800020e5e000, vmspace=0xfffffd806e8f32e8 estcpu=0, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 23894 327320 0 0 3 0x14200 acct acct 49099 328552 55425 0 3 0x82 piperd syz-executor.1 75905 351336 0 0 3 0x14200 bored sosplice 31431 56429 55425 0 2 0x2 syz-executor.0 55425 465727 40557 0 2 0x2 syz-fuzzer 55425 262072 40557 0 3 0x4000082 nanosleep syz-fuzzer 55425 269435 40557 0 3 0x4000082 thrsleep syz-fuzzer 55425 196027 40557 0 3 0x4000082 thrsleep syz-fuzzer 55425 117306 40557 0 3 0x4000082 thrsleep syz-fuzzer 55425 467286 40557 0 2 0x4000002 syz-fuzzer 55425 203447 40557 0 3 0x4000082 thrsleep syz-fuzzer 55425 152844 40557 0 3 0x4000082 thrsleep syz-fuzzer 55425 382869 40557 0 3 0x4000082 thrsleep syz-fuzzer 55425 199436 40557 0 3 0x4000082 thrsleep syz-fuzzer 40557 369157 19573 0 3 0x10008a pause ksh *19573 523829 77521 0 7 0x12 sshd 6518 343673 1 0 3 0x100083 ttyin getty 77521 105825 1 0 3 0x80 select sshd 16857 330384 96203 74 3 0x100092 bpf pflogd 96203 99488 1 0 3 0x80 netio pflogd 80031 130515 96987 73 3 0x100090 kqread syslogd 96987 289592 1 0 3 0x100082 netio syslogd 34673 303851 1 77 3 0x100090 poll dhclient 14321 471986 1 0 3 0x80 poll dhclient 40785 6331 0 0 3 0x14200 bored smr 45768 324785 0 0 2 0x14200 zerothread 85862 409776 0 0 3 0x14200 aiodoned aiodoned 29016 433811 0 0 3 0x14200 syncer update 15017 97175 0 0 3 0x14200 cleaner cleaner 69527 402229 0 0 3 0x14200 reaper reaper 16024 279972 0 0 3 0x14200 pgdaemon pagedaemon 82031 364727 0 0 3 0x14200 bored crynlk 6540 477725 0 0 3 0x14200 bored crypto 88006 392374 0 0 3 0x40014200 acpi0 acpi0 12093 159357 0 0 7 0x40014200 idle1 80845 105567 0 0 3 0x14200 bored softnet 13138 427789 0 0 3 0x14200 bored systqmp 22215 93317 0 0 3 0x14200 bored systq 32671 459689 0 0 3 0x40014200 bored softclock 96446 105453 0 0 3 0x40014200 idle0 1 111842 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 19573 (sshd) thread 0xffff800020e409d0 (523829) exclusive rwlock netlock r = 0 (0xffffffff8273c6c8) #0 witness_lock+0x4c7 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4c7 sys/kern/subr_witness.c:1164 #1 solock+0x5a sys/kern/uipc_socket2.c:282 #2 sosend+0x559 sys/kern/uipc_socket.c:543 #3 dofilewritev+0x1b6 sys/kern/sys_generic.c:365 #4 sys_write+0x83 sys/kern/sys_generic.c:285 #5 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] #5 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 #6 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9550 6436K 6944K 78643K 11597 0 pcb 13 8K 8K 78643K 469 0 rtable 120 8K 10K 78643K 540 0 ifaddr 110 21K 21K 78643K 218 0 sysctl 2 0K 0K 78643K 2 0 counters 43 33K 34K 78643K 55 0 ioctlops 0 0K 4K 78643K 1556 0 iov 0 0K 16K 78643K 84 0 mount 1 1K 1K 78643K 1 0 vnodes 1220 77K 77K 78643K 1520 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 13 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 1K 78643K 102 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1824 197K 290K 78643K 13058 0 file desc 4 9K 25K 78643K 628 0 sigio 0 0K 0K 78643K 8 0 proc 63 63K 95K 78643K 582 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 41 0 in_multi 81 3K 4K 78643K 241 0 ether_multi 1 0K 0K 78643K 13 0 mrt 0 0K 0K 78643K 14 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 264 0 pfkey data 0 0K 0K 78643K 2 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 129 72K 72K 78643K 2598 0 UVM aobj 35 2K 2K 78643K 38 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 109 0 NDP 16 0K 0K 78643K 47 0 temp 153 3879K 3943K 78643K 12181 0 kqueue 3 4K 12K 78643K 13 0 SYN cache 2 16K 16K 78643K 2 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 9 0 3 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 47 0 45 1 0 1 1 0 8 0 rtentry 112 110 0 71 2 0 2 2 0 8 0 unpcb 120 379 0 369 1 0 1 1 0 8 0 syncache 264 10 0 10 4 3 1 1 0 8 1 tcpqe 32 242 0 242 1 1 0 1 0 8 0 tcpcb 544 212 0 208 2 1 1 2 0 8 0 inpcb 296 1036 0 1027 4 2 2 3 0 8 1 rttmr 72 7 0 7 2 2 0 1 0 8 0 nd6 48 37 0 34 1 0 1 1 0 8 0 pkpcb 40 8 0 8 2 2 0 1 0 8 0 swfcl 56 2 0 0 1 0 1 1 0 8 0 pffrag 232 2 0 2 2 2 0 1 0 482 0 pffrnode 88 2 0 2 2 2 0 1 0 8 0 pffrent 40 90 0 90 2 2 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 pfrktable 1344 50 0 40 2 1 1 2 0 8 0 pftag 88 2 0 2 1 0 1 1 0 8 1 pfstitem 24 19 0 15 1 0 1 1 0 8 0 pfstkey 112 19 0 15 1 0 1 1 0 8 0 pfstate 328 19 0 15 2 0 2 2 0 8 1 pfrule 1360 46 0 28 3 1 2 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 375 0 197 14 2 12 14 0 8 0 art_table 32 376 0 197 2 0 2 2 0 8 0 art_node 16 107 0 70 1 0 1 1 0 8 0 sysvmsgpl 40 52 0 13 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 96 0 86 1 0 1 1 0 8 0 shmpl 112 36 0 3 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 2235 0 830 89 0 89 89 0 8 0 ffsino 272 2235 0 830 95 0 95 95 0 8 0 nchpl 144 3428 0 1834 60 0 60 60 0 8 0 uvmvnodes 72 2497 0 0 46 0 46 46 0 8 0 vnodes 208 2497 0 0 132 0 132 132 0 8 0 namei 1024 10190 0 10190 2 1 1 1 0 8 1 percpumem 16 38 0 6 1 0 1 1 0 8 0 vcpupl 1984 4 0 0 1 0 1 1 0 8 0 vmpool 560 8 0 4 1 0 1 1 0 8 0 pfiaddrpl 120 24 0 12 1 0 1 1 0 8 0 scxspl 192 9856 0 9856 9 8 1 7 0 8 1 plimitpl 152 61 0 53 1 0 1 1 0 8 0 sigapl 424 842 0 810 4 0 4 4 0 8 0 futexpl 56 11868 0 11868 2 1 1 1 0 8 1 knotepl 112 92 0 73 1 0 1 1 0 8 0 kqueuepl 144 95 0 91 1 0 1 1 0 8 0 pipelkpl 48 151 0 141 1 0 1 1 0 8 0 pipepl 120 302 0 283 2 0 2 2 0 8 1 fdescpl 496 825 0 810 3 0 3 3 0 8 0 filepl 152 5394 0 5294 6 1 5 6 0 8 1 lockfpl 104 358 0 357 1 0 1 1 0 8 0 lockfspl 48 104 0 103 1 0 1 1 0 8 0 sessionpl 112 19 0 8 1 0 1 1 0 8 0 pgrppl 48 33 0 22 1 0 1 1 0 8 0 ucredpl 96 647 0 638 1 0 1 1 0 8 0 zombiepl 144 810 0 810 1 0 1 1 0 8 1 processpl 984 842 0 810 5 0 5 5 0 8 0 procpl 624 1741 0 1700 4 0 4 4 0 8 0 sosppl 128 9 0 9 4 3 1 1 0 8 1 sockpl 400 1477 0 1458 8 4 4 5 0 8 2 mcl64k 65536 11 0 0 2 0 2 2 0 8 0 mcl16k 16384 2 0 0 1 0 1 1 0 8 0 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl9k 9216 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 162 0 0 20 0 20 20 0 8 0 mtagpl 96 78 0 0 2 0 2 2 0 8 0 mbufpl 256 400 0 0 23 0 23 23 0 8 0 bufpl 280 4572 0 134 317 0 317 317 0 8 0 anonpl 16 107714 0 91084 99 29 70 82 0 124 2 amapchunkpl 152 5221 0 5069 28 10 18 20 0 158 10 amappl16 192 4249 0 3360 67 22 45 55 0 8 0 amappl15 184 1 0 0 1 0 1 1 0 8 0 amappl14 176 28 0 23 1 0 1 1 0 8 0 amappl13 168 36 0 33 1 0 1 1 0 8 0 amappl12 160 122 0 120 2 1 1 1 0 8 0 amappl11 152 214 0 197 1 0 1 1 0 8 0 amappl10 144 360 0 351 1 0 1 1 0 8 0 amappl9 136 386 0 385 1 0 1 1 0 8 0 amappl8 128 358 0 328 1 0 1 1 0 8 0 amappl7 120 124 0 111 1 0 1 1 0 8 0 amappl6 112 166 0 162 1 0 1 1 0 8 0 amappl5 104 822 0 807 1 0 1 1 0 8 0 amappl4 96 514 0 482 1 0 1 1 0 8 0 amappl3 88 127 0 121 1 0 1 1 0 8 0 amappl2 80 5614 0 5550 2 0 2 2 0 8 0 amappl1 72 26149 0 25716 23 13 10 18 0 8 0 amappl 80 2029 0 1982 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 37 0 3 1 0 1 1 0 8 0 uaddrrnd 24 833 0 814 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 833 0 814 1 0 1 1 0 8 0 vmmpekpl 168 8856 0 8821 2 0 2 2 0 8 0 vmmpepl 168 104561 0 102610 148 54 94 123 0 357 1 vmsppl 368 832 0 814 2 0 2 2 0 8 0 pdppl 4096 1673 0 1632 6 0 6 6 0 8 0 pvpl 32 292364 0 272657 212 31 181 192 0 265 22 pmappl 232 832 0 814 3 1 2 2 0 8 0 extentpl 40 53 0 36 1 0 1 1 0 8 0 phpool 112 279 0 11 8 0 8 8 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff824145c2) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ada320) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ada320) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806eae27d8,9,fffffd806f117d00,0,0,ffff800020e409d0) at tcp_usrreq+0xa55 sosend(fffffd806eae27d8,0,ffff800020e634a8,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020e409d0,4,ffff800020e634a8,0,ffff800020e63590) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020e409d0,ffff800020e63540,ffff800020e63590) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020e63610) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020e63610) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffdc870, count: -9 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffff800020d70ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:352 x86_ipi_handler() at x86_ipi_handler+0xc6 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 acpicpu_idle() at acpicpu_idle+0x331 sys/dev/acpi/acpicpu.c:1187 sched_idle(ffff800020d70ff0) at sched_idle+0x3f7 sys/kern/kern_sched.c:178 end trace frame: 0x0, count: 10 ddb{1}> trace x86_ipi_db(ffff800020d70ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:352 x86_ipi_handler() at x86_ipi_handler+0xc6 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 acpicpu_idle() at acpicpu_idle+0x331 sys/dev/acpi/acpicpu.c:1187 sched_idle(ffff800020d70ff0) at sched_idle+0x3f7 sys/kern/kern_sched.c:178 end trace frame: 0x0, count: -5