panic: tcp_output: template len != hdrlen - optlen Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *441195 32494 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(ffff800000ac3100) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac3100) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da80af8,9,fffffd806bc22000,0,0,ffff80001d71d390) at tcp_usrreq+0xa54 sosend(fffffd805da80af8,0,ffff80001d767b68,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d71d390,3,ffff80001d767b68,0,ffff80001d767c50) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d71d390,ffff80001d767c00,ffff80001d767c50) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d767cd0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc002dd73c8, 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(ffff800000ac3100) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac3100) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da80af8,9,fffffd806bc22000,0,0,ffff80001d71d390) at tcp_usrreq+0xa54 sosend(fffffd805da80af8,0,ffff80001d767b68,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d71d390,3,ffff80001d767b68,0,ffff80001d767c50) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d71d390,ffff80001d767c00,ffff80001d767c50) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d767cd0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc002dd73c8, count: -9 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80001d7676d0 rbx 0xffff80001d767780 rdx 0x2 rcx 0 rax 0x1 r8 0xffffffff8163080f kprintf+0x15f r9 0x1 r10 0x2 r11 0xe348dc990829b3c9 r12 0x3000000008 r13 0xffff80001d7676e0 r14 0x100 r15 0x1 rip 0xffffffff8114a6e8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80001d7676c0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-fuzzer) pid=441195 stat=onproc flags process=2 proc=4000000 pri=32, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff80001d71ceb0,0xffff80001d6a99d8 process=0xffff80001d706018 user=0xffff80001d762000, vmspace=0xfffffd806bc09880 estcpu=0, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 90534 73567 43251 0 3 0x80 fsleep syz-executor.0 90534 182620 43251 0 3 0x4000080 ttyout syz-executor.0 52042 134949 0 0 3 0x14200 acct acct 50018 314975 0 0 3 0x14200 bored sosplice 4791 165198 0 0 3 0x14280 nfsidl nfsio 15290 446407 0 0 3 0x14280 nfsidl nfsio 87578 168588 0 0 3 0x14280 nfsidl nfsio 9792 151378 0 0 3 0x14280 nfsidl nfsio 56516 1052 0 0 3 0x14280 nfsidl nfsio 60352 371664 0 0 3 0x14280 nfsidl nfsio 50968 393800 0 0 3 0x14280 nfsidl nfsio 13820 481739 0 0 3 0x14280 nfsidl nfsio 32798 109726 0 0 3 0x14280 nfsidl nfsio 71631 42973 0 0 3 0x14280 nfsidl nfsio 92785 446064 0 0 3 0x14280 nfsidl nfsio 90022 124737 0 0 3 0x14280 nfsidl nfsio 86678 250726 0 0 3 0x14280 nfsidl nfsio 97338 33366 0 0 3 0x14280 nfsidl nfsio 44516 79713 0 0 3 0x14280 nfsidl nfsio 48388 22771 0 0 3 0x14280 nfsidl nfsio 74384 483875 0 0 3 0x14280 nfsidl nfsio 48385 310979 0 0 3 0x14280 nfsidl nfsio 47370 199970 0 0 3 0x14280 nfsidl nfsio 74045 336771 0 0 3 0x14280 nfsidl nfsio 43251 355898 32494 0 3 0x82 nanosleep syz-executor.0 75542 484415 32494 0 3 0x82 piperd syz-executor.1 32494 505140 63375 0 3 0x82 thrsleep syz-fuzzer 32494 475670 63375 0 2 0x4000002 syz-fuzzer 32494 345586 63375 0 3 0x4000082 kqread syz-fuzzer 32494 45423 63375 0 3 0x4000082 thrsleep syz-fuzzer 32494 375443 63375 0 3 0x4000082 thrsleep syz-fuzzer *32494 441195 63375 0 7 0x4000002 syz-fuzzer 32494 48897 63375 0 3 0x4000082 thrsleep syz-fuzzer 32494 483819 63375 0 2 0x4000002 syz-fuzzer 63375 220427 98491 0 3 0x10008a pause ksh 98491 500259 93501 0 3 0x92 select sshd 29298 453397 1 0 3 0x100083 ttyin getty 93501 201392 1 0 3 0x80 select sshd 44546 65858 87682 73 3 0x100090 kqread syslogd 87682 48427 1 0 3 0x100082 netio syslogd 46400 364464 1 77 3 0x100090 poll dhclient 51588 474321 1 0 3 0x80 poll dhclient 87594 329514 0 0 3 0x14200 bored smr 83921 431889 0 0 3 0x14200 pgzero zerothread 3663 425282 0 0 3 0x14200 aiodoned aiodoned 85895 150275 0 0 3 0x14200 syncer update 5885 170132 0 0 3 0x14200 cleaner cleaner 87353 506065 0 0 3 0x14200 reaper reaper 89020 374485 0 0 3 0x14200 pgdaemon pagedaemon 6232 254978 0 0 3 0x14200 bored crynlk 97091 378433 0 0 3 0x14200 bored crypto 32655 517039 0 0 3 0x40014200 acpi0 acpi0 1892 154462 0 0 3 0x14200 bored softnet 19143 193389 0 0 3 0x14200 bored systqmp 90885 109637 0 0 3 0x14200 bored systq 88218 349428 0 0 3 0x40014200 bored softclock 82863 514282 0 0 3 0x40014200 idle0 1 496497 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 9495 6349K 7121K 78643K 11434 0 pcb 13 8K 8K 78643K 80 0 rtable 113 6K 10K 78643K 344 0 ifaddr 79 16K 16K 78643K 119 0 sysctl 3 1K 1K 78643K 3 0 counters 21 16K 16K 78643K 24 0 ioctlops 0 0K 4K 78643K 360 0 iov 0 0K 12K 78643K 116 0 mount 1 1K 1K 78643K 1 0 vnodes 1220 77K 77K 78643K 1456 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 0K 0K 78643K 2 0 sem 12 0K 0K 78643K 90 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1809 195K 288K 78643K 12938 0 file desc 5 13K 25K 78643K 527 0 sigio 0 0K 0K 78643K 4 0 proc 49 38K 54K 78643K 414 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 216 0 in_multi 60 3K 3K 78643K 109 0 ether_multi 1 0K 0K 78643K 12 0 mrt 0 0K 0K 78643K 6 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 55 254K 254K 78643K 55 0 exec 0 0K 1K 78643K 204 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 137 56K 72K 78643K 2273 0 UVM aobj 35 2K 2K 78643K 40 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 64 0 NDP 11 0K 0K 78643K 22 0 temp 132 3870K 3936K 78643K 4306 0 kqueue 3 4K 22K 78643K 44 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 7 0 0 1 0 1 1 0 8 0 rtpcb 80 40 0 38 1 0 1 1 0 8 0 rtentry 112 64 0 25 2 0 2 2 0 8 0 unpcb 120 462 0 454 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 249 0 249 1 1 0 1 0 8 0 tcpcb 544 145 0 141 2 1 1 2 0 8 0 ipq 40 7 0 7 4 4 0 1 0 8 0 ipqe 40 145 0 145 4 4 0 1 0 8 0 inpcb 296 527 0 520 8 7 1 2 0 8 0 rttmr 72 1 0 1 1 1 0 1 0 8 0 nd6 48 16 0 5 1 0 1 1 0 8 0 pkpcb 40 4 0 4 1 1 0 1 0 8 0 pfosfp 40 1 0 0 1 0 1 1 0 8 0 pfosfpen 112 2 0 0 1 0 1 1 0 8 0 pfrktable 1344 26 0 19 2 1 1 2 0 8 0 pftag 88 11 0 10 1 0 1 1 0 8 0 pfrule 1360 15 0 10 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 305 0 73 18 3 15 16 0 8 0 art_table 32 306 0 73 3 1 2 3 0 8 0 art_node 16 58 0 26 1 0 1 1 0 8 0 sysvmsgpl 40 7 0 5 4 3 1 1 0 8 0 semupl 112 4 0 4 1 1 0 1 0 8 0 semapl 112 88 0 78 1 0 1 1 0 8 0 shmpl 112 37 0 5 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 2100 0 697 88 0 88 88 0 8 0 ffsino 240 2100 0 697 83 0 83 83 0 8 0 nchpl 144 3083 0 1481 60 0 60 60 0 8 0 uvmvnodes 72 2326 0 0 43 0 43 43 0 8 0 vnodes 208 2326 0 0 123 0 123 123 0 8 0 namei 1024 8793 0 8793 10 9 1 1 0 8 1 vcpupl 1984 3 0 0 1 0 1 1 0 8 0 vmpool 528 4 0 1 2 1 1 1 0 8 0 pfiaddrpl 120 12 0 7 1 0 1 1 0 8 0 scxspl 192 8590 0 8590 3 2 1 1 0 8 1 plimitpl 152 57 0 50 1 0 1 1 0 8 0 sigapl 424 735 0 685 6 0 6 6 0 8 0 futexpl 56 10011 0 10010 10 9 1 1 0 8 0 knotepl 112 151 0 132 2 1 1 2 0 8 0 kqueuepl 144 137 0 135 1 0 1 1 0 8 0 pipepl 272 135 0 125 3 2 1 2 0 8 0 fdescpl 432 699 0 685 2 0 2 2 0 8 0 filepl 120 4643 0 4545 4 0 4 4 0 8 1 lockfpl 104 169 0 168 1 0 1 1 0 8 0 lockfspl 48 71 0 70 1 0 1 1 0 8 0 sessionpl 112 17 0 7 1 0 1 1 0 8 0 pgrppl 48 19 0 9 1 0 1 1 0 8 0 ucredpl 96 588 0 581 1 0 1 1 0 8 0 zombiepl 144 685 0 685 1 0 1 1 0 8 1 processpl 928 735 0 685 7 0 7 7 0 8 0 procpl 624 1560 0 1502 9 4 5 6 0 8 0 sosppl 128 4 0 4 2 2 0 1 0 8 0 sockpl 400 1033 0 1016 14 11 3 4 0 8 1 mcl64k 65536 29 0 29 9 8 1 1 0 8 1 mcl16k 16384 3 0 3 3 3 0 1 0 8 0 mcl12k 12288 15 0 15 8 8 0 1 0 8 0 mcl9k 9216 6 0 6 5 5 0 1 0 8 0 mcl8k 8192 15 0 15 6 6 0 1 0 8 0 mcl4k 4096 68 0 68 14 13 1 1 0 8 1 mcl2k2 2112 3 0 3 3 3 0 1 0 8 0 mcl2k 2048 96057 0 96014 19 13 6 16 0 8 0 mtagpl 96 43 0 8 2 1 1 1 0 8 0 mbufpl 256 154722 0 154550 33 20 13 21 0 8 0 bufpl 280 3988 0 135 276 0 276 276 0 8 0 anonpl 16 87782 0 71106 120 51 69 85 0 107 0 amapchunkpl 152 4114 0 3974 34 28 6 20 0 158 0 amappl16 192 3771 0 2848 79 32 47 59 0 8 0 amappl15 184 244 0 242 1 0 1 1 0 8 0 amappl14 176 23 0 19 1 0 1 1 0 8 0 amappl13 168 37 0 32 1 0 1 1 0 8 0 amappl12 160 11 0 9 1 0 1 1 0 8 0 amappl11 152 46 0 37 1 0 1 1 0 8 0 amappl10 144 263 0 257 1 0 1 1 0 8 0 amappl9 136 372 0 371 1 0 1 1 0 8 0 amappl8 128 352 0 302 2 0 2 2 0 8 0 amappl7 120 358 0 345 1 0 1 1 0 8 0 amappl6 112 25 0 19 1 0 1 1 0 8 0 amappl5 104 638 0 627 1 0 1 1 0 8 0 amappl4 96 425 0 398 1 0 1 1 0 8 0 amappl3 88 118 0 112 1 0 1 1 0 8 0 amappl2 80 5020 0 4953 2 0 2 2 0 8 0 amappl1 72 26687 0 26273 24 15 9 17 0 8 0 amappl 80 1777 0 1732 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 39 0 5 1 0 1 1 0 8 0 uaddrrnd 24 703 0 686 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 703 0 686 1 0 1 1 0 8 0 vmmpekpl 168 8811 0 8779 2 0 2 2 0 8 0 vmmpepl 168 94151 0 92108 151 56 95 113 0 357 1 vmsppl 272 702 0 686 3 1 2 2 0 8 0 pdppl 4096 1412 0 1375 6 1 5 6 0 8 0 pvpl 32 247620 0 227846 273 108 165 199 0 265 3 pmappl 200 702 0 686 1 0 1 1 0 8 0 extentpl 40 53 0 36 1 0 1 1 0 8 0 phpool 112 327 0 97 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(ffff800000ac3100) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac3100) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da80af8,9,fffffd806bc22000,0,0,ffff80001d71d390) at tcp_usrreq+0xa54 sosend(fffffd805da80af8,0,ffff80001d767b68,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d71d390,3,ffff80001d767b68,0,ffff80001d767c50) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d71d390,ffff80001d767c00,ffff80001d767c50) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d767cd0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc002dd73c8, 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(ffff800000ac3100) at tcp_output+0x2ad0 tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ac3100) at tcp_output+0x2ad0 sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd805da80af8,9,fffffd806bc22000,0,0,ffff80001d71d390) at tcp_usrreq+0xa54 sosend(fffffd805da80af8,0,ffff80001d767b68,0,0,80) at sosend+0x669 sys/kern/uipc_socket.c:555 dofilewritev(ffff80001d71d390,3,ffff80001d767b68,0,ffff80001d767c50) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80001d71d390,ffff80001d767c00,ffff80001d767c50) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff80001d767cd0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc002dd73c8, count: -9