panic: tcp_output: template len != hdrlen - optlen Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *363490 27405 0 0x2 0x4000000 1 syz-fuzzer db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff82413bb8) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ada100) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ada100) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806eae4c88,9,fffffd806a7c8f00,0,0,ffff800020ddcea8) at tcp_usrreq+0xa55 sosend(fffffd806eae4c88,0,ffff800020ead078,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020ddcea8,3,ffff800020ead078,0,ffff800020ead160) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020ddcea8,ffff800020ead110,ffff800020ead160) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020ead1e0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020ead1e0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0001c73c8, 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{1}> ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic tcp_output: template len != hdrlen - optlen ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff82413bb8) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ada100) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ada100) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806eae4c88,9,fffffd806a7c8f00,0,0,ffff800020ddcea8) at tcp_usrreq+0xa55 sosend(fffffd806eae4c88,0,ffff800020ead078,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020ddcea8,3,ffff800020ead078,0,ffff800020ead160) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020ddcea8,ffff800020ead110,ffff800020ead160) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020ead1e0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020ead1e0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0001c73c8, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff800020eacbe0 rbx 0xffff800020eacc90 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81dea00f kprintf+0x16f r9 0x1 r10 0x2 r11 0xe057e191caf5af5e r12 0x3000000008 r13 0xffff800020eacbf0 r14 0x100 r15 0x1 rip 0xffffffff8190ff98 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020eacbd0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-fuzzer) pid=363490 stat=onproc flags process=2 proc=4000000 pri=32, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff800020e41d50,0xffff800020ddc9d8 process=0xffff800020e38ba0 user=0xffff800020ea8000, vmspace=0xfffffd806e909178 estcpu=0, cpticks=0, pctcpu=0.47 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 43868 78476 0 0 3 0x14200 bored sosplice 77755 108995 27405 0 3 0x82 piperd syz-executor.1 23506 475408 27405 0 3 0x82 wait syz-executor.0 27405 14405 42689 0 3 0x82 thrsleep syz-fuzzer 27405 9778 42689 0 3 0x4000082 nanosleep syz-fuzzer 27405 472288 42689 0 3 0x4000082 thrsleep syz-fuzzer 27405 243952 42689 0 3 0x4000082 thrsleep syz-fuzzer 27405 292149 42689 0 3 0x4000082 thrsleep syz-fuzzer *27405 363490 42689 0 7 0x4000002 syz-fuzzer 27405 355317 42689 0 3 0x4000082 thrsleep syz-fuzzer 27405 69798 42689 0 3 0x4000082 thrsleep syz-fuzzer 27405 348228 42689 0 3 0x4000082 thrsleep syz-fuzzer 27405 224502 42689 0 3 0x4000082 thrsleep syz-fuzzer 27405 513035 42689 0 3 0x4000082 kqread syz-fuzzer 42689 193999 75052 0 3 0x10008a pause ksh 75052 384085 80367 0 3 0x92 select sshd 15597 357909 1 0 3 0x100083 ttyin getty 80367 25483 1 0 3 0x80 select sshd 2946 268875 14323 74 3 0x100092 bpf pflogd 14323 89105 1 0 3 0x80 netio pflogd 62528 314436 6831 73 3 0x100090 kqread syslogd 6831 165210 1 0 3 0x100082 netio syslogd 33043 284736 1 77 3 0x100090 poll dhclient 98990 328904 1 0 3 0x80 poll dhclient 32994 170748 0 0 3 0x14200 bored smr 38343 500400 0 0 3 0x14200 pgzero zerothread 89349 494785 0 0 3 0x14200 aiodoned aiodoned 5740 335089 0 0 3 0x14200 syncer update 16423 148579 0 0 3 0x14200 cleaner cleaner 96038 95344 0 0 3 0x14200 reaper reaper 82569 460096 0 0 3 0x14200 pgdaemon pagedaemon 5845 128973 0 0 3 0x14200 bored crynlk 76662 206941 0 0 3 0x14200 bored crypto 5888 78366 0 0 3 0x40014200 acpi0 acpi0 87169 429226 0 0 3 0x40014200 idle1 11924 226019 0 0 3 0x14200 bored softnet 92182 467038 0 0 3 0x14200 bored systqmp 2110 14970 0 0 3 0x14200 bored systq 99161 339745 0 0 3 0x40014200 bored softclock 25011 390160 0 0 7 0x40014200 idle0 1 108482 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 27405 (syz-fuzzer) thread 0xffff800020ddcea8 (363490) exclusive rwlock netlock r = 0 (0xffffffff827059e8) #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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9505 6412K 6732K 78643K 10906 0 pcb 13 8K 8K 78643K 75 0 rtable 135 11K 11K 78643K 353 0 ifaddr 86 18K 19K 78643K 126 0 sysctl 1 1K 1K 78643K 1 0 counters 43 33K 34K 78643K 53 0 ioctlops 0 0K 4K 78643K 1568 0 iov 0 0K 24K 78643K 60 0 mount 1 1K 1K 78643K 1 0 vnodes 1219 77K 77K 78643K 1336 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 8 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 141 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1824 197K 290K 78643K 13058 0 file desc 5 13K 25K 78643K 320 0 sigio 0 0K 0K 78643K 2 0 proc 62 63K 83K 78643K 467 0 subproc 32 2K 2K 78643K 36 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 26 0 in_multi 67 3K 3K 78643K 138 0 ether_multi 1 0K 0K 78643K 8 0 mrt 0 0K 0K 78643K 1 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 229 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 188 329K 329K 78643K 2001 0 UVM aobj 16 2K 2K 78643K 17 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 38 0 NDP 10 0K 0K 78643K 25 0 temp 103 3868K 3932K 78643K 3430 0 kqueue 3 4K 9K 78643K 16 0 SYN cache 2 16K 16K 78643K 2 0 ddb{1}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 7 0 0 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 38 0 36 1 0 1 1 0 8 0 rtentry 112 72 0 29 2 0 2 2 0 8 0 unpcb 120 141 0 131 1 0 1 1 0 8 0 syncache 264 5 0 5 2 2 0 1 0 8 0 tcpcb 544 87 0 83 1 0 1 1 0 8 0 inpcb 296 367 0 360 2 1 1 2 0 8 0 nd6 48 19 0 15 1 0 1 1 0 8 0 pkpcb 40 2 0 2 1 1 0 1 0 8 0 ppxss 1128 1 0 1 1 1 0 1 0 8 0 pffrag 232 1 0 0 1 0 1 1 0 482 0 pffrnode 88 1 0 0 1 0 1 1 0 8 0 pffrent 40 2 0 1 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 21 0 8 2 0 2 2 0 8 0 pfstitem 24 12 0 4 1 0 1 1 0 8 0 pfstkey 112 12 0 4 1 0 1 1 0 8 0 pfstate 328 12 0 4 1 0 1 1 0 8 0 pfrule 1360 29 0 16 2 0 2 2 0 8 0 art_heap8 4096 2 0 0 2 0 2 2 0 8 0 art_heap4 256 283 0 105 13 1 12 13 0 8 0 art_table 32 285 0 105 2 0 2 2 0 8 0 art_node 16 71 0 31 1 0 1 1 0 8 0 sysvmsgpl 40 5 0 5 1 1 0 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 137 0 127 1 0 1 1 0 8 0 shmpl 112 15 0 2 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1915 0 511 89 1 88 89 0 8 0 ffsino 272 1915 0 511 95 1 94 95 0 8 0 nchpl 144 2616 0 1005 60 0 60 60 0 8 0 uvmvnodes 72 2035 0 0 37 0 37 37 0 8 0 vnodes 208 2035 0 0 108 0 108 108 0 8 0 namei 1024 7182 0 7182 1 1 0 1 0 8 0 percpumem 16 37 0 5 1 0 1 1 0 8 0 vcpupl 1984 42 0 0 6 0 6 6 0 8 0 vmpool 560 45 0 3 3 0 3 3 0 8 0 pfiaddrpl 120 9 0 0 1 0 1 1 0 8 0 scxspl 192 7705 0 7705 8 7 1 7 0 8 1 plimitpl 152 27 0 19 1 0 1 1 0 8 0 sigapl 424 536 0 504 4 0 4 4 0 8 0 futexpl 56 4925 0 4925 1 1 0 1 0 8 0 knotepl 112 72 0 53 1 0 1 1 0 8 0 kqueuepl 144 47 0 44 1 0 1 1 0 8 0 pipepl 304 114 0 104 2 1 1 2 0 8 0 fdescpl 496 520 0 504 3 0 3 3 0 8 0 filepl 152 3024 0 2921 5 0 5 5 0 8 0 lockfpl 104 55 0 54 1 0 1 1 0 8 0 lockfspl 48 21 0 20 1 0 1 1 0 8 0 sessionpl 112 18 0 7 1 0 1 1 0 8 0 pgrppl 48 20 0 9 1 0 1 1 0 8 0 ucredpl 96 222 0 213 1 0 1 1 0 8 0 zombiepl 144 505 0 504 1 0 1 1 0 8 0 processpl 984 536 0 504 5 0 5 5 0 8 0 procpl 624 1153 0 1111 4 0 4 4 0 8 0 sosppl 128 1 0 1 1 1 0 1 0 8 0 sockpl 400 549 0 530 3 1 2 3 0 8 0 mcl64k 65536 8 0 0 1 0 1 1 0 8 0 mcl12k 12288 3 0 0 1 0 1 1 0 8 0 mcl9k 9216 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 6 0 0 1 0 1 1 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 181 0 0 22 0 22 22 0 8 0 mtagpl 96 20 0 0 1 0 1 1 0 8 0 mbufpl 256 215 0 0 13 0 13 13 0 8 0 bufpl 280 3973 0 135 275 0 275 275 0 8 0 anonpl 16 61597 0 44328 79 8 71 78 0 124 0 amapchunkpl 152 3070 0 2863 21 12 9 21 0 158 0 amappl16 192 2281 0 1351 47 0 47 47 0 8 0 amappl15 184 9 0 7 1 0 1 1 0 8 0 amappl14 176 25 0 20 1 0 1 1 0 8 0 amappl13 168 28 0 25 1 0 1 1 0 8 0 amappl12 160 13 0 11 2 1 1 1 0 8 0 amappl11 152 208 0 191 1 0 1 1 0 8 0 amappl10 144 21 0 17 1 0 1 1 0 8 0 amappl9 136 522 0 519 1 0 1 1 0 8 0 amappl8 128 491 0 454 2 0 2 2 0 8 0 amappl7 120 116 0 105 1 0 1 1 0 8 0 amappl6 112 174 0 171 1 0 1 1 0 8 0 amappl5 104 419 0 402 1 0 1 1 0 8 0 amappl4 96 483 0 454 1 0 1 1 0 8 0 amappl3 88 116 0 111 1 0 1 1 0 8 0 amappl2 80 3182 0 3112 2 0 2 2 0 8 0 amappl1 72 21260 0 20805 23 13 10 18 0 8 0 amappl 80 1430 0 1360 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 16 0 1 1 0 1 1 0 8 0 uaddrrnd 24 565 0 507 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 565 0 507 1 0 1 1 0 8 0 vmmpekpl 168 7559 0 7517 2 0 2 2 0 8 0 vmmpepl 168 69879 0 67708 115 15 100 112 0 357 0 vmsppl 368 564 0 507 6 0 6 6 0 8 0 pdppl 4096 1137 0 1056 11 0 11 11 0 8 0 pvpl 32 200521 0 180646 181 8 173 181 0 265 9 pmappl 232 564 0 507 4 0 4 4 0 8 0 extentpl 40 53 0 36 1 0 1 1 0 8 0 phpool 112 270 0 7 8 0 8 8 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffffffff82733ff0) 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(ffffffff82733ff0) at sched_idle+0x3f7 sys/kern/kern_sched.c:178 end trace frame: 0x0, count: 10 ddb{0}> trace x86_ipi_db(ffffffff82733ff0) 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(ffffffff82733ff0) at sched_idle+0x3f7 sys/kern/kern_sched.c:178 end trace frame: 0x0, count: -5 ddb{0}> machine ddbcpu 1 Stopped at db_enter+0x18: addq $0x8,%rsp db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff82413bb8) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ada100) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ada100) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806eae4c88,9,fffffd806a7c8f00,0,0,ffff800020ddcea8) at tcp_usrreq+0xa55 sosend(fffffd806eae4c88,0,ffff800020ead078,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020ddcea8,3,ffff800020ead078,0,ffff800020ead160) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020ddcea8,ffff800020ead110,ffff800020ead160) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020ead1e0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020ead1e0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0001c73c8, count: 6 ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff82413bb8) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000ada100) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ada100) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806eae4c88,9,fffffd806a7c8f00,0,0,ffff800020ddcea8) at tcp_usrreq+0xa55 sosend(fffffd806eae4c88,0,ffff800020ead078,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020ddcea8,3,ffff800020ead078,0,ffff800020ead160) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020ddcea8,ffff800020ead110,ffff800020ead160) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020ead1e0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020ead1e0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0001c73c8, count: -9