panic: tcp_output: template len != hdrlen - optlen Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 160163 45988 0 0x2 0x4000000 1K syz-fuzzer *435333 63917 0 0x12 0 0 sshd db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff82415fa0) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ad9ee0) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ad9ee0) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806ead4c88,9,fffffd80646a4200,0,0,ffff800020e3f4f0) at tcp_usrreq+0xa55 sosend(fffffd806ead4c88,0,ffff800020e62188,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020e3f4f0,4,ffff800020e62188,0,ffff800020e62270) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020e3f4f0,ffff800020e62220,ffff800020e62270) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020e622f0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020e622f0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffe9eb0, 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(ffffffff82415fa0) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ad9ee0) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ad9ee0) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806ead4c88,9,fffffd80646a4200,0,0,ffff800020e3f4f0) at tcp_usrreq+0xa55 sosend(fffffd806ead4c88,0,ffff800020e62188,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020e3f4f0,4,ffff800020e62188,0,ffff800020e62270) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020e3f4f0,ffff800020e62220,ffff800020e62270) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020e622f0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020e622f0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffe9eb0, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff800020e61cf0 rbx 0xffff800020e61da0 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff8171954f kprintf+0x16f r9 0x1 r10 0x2 r11 0x770f19699a9210ca r12 0x3000000008 r13 0xffff800020e61d00 r14 0x100 r15 0x1 rip 0xffffffff81127078 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020e61ce0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (sshd) pid=435333 stat=onproc flags process=12 proc=0 pri=24, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff800020e3fc40,0xffff800020e3f290 process=0xffff8000ffffe3f8 user=0xffff800020e5d000, vmspace=0xfffffd806e8e8738 estcpu=0, cpticks=0, pctcpu=0.1 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 44439 313327 0 0 3 0x14200 bored sosplice 30472 49238 45988 0 3 0x82 piperd syz-executor.1 28024 294887 45988 0 2 0x2 syz-executor.0 45988 421204 89116 0 3 0x82 thrsleep syz-fuzzer 45988 184265 89116 0 3 0x4000082 nanosleep syz-fuzzer 45988 62406 89116 0 3 0x4000082 thrsleep syz-fuzzer 45988 40963 89116 0 3 0x4000082 thrsleep syz-fuzzer 45988 160163 89116 0 7 0x4000002 syz-fuzzer 45988 156613 89116 0 2 0x4000002 syz-fuzzer 45988 448883 89116 0 3 0x4000082 thrsleep syz-fuzzer 45988 385329 89116 0 3 0x4000082 thrsleep syz-fuzzer 45988 113641 89116 0 3 0x4000082 thrsleep syz-fuzzer 45988 194672 89116 0 3 0x4000082 thrsleep syz-fuzzer 89116 239141 63917 0 3 0x10008a pause ksh *63917 435333 38654 0 7 0x12 sshd 7911 193298 1 0 3 0x100083 ttyin getty 38654 368353 1 0 3 0x80 select sshd 92197 174969 50492 74 3 0x100092 bpf pflogd 50492 391915 1 0 3 0x80 netio pflogd 62999 262069 55468 73 3 0x100090 kqread syslogd 55468 13962 1 0 3 0x100082 netio syslogd 11448 151388 1 77 3 0x100090 poll dhclient 71665 248245 1 0 3 0x80 poll dhclient 46592 422313 0 0 3 0x14200 bored smr 60689 426924 0 0 3 0x14200 pgzero zerothread 39254 316567 0 0 3 0x14200 aiodoned aiodoned 18897 391288 0 0 3 0x14200 syncer update 89424 221643 0 0 3 0x14200 cleaner cleaner 24433 17879 0 0 3 0x14200 reaper reaper 61545 95682 0 0 3 0x14200 pgdaemon pagedaemon 28304 207430 0 0 3 0x14200 bored crynlk 76939 145770 0 0 3 0x14200 bored crypto 72397 119528 0 0 3 0x40014200 acpi0 acpi0 40935 327811 0 0 3 0x40014200 idle1 78706 469477 0 0 3 0x14200 bored softnet 66263 295152 0 0 3 0x14200 bored systqmp 12399 448721 0 0 3 0x14200 bored systq 94444 343756 0 0 3 0x40014200 bored softclock 8929 11656 0 0 3 0x40014200 idle0 1 371415 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 63917 (sshd) thread 0xffff800020e3f4f0 (435333) exclusive rwlock netlock r = 0 (0xffffffff827400d8) #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 9541 6433K 7263K 78643K 12107 0 pcb 13 8K 8K 78643K 83 0 rtable 97 7K 7K 78643K 426 0 ifaddr 90 16K 17K 78643K 161 0 counters 43 33K 34K 78643K 53 0 ioctlops 0 0K 4K 78643K 1518 0 iov 0 0K 16K 78643K 55 0 mount 1 1K 1K 78643K 1 0 vnodes 1223 77K 77K 78643K 1628 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 7 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 98 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1824 197K 290K 78643K 13058 0 file desc 4 9K 25K 78643K 427 0 sigio 0 0K 0K 78643K 5 0 proc 61 63K 95K 78643K 456 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 44 0 in_multi 45 2K 2K 78643K 118 0 ether_multi 1 0K 0K 78643K 10 0 mrt 0 0K 0K 78643K 8 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 252 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 120 39K 39K 78643K 2301 0 UVM aobj 24 2K 2K 78643K 26 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 61 0 NDP 15 0K 0K 78643K 33 0 temp 126 3868K 3932K 78643K 7489 0 kqueue 3 4K 10K 78643K 26 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 7 0 1 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 42 0 40 1 0 1 1 0 8 0 rtentry 112 79 0 49 2 0 2 2 0 8 0 unpcb 120 195 0 185 1 0 1 1 0 8 0 syncache 264 7 0 7 3 3 0 1 0 8 0 sackhl 24 1 0 1 1 0 1 1 0 8 1 tcpqe 32 178 0 178 1 1 0 1 0 8 0 tcpcb 544 171 0 167 2 1 1 2 0 8 0 inpcb 296 715 0 708 3 1 2 2 0 8 1 rttmr 72 4 0 4 2 2 0 1 0 8 0 nd6 48 15 0 11 1 0 1 1 0 8 0 pkpcb 40 6 0 6 2 2 0 1 0 8 0 pffrag 232 3 0 2 1 0 1 1 0 482 0 pffrnode 88 3 0 2 1 0 1 1 0 8 0 pffrent 40 92 0 91 1 0 1 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 41 0 32 1 0 1 1 0 8 0 pftag 88 2 0 2 1 0 1 1 0 8 1 pfstitem 24 35 0 16 1 0 1 1 0 8 0 pfstkey 112 35 0 16 1 0 1 1 0 8 0 pfstate 328 35 0 16 3 0 3 3 0 8 0 pfrule 1360 37 0 22 3 1 2 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 371 0 210 12 1 11 12 0 8 0 art_table 32 372 0 210 2 0 2 2 0 8 0 art_node 16 78 0 52 1 0 1 1 0 8 0 sysvmsgpl 40 36 0 16 1 0 1 1 0 8 0 semapl 112 96 0 86 1 0 1 1 0 8 0 shmpl 112 23 0 2 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1983 0 582 89 0 89 89 0 8 0 ffsino 272 1983 0 582 95 0 95 95 0 8 0 nchpl 144 2799 0 1190 60 0 60 60 0 8 0 uvmvnodes 72 2371 0 0 44 0 44 44 0 8 0 vnodes 208 2371 0 0 125 0 125 125 0 8 0 namei 1024 7918 0 7918 1 0 1 1 0 8 1 percpumem 16 37 0 5 1 0 1 1 0 8 0 vcpupl 1984 2 0 0 1 0 1 1 0 8 0 vmpool 560 3 0 1 1 0 1 1 0 8 0 pfiaddrpl 120 14 0 8 1 0 1 1 0 8 0 scxspl 192 8856 0 8856 8 7 1 7 0 8 1 plimitpl 152 45 0 37 1 0 1 1 0 8 0 sigapl 424 643 0 612 4 0 4 4 0 8 0 futexpl 56 7461 0 7461 1 0 1 1 0 8 1 knotepl 112 82 0 63 1 0 1 1 0 8 0 kqueuepl 144 232 0 230 1 0 1 1 0 8 0 pipepl 304 134 0 124 3 2 1 2 0 8 0 fdescpl 496 627 0 612 3 0 3 3 0 8 0 filepl 152 4016 0 3916 6 1 5 6 0 8 1 lockfpl 104 99 0 98 1 0 1 1 0 8 0 lockfspl 48 33 0 32 1 0 1 1 0 8 0 sessionpl 112 18 0 7 1 0 1 1 0 8 0 pgrppl 48 24 0 13 1 0 1 1 0 8 0 ucredpl 96 407 0 397 1 0 1 1 0 8 0 zombiepl 144 612 0 612 1 0 1 1 0 8 1 processpl 992 643 0 612 5 0 5 5 0 8 0 procpl 624 1526 0 1486 4 0 4 4 0 8 0 sosppl 128 2 0 2 2 1 1 1 0 8 1 sockpl 400 960 0 941 6 3 3 5 0 8 1 mcl64k 65536 8 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 5 0 0 1 0 1 1 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 6 0 0 1 0 1 1 0 8 0 mcl4k 4096 5 0 0 1 0 1 1 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 195 0 0 24 0 24 24 0 8 0 mtagpl 96 14 0 0 1 0 1 1 0 8 0 mbufpl 256 267 0 0 16 0 16 16 0 8 0 bufpl 280 5110 0 141 355 0 355 355 0 8 0 anonpl 16 81997 0 65270 98 14 84 85 0 124 13 amapchunkpl 152 3329 0 3184 14 7 7 11 0 158 0 amappl16 192 3113 0 2171 73 17 56 60 0 8 8 amappl15 184 1 0 0 1 0 1 1 0 8 0 amappl14 176 287 0 280 1 0 1 1 0 8 0 amappl13 168 164 0 159 1 0 1 1 0 8 0 amappl12 160 151 0 148 1 0 1 1 0 8 0 amappl11 152 316 0 300 1 0 1 1 0 8 0 amappl10 144 17 0 12 1 0 1 1 0 8 0 amappl9 136 388 0 387 1 0 1 1 0 8 0 amappl8 128 357 0 321 2 0 2 2 0 8 0 amappl7 120 118 0 107 1 0 1 1 0 8 0 amappl6 112 286 0 280 2 1 1 1 0 8 0 amappl5 104 273 0 257 1 0 1 1 0 8 0 amappl4 96 756 0 724 1 0 1 1 0 8 0 amappl3 88 119 0 112 1 0 1 1 0 8 0 amappl2 80 4203 0 4140 2 0 2 2 0 8 0 amappl1 72 23779 0 23356 23 13 10 18 0 8 0 amappl 80 1772 0 1728 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 25 0 2 1 0 1 1 0 8 0 uaddrrnd 24 630 0 613 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 630 0 613 1 0 1 1 0 8 0 vmmpekpl 168 8388 0 8348 2 0 2 2 0 8 0 vmmpepl 168 85151 0 83135 128 25 103 115 0 357 9 vmsppl 368 629 0 613 2 0 2 2 0 8 0 pdppl 4096 1267 0 1228 6 0 6 6 0 8 0 pvpl 32 249128 0 229337 210 13 197 199 0 265 29 pmappl 232 629 0 613 3 1 2 2 0 8 1 extentpl 40 53 0 36 1 0 1 1 0 8 0 phpool 112 270 0 8 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(ffffffff82415fa0) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ad9ee0) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ad9ee0) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806ead4c88,9,fffffd80646a4200,0,0,ffff800020e3f4f0) at tcp_usrreq+0xa55 sosend(fffffd806ead4c88,0,ffff800020e62188,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020e3f4f0,4,ffff800020e62188,0,ffff800020e62270) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020e3f4f0,ffff800020e62220,ffff800020e62270) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020e622f0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020e622f0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffe9eb0, count: -9 ddb{0}> machine ddbcpu 1