panic: tcp_output: template len != hdrlen - optlen Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *163648 61368 0 0x2 0x4000000 0 syz-fuzzer db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff823fae90) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac3540) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac3540) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da6fc88,9,fffffd80621c4300,0,0,ffff80001d71d870) at tcp_usrreq+0xa54 sosend(fffffd805da6fc88,0,ffff80001d765528,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d71d870,3,ffff80001d765528,0,ffff80001d765610) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d71d870,ffff80001d7655c0,ffff80001d765610) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d765690) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0012c33c8, 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(ffffffff823fae90) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac3540) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac3540) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da6fc88,9,fffffd80621c4300,0,0,ffff80001d71d870) at tcp_usrreq+0xa54 sosend(fffffd805da6fc88,0,ffff80001d765528,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d71d870,3,ffff80001d765528,0,ffff80001d765610) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d71d870,ffff80001d7655c0,ffff80001d765610) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d765690) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0012c33c8, count: -9 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80001d765090 rbx 0xffff80001d765140 rdx 0x2 rcx 0 rax 0x1 r8 0xffffffff8163080f kprintf+0x15f r9 0x1 r10 0x2 r11 0xab5d47dbbc2184ec r12 0x3000000008 r13 0xffff80001d7650a0 r14 0x100 r15 0x1 rip 0xffffffff8114a6e8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80001d765080 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-fuzzer) pid=163648 stat=onproc flags process=2 proc=4000000 pri=32, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff80001d71c4f0,0xffff80001d6aa128 process=0xffff80001d7003b8 user=0xffff80001d760000, vmspace=0xfffffd806bc09000 estcpu=0, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 86864 454865 3725 0 2 0 syz-executor.1 86864 97931 3725 0 2 0x4000000 syz-executor.1 50245 519846 0 0 3 0x14280 nfsidl nfsio 67937 495378 0 0 3 0x14280 nfsidl nfsio 71017 461276 0 0 3 0x14280 nfsidl nfsio 62207 439280 0 0 3 0x14280 nfsidl nfsio 55304 217164 0 0 3 0x14280 nfsidl nfsio 97490 62841 0 0 3 0x14280 nfsidl nfsio 91707 440020 0 0 3 0x14280 nfsidl nfsio 85700 348714 0 0 3 0x14280 nfsidl nfsio 13733 64301 0 0 3 0x14280 nfsidl nfsio 9239 262935 0 0 3 0x14280 nfsidl nfsio 95105 499087 0 0 3 0x14280 nfsidl nfsio 85924 515094 0 0 3 0x14280 nfsidl nfsio 52296 130675 0 0 3 0x14280 nfsidl nfsio 74189 319761 0 0 3 0x14280 nfsidl nfsio 2470 4376 0 0 3 0x14280 nfsidl nfsio 33804 65534 0 0 3 0x14280 nfsidl nfsio 8324 404856 0 0 3 0x14280 nfsidl nfsio 97069 275483 0 0 3 0x14280 nfsidl nfsio 55376 305757 0 0 3 0x14280 nfsidl nfsio 77891 451089 0 0 3 0x14280 nfsidl nfsio 96399 194602 61368 0 2 0x2 syz-executor.0 69399 375786 0 0 3 0x14200 bored sosplice 85584 422142 0 0 3 0x14200 acct acct 3725 17029 61368 0 3 0x82 nanosleep syz-executor.1 61368 7219 95376 0 3 0x82 kqread syz-fuzzer 61368 346062 95376 0 3 0x4000082 nanosleep syz-fuzzer 61368 62752 95376 0 2 0x4000002 syz-fuzzer 61368 345755 95376 0 3 0x4000082 thrsleep syz-fuzzer 61368 402345 95376 0 3 0x4000082 thrsleep syz-fuzzer *61368 163648 95376 0 7 0x4000002 syz-fuzzer 61368 403458 95376 0 3 0x4000082 thrsleep syz-fuzzer 61368 322259 95376 0 3 0x4000082 thrsleep syz-fuzzer 95376 134898 23378 0 3 0x10008a pause ksh 23378 296194 31799 0 3 0x92 select sshd 75398 124761 1 0 3 0x100083 ttyin getty 31799 162382 1 0 3 0x80 select sshd 8719 17123 29501 73 3 0x100090 kqread syslogd 29501 167756 1 0 3 0x100082 netio syslogd 88155 374015 1 77 3 0x100090 poll dhclient 22007 340428 1 0 3 0x80 poll dhclient 57648 214305 0 0 3 0x14200 bored smr 75871 247236 0 0 2 0x14200 zerothread 56319 327641 0 0 3 0x14200 aiodoned aiodoned 15441 89683 0 0 3 0x14200 syncer update 83840 118697 0 0 3 0x14200 cleaner cleaner 48097 177849 0 0 3 0x14200 reaper reaper 19025 36942 0 0 3 0x14200 pgdaemon pagedaemon 22223 375384 0 0 3 0x14200 bored crynlk 83172 439183 0 0 3 0x14200 bored crypto 80935 416506 0 0 3 0x40014200 acpi0 acpi0 62022 351612 0 0 3 0x14200 bored softnet 40334 374710 0 0 3 0x14200 bored systqmp 3542 306590 0 0 3 0x14200 bored systq 34862 187135 0 0 3 0x40014200 bored softclock 10659 163830 0 0 3 0x40014200 idle0 1 226206 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 9486 6353K 6611K 78643K 10947 0 pcb 13 8K 8K 78643K 73 0 rtable 100 7K 8K 78643K 429 0 ifaddr 70 14K 15K 78643K 110 0 sysctl 2 0K 0K 78643K 2 0 counters 21 16K 16K 78643K 25 0 ioctlops 0 0K 4K 78643K 69 0 iov 0 0K 16K 78643K 34 0 mount 1 1K 1K 78643K 1 0 vnodes 1220 77K 77K 78643K 1363 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 5 0 VM map 2 0K 0K 78643K 2 0 sem 12 0K 0K 78643K 52 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1809 195K 288K 78643K 12938 0 file desc 5 13K 25K 78643K 822 0 sigio 0 0K 0K 78643K 4 0 proc 49 38K 55K 78643K 416 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 55 0 in_multi 40 2K 2K 78643K 111 0 ether_multi 1 0K 0K 78643K 16 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 225 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 142 56K 56K 78643K 2876 0 UVM aobj 14 2K 3K 78643K 18 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 55 0 NDP 10 0K 0K 78643K 21 0 temp 100 3868K 3932K 78643K 8509 0 kqueue 3 4K 13K 78643K 19 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 11 0 4 1 0 1 1 0 8 0 rtpcb 80 33 0 31 1 0 1 1 0 8 0 rtentry 112 67 0 36 2 0 2 2 0 8 0 unpcb 120 259 0 251 1 0 1 1 0 8 0 syncache 264 10 0 10 3 3 0 1 0 8 0 tcpqe 32 150 0 150 1 1 0 1 0 8 0 tcpcb 544 759 0 755 1 0 1 1 0 8 0 inpcb 296 1910 0 1901 3 1 2 2 0 8 0 ip6q 72 1 0 1 1 1 0 1 0 8 0 ip6af 40 2 0 2 1 1 0 1 0 8 0 nd6 48 12 0 8 1 0 1 1 0 8 0 ppxss 1136 1 0 1 1 1 0 1 0 8 0 pfstscr 40 1 0 1 1 1 0 1 0 8 0 pfrktable 1344 33 0 24 1 0 1 1 0 8 0 pftag 88 7 0 4 1 0 1 1 0 8 0 pfstkey 112 2 0 2 1 1 0 1 0 8 0 pfstate 328 1 0 1 1 1 0 1 0 8 0 pfrule 1360 21 0 6 2 0 2 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 267 0 128 13 2 11 12 0 8 0 art_table 32 268 0 128 2 0 2 2 0 8 0 art_node 16 66 0 38 1 0 1 1 0 8 0 sysvmsgpl 40 4 0 1 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 48 0 38 1 0 1 1 0 8 0 shmpl 112 15 0 4 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 2287 0 887 88 0 88 88 0 8 0 ffsino 240 2287 0 887 83 0 83 83 0 8 0 nchpl 144 3433 0 1846 60 0 60 60 0 8 0 uvmvnodes 72 2438 0 0 45 0 45 45 0 8 0 vnodes 208 2438 0 0 129 0 129 129 0 8 0 namei 1024 8509 0 8509 1 0 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 24 0 12 1 0 1 1 0 8 0 scxspl 192 9952 0 9952 1 0 1 1 0 8 1 plimitpl 152 28 0 21 1 0 1 1 0 8 0 sigapl 424 1027 0 977 6 0 6 6 0 8 0 futexpl 56 15851 0 15851 1 0 1 1 0 8 1 knotepl 112 89 0 70 1 0 1 1 0 8 0 kqueuepl 144 345 0 342 1 0 1 1 0 8 0 pipepl 272 1282 0 1271 3 1 2 2 0 8 1 fdescpl 432 991 0 977 2 0 2 2 0 8 0 filepl 120 7398 0 7301 4 0 4 4 0 8 1 lockfpl 104 67 0 66 1 0 1 1 0 8 0 lockfspl 48 29 0 28 1 0 1 1 0 8 0 sessionpl 112 18 0 8 1 0 1 1 0 8 0 pgrppl 48 64 0 54 1 0 1 1 0 8 0 ucredpl 96 208 0 201 1 0 1 1 0 8 0 zombiepl 144 977 0 977 1 0 1 1 0 8 1 processpl 928 1027 0 977 7 0 7 7 0 8 0 procpl 624 1966 0 1908 5 0 5 5 0 8 0 sosppl 128 1 0 1 1 1 0 1 0 8 0 sockpl 400 2204 0 2185 6 3 3 4 0 8 0 mcl64k 65536 28 0 28 2 2 0 1 0 8 0 mcl16k 16384 7 0 7 2 2 0 1 0 8 0 mcl12k 12288 12 0 12 4 3 1 1 0 8 1 mcl9k 9216 7 0 7 2 2 0 1 0 8 0 mcl8k 8192 8 0 8 3 2 1 1 0 8 1 mcl4k 4096 166 0 166 2 2 0 1 0 8 0 mcl2k2 2112 4 0 4 3 3 0 1 0 8 0 mcl2k 2048 94469 0 94416 16 8 8 15 0 8 1 mtagpl 96 18 0 14 3 2 1 1 0 8 0 mbufpl 256 153050 0 152949 14 3 11 11 0 8 1 bufpl 280 4251 0 126 295 0 295 295 0 8 0 anonpl 16 746674 0 725148 115 21 94 103 0 107 7 amapchunkpl 152 6032 0 5864 11 4 7 8 0 158 0 amappl16 192 42504 0 41139 89 20 69 81 0 8 0 amappl15 184 2 0 0 1 0 1 1 0 8 0 amappl14 176 139 0 134 1 0 1 1 0 8 0 amappl13 168 359 0 354 1 0 1 1 0 8 0 amappl12 160 18 0 13 1 0 1 1 0 8 0 amappl11 152 500 0 489 1 0 1 1 0 8 0 amappl10 144 24 0 19 1 0 1 1 0 8 0 amappl9 136 365 0 364 1 0 1 1 0 8 0 amappl8 128 358 0 308 2 0 2 2 0 8 0 amappl7 120 115 0 102 1 0 1 1 0 8 0 amappl6 112 362 0 351 1 0 1 1 0 8 0 amappl5 104 827 0 815 1 0 1 1 0 8 0 amappl4 96 882 0 856 1 0 1 1 0 8 0 amappl3 88 235 0 229 1 0 1 1 0 8 0 amappl2 80 7017 0 6949 2 0 2 2 0 8 0 amappl1 72 32579 0 32159 23 14 9 17 0 8 0 amappl 80 2347 0 2298 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 17 0 4 1 0 1 1 0 8 0 uaddrrnd 24 994 0 977 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 994 0 977 1 0 1 1 0 8 0 vmmpekpl 168 14879 0 14848 2 0 2 2 0 8 0 vmmpepl 168 165427 0 162936 169 54 115 143 0 357 6 vmsppl 272 993 0 977 3 1 2 2 0 8 0 pdppl 4096 1994 0 1957 7 1 6 6 0 8 1 pvpl 32 1019938 0 995299 258 28 230 239 0 265 28 pmappl 200 993 0 977 1 0 1 1 0 8 0 extentpl 40 53 0 36 1 0 1 1 0 8 0 phpool 112 257 0 29 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(ffffffff823fae90) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac3540) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac3540) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da6fc88,9,fffffd80621c4300,0,0,ffff80001d71d870) at tcp_usrreq+0xa54 sosend(fffffd805da6fc88,0,ffff80001d765528,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d71d870,3,ffff80001d765528,0,ffff80001d765610) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d71d870,ffff80001d7655c0,ffff80001d765610) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d765690) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0012c33c8, 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(ffffffff823fae90) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ac3540) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac3540) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da6fc88,9,fffffd80621c4300,0,0,ffff80001d71d870) at tcp_usrreq+0xa54 sosend(fffffd805da6fc88,0,ffff80001d765528,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d71d870,3,ffff80001d765528,0,ffff80001d765610) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d71d870,ffff80001d7655c0,ffff80001d765610) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d765690) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0012c33c8, count: -9