panic: tcp_output: template len != hdrlen - optlen Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *243655 49732 0 0x2 0x4000000 0 syz-fuzzer db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff82412330) 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(fffffd806eae5e18,9,fffffd806d7ceb00,0,0,ffff800020ddcc38) at tcp_usrreq+0xa55 sosend(fffffd806eae5e18,0,ffff800020eaed08,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020ddcc38,3,ffff800020eaed08,0,ffff800020eaedf0) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020ddcc38,ffff800020eaeda0,ffff800020eaedf0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020eaee70) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020eaee70) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0002ab3c8, 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(ffffffff82412330) 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(fffffd806eae5e18,9,fffffd806d7ceb00,0,0,ffff800020ddcc38) at tcp_usrreq+0xa55 sosend(fffffd806eae5e18,0,ffff800020eaed08,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020ddcc38,3,ffff800020eaed08,0,ffff800020eaedf0) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020ddcc38,ffff800020eaeda0,ffff800020eaedf0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020eaee70) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020eaee70) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0002ab3c8, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff800020eae870 rbx 0xffff800020eae920 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff820ec77f kprintf+0x16f r9 0x1 r10 0x2 r11 0x970db3e96d511464 r12 0x3000000008 r13 0xffff800020eae880 r14 0x100 r15 0x1 rip 0xffffffff810b2e08 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020eae860 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-fuzzer) pid=243655 stat=onproc flags process=2 proc=4000000 pri=32, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff800020ddc008,0xffff800020ddc288 process=0xffff8000ffffebb8 user=0xffff800020ea9000, vmspace=0xfffffd806e8f8a18 estcpu=0, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 92381 413696 13008 0 3 0x80 nanosleep syz-executor.0 92381 48874 13008 0 3 0x4000080 netcon2 syz-executor.0 92381 20282 13008 0 3 0x4000080 fsleep syz-executor.0 86876 316736 0 0 3 0x14200 bored sosplice 19969 214352 49732 0 3 0x82 piperd syz-executor.1 13008 422773 49732 0 3 0x82 nanosleep syz-executor.0 49732 429049 53582 0 3 0x82 thrsleep syz-fuzzer 49732 53945 53582 0 3 0x4000082 nanosleep syz-fuzzer 49732 360171 53582 0 3 0x4000082 thrsleep syz-fuzzer 49732 311877 53582 0 3 0x4000082 thrsleep syz-fuzzer 49732 281496 53582 0 3 0x4000082 thrsleep syz-fuzzer 49732 353973 53582 0 3 0x4000082 thrsleep syz-fuzzer 49732 140949 53582 0 3 0x4000082 thrsleep syz-fuzzer 49732 34285 53582 0 3 0x4000082 thrsleep syz-fuzzer *49732 243655 53582 0 7 0x4000002 syz-fuzzer 49732 244970 53582 0 3 0x4000082 kqread syz-fuzzer 53582 126032 62564 0 3 0x10008a pause ksh 62564 246644 33319 0 3 0x92 select sshd 10353 387377 1 0 3 0x100083 ttyin getty 33319 353516 1 0 3 0x80 select sshd 8608 69335 89507 74 3 0x100092 bpf pflogd 89507 244023 1 0 3 0x80 netio pflogd 27899 267305 68877 73 3 0x100090 kqread syslogd 68877 144536 1 0 3 0x100082 netio syslogd 32400 25053 1 77 3 0x100090 poll dhclient 3227 70050 1 0 3 0x80 poll dhclient 96541 27430 0 0 3 0x14200 bored smr 91775 480233 0 0 3 0x14200 pgzero zerothread 96220 119081 0 0 3 0x14200 aiodoned aiodoned 89016 97746 0 0 3 0x14200 syncer update 40369 468547 0 0 3 0x14200 cleaner cleaner 82232 7348 0 0 3 0x14200 reaper reaper 93015 278246 0 0 3 0x14200 pgdaemon pagedaemon 27299 452459 0 0 3 0x14200 bored crynlk 81983 272702 0 0 3 0x14200 bored crypto 67562 479976 0 0 3 0x40014200 acpi0 acpi0 99879 17982 0 0 7 0x40014200 idle1 71903 207732 0 0 3 0x14200 bored softnet 80884 389864 0 0 3 0x14200 bored systqmp 41307 135691 0 0 3 0x14200 bored systq 95928 257087 0 0 3 0x40014200 bored softclock 68371 115890 0 0 3 0x40014200 idle0 1 140827 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 49732 (syz-fuzzer) thread 0xffff800020ddcc38 (243655) exclusive rwlock netlock r = 0 (0xffffffff8276be18) #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 9543 6433K 6938K 78643K 11376 0 pcb 13 8K 8K 78643K 108 0 rtable 118 7K 10K 78643K 473 0 ifaddr 98 18K 18K 78643K 174 0 sysctl 3 1K 1K 78643K 3 0 counters 43 33K 34K 78643K 61 0 ioctlops 0 0K 4K 78643K 1556 0 iov 0 0K 16K 78643K 76 0 mount 1 1K 1K 78643K 1 0 vnodes 1225 77K 77K 78643K 1514 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 4 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 1K 78643K 55 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1824 197K 290K 78643K 13058 0 file desc 5 13K 25K 78643K 553 0 sigio 0 0K 0K 78643K 6 0 proc 61 63K 95K 78643K 469 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 25 0 in_multi 76 3K 3K 78643K 159 0 ether_multi 1 0K 0K 78643K 8 0 mrt 0 0K 0K 78643K 2 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 61 281K 281K 78643K 61 0 exec 0 0K 1K 78643K 234 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 55K 55K 78643K 2778 0 UVM aobj 24 2K 2K 78643K 24 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 58 0 NDP 15 0K 0K 78643K 39 0 temp 117 3865K 3935K 78643K 11484 0 kqueue 3 4K 12K 78643K 22 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 39 0 37 1 0 1 1 0 8 0 rtentry 112 81 0 40 2 0 2 2 0 8 0 unpcb 120 305 0 295 1 0 1 1 0 8 0 syncache 264 30 0 30 3 2 1 1 0 8 1 tcpqe 32 35 0 35 2 2 0 1 0 8 0 tcpcb 544 283 0 278 2 1 1 2 0 8 0 inpcb 296 1055 0 1047 6 4 2 2 0 8 1 rttmr 72 1 0 1 1 1 0 1 0 8 0 ip6q 72 1 0 1 1 1 0 1 0 8 0 ip6af 40 3 0 3 1 1 0 1 0 8 0 nd6 48 23 0 19 1 0 1 1 0 8 0 ppxss 1128 2 0 2 1 1 0 1 0 8 0 pffrag 232 3 0 3 1 1 0 1 0 482 0 pffrnode 88 3 0 3 1 1 0 1 0 8 0 pffrent 40 92 0 92 1 1 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 59 0 51 2 1 1 2 0 8 0 pfstitem 24 38 0 30 1 0 1 1 0 8 0 pfstkey 112 38 0 30 1 0 1 1 0 8 0 pfstate 328 38 0 30 3 0 3 3 0 8 0 pfrule 1360 41 0 23 3 1 2 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 328 0 156 13 0 13 13 0 8 0 art_table 32 329 0 156 2 0 2 2 0 8 0 art_node 16 80 0 42 1 0 1 1 0 8 0 sysvmsgpl 40 13 0 5 1 0 1 1 0 8 0 semupl 112 4 0 4 3 3 0 1 0 8 0 semapl 112 51 0 41 1 0 1 1 0 8 0 shmpl 112 21 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 2191 0 785 89 0 89 89 0 8 0 ffsino 272 2191 0 785 95 1 94 95 0 8 0 nchpl 144 3301 0 1686 61 0 61 61 0 8 0 uvmvnodes 72 2399 0 0 44 0 44 44 0 8 0 vnodes 208 2399 0 0 127 0 127 127 0 8 0 namei 1024 9878 0 9878 3 2 1 1 0 8 1 percpumem 16 41 0 9 1 0 1 1 0 8 0 vcpupl 1984 3 0 0 1 0 1 1 0 8 0 vmpool 560 4 0 1 1 0 1 1 0 8 0 pfiaddrpl 120 22 0 12 1 0 1 1 0 8 0 scxspl 192 9465 0 9465 8 7 1 7 0 8 1 plimitpl 152 33 0 25 1 0 1 1 0 8 0 sigapl 424 769 0 737 4 0 4 4 0 8 0 futexpl 56 8422 0 8421 4 3 1 1 0 8 0 knotepl 112 84 0 65 1 0 1 1 0 8 0 kqueuepl 144 106 0 103 1 0 1 1 0 8 0 pipepl 304 168 0 158 3 2 1 2 0 8 0 fdescpl 496 753 0 737 3 0 3 3 0 8 0 filepl 152 5428 0 5326 7 2 5 6 0 8 1 lockfpl 104 152 0 151 1 0 1 1 0 8 0 lockfspl 48 50 0 49 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 1080 0 1071 1 0 1 1 0 8 0 zombiepl 144 737 0 737 1 0 1 1 0 8 1 processpl 992 769 0 737 5 0 5 5 0 8 0 procpl 624 1981 0 1938 4 0 4 4 0 8 0 sosppl 128 233 0 233 4 3 1 1 0 8 1 sockpl 400 1408 0 1388 8 5 3 5 0 8 0 mcl64k 65536 12 0 0 2 0 2 2 0 8 0 mcl16k 16384 4 0 0 1 0 1 1 0 8 0 mcl12k 12288 17 0 0 2 0 2 2 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 8 0 0 1 0 1 1 0 8 0 mcl2k2 2112 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 151 0 0 18 0 18 18 0 8 0 mtagpl 96 58 0 0 2 0 2 2 0 8 0 mbufpl 256 538 0 0 31 0 31 31 0 8 0 bufpl 280 4735 0 138 329 0 329 329 0 8 0 anonpl 16 79981 0 62805 87 17 70 85 0 124 0 amapchunkpl 152 4793 0 4627 23 14 9 21 0 158 0 amappl16 192 3513 0 2603 58 12 46 57 0 8 0 amappl15 184 10 0 8 1 0 1 1 0 8 0 amappl14 176 30 0 24 1 0 1 1 0 8 0 amappl13 168 31 0 27 1 0 1 1 0 8 0 amappl12 160 296 0 293 2 1 1 1 0 8 0 amappl11 152 64 0 48 1 0 1 1 0 8 0 amappl10 144 19 0 13 1 0 1 1 0 8 0 amappl9 136 622 0 619 1 0 1 1 0 8 0 amappl8 128 574 0 545 1 0 1 1 0 8 0 amappl7 120 116 0 105 1 0 1 1 0 8 0 amappl6 112 22 0 19 1 0 1 1 0 8 0 amappl5 104 937 0 920 1 0 1 1 0 8 0 amappl4 96 497 0 468 1 0 1 1 0 8 0 amappl3 88 139 0 134 1 0 1 1 0 8 0 amappl2 80 5090 0 5020 2 0 2 2 0 8 0 amappl1 72 25987 0 25540 23 12 11 18 0 8 0 amappl 80 2241 0 2194 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 23 0 0 1 0 1 1 0 8 0 uaddrrnd 24 757 0 738 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 757 0 738 1 0 1 1 0 8 0 vmmpekpl 168 9669 0 9631 2 0 2 2 0 8 0 vmmpepl 168 97838 0 95749 129 32 97 114 0 357 1 vmsppl 368 756 0 738 2 0 2 2 0 8 0 pdppl 4096 1521 0 1479 6 0 6 6 0 8 0 pvpl 32 252221 0 231976 207 40 167 199 0 265 2 pmappl 232 756 0 738 3 1 2 2 0 8 0 extentpl 40 53 0 36 1 0 1 1 0 8 0 phpool 112 285 0 12 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(ffffffff82412330) 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(fffffd806eae5e18,9,fffffd806d7ceb00,0,0,ffff800020ddcc38) at tcp_usrreq+0xa55 sosend(fffffd806eae5e18,0,ffff800020eaed08,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020ddcc38,3,ffff800020eaed08,0,ffff800020eaedf0) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020ddcc38,ffff800020eaeda0,ffff800020eaedf0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020eaee70) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020eaee70) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0002ab3c8, 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