panic: tcp_output: template len != hdrlen - optlen Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *240600 37599 0 0x2 0 0 syz-fuzzer 231827 37599 0 0x2 0x4000000 1K syz-fuzzer db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff82420d55) at panic+0x164 sys/kern/subr_prf.c:218 tcp_output(ffff800000ad8540) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ad8540) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806eaece18,9,fffffd8068d75e00,0,0,ffff800020e4deb0) at tcp_usrreq+0xa55 sosend(fffffd806eaece18,0,ffff800020e2a9e8,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020e4deb0,6,ffff800020e2a9e8,0,ffff800020e2aad0) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020e4deb0,ffff800020e2aa80,ffff800020e2aad0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020e2ab50) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020e2ab50) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0003b93d8, 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(ffffffff82420d55) at panic+0x164 sys/kern/subr_prf.c:218 tcp_output(ffff800000ad8540) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ad8540) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806eaece18,9,fffffd8068d75e00,0,0,ffff800020e4deb0) at tcp_usrreq+0xa55 sosend(fffffd806eaece18,0,ffff800020e2a9e8,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020e4deb0,6,ffff800020e2a9e8,0,ffff800020e2aad0) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020e4deb0,ffff800020e2aa80,ffff800020e2aad0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020e2ab50) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020e2ab50) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0003b93d8, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff800020e2a550 rbx 0xffff800020e2a600 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffff800020e2a510 r9 0xffffffff81379bbf kprintf+0x16f r10 0x1 r11 0x3b002e5c0eb9e90 r12 0x3000000008 r13 0xffff800020e2a560 r14 0x100 r15 0x1 rip 0xffffffff81f0e6b8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020e2a540 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-fuzzer) pid=240600 stat=onproc flags process=2 proc=0 pri=50, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff800020e4d9d0,0xffff800020e4e130 process=0xffff8000fffff378 user=0xffff800020e25000, vmspace=0xfffffd806e8f7738 estcpu=0, cpticks=0, pctcpu=2.89 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 9845 424664 0 0 3 0x14280 nfsidl nfsio 95946 384677 0 0 3 0x14280 nfsidl nfsio 49496 375295 0 0 3 0x14280 nfsidl nfsio 75326 302623 0 0 3 0x14280 nfsidl nfsio 29847 434445 0 0 3 0x14280 nfsidl nfsio 51419 394422 0 0 3 0x14280 nfsidl nfsio 82246 320914 0 0 3 0x14280 nfsidl nfsio 32785 312781 0 0 3 0x14280 nfsidl nfsio 77191 13844 0 0 3 0x14280 nfsidl nfsio 72034 376049 0 0 3 0x14280 nfsidl nfsio 49039 142059 0 0 3 0x14280 nfsidl nfsio 317 220645 0 0 3 0x14280 nfsidl nfsio 37065 396979 0 0 3 0x14280 nfsidl nfsio 9672 396309 0 0 3 0x14280 nfsidl nfsio 62377 235586 0 0 3 0x14280 nfsidl nfsio 44476 318570 0 0 3 0x14280 nfsidl nfsio 23730 192407 0 0 3 0x14280 nfsidl nfsio 56775 310738 0 0 3 0x14280 nfsidl nfsio 35334 284486 0 0 3 0x14280 nfsidl nfsio 9686 28383 0 0 3 0x14280 nfsidl nfsio 4759 268293 0 0 3 0x14200 bored sosplice 59390 297922 37599 0 2 0x2 syz-executor.1 19365 158496 37599 0 2 0x2 syz-executor.0 *37599 240600 44353 0 7 0x2 syz-fuzzer 37599 361866 44353 0 2 0x4000482 syz-fuzzer 37599 194545 44353 0 3 0x4000082 thrsleep syz-fuzzer 37599 231827 44353 0 7 0x4000002 syz-fuzzer 37599 224391 44353 0 3 0x4000082 thrsleep syz-fuzzer 37599 331318 44353 0 3 0x4000082 thrsleep syz-fuzzer 37599 412647 44353 0 3 0x4000082 thrsleep syz-fuzzer 37599 186111 44353 0 3 0x4000082 thrsleep syz-fuzzer 44353 339087 97293 0 3 0x10008a pause ksh 97293 65630 84715 0 2 0x12 sshd 83924 471434 1 0 3 0x100083 ttyin getty 84715 67069 1 0 3 0x80 select sshd 27848 364034 96227 74 3 0x100092 bpf pflogd 96227 292705 1 0 3 0x80 netio pflogd 50694 85574 2208 73 3 0x100090 kqread syslogd 2208 126301 1 0 3 0x100082 netio syslogd 61147 103447 1 77 3 0x100090 poll dhclient 52462 422641 1 0 3 0x80 poll dhclient 54122 334365 0 0 3 0x14200 bored smr 61911 82131 0 0 3 0x14200 pgzero zerothread 14478 481264 0 0 3 0x14200 aiodoned aiodoned 68123 189470 0 0 3 0x14200 syncer update 56575 122151 0 0 3 0x14200 cleaner cleaner 19571 87183 0 0 3 0x14200 reaper reaper 56469 87028 0 0 3 0x14200 pgdaemon pagedaemon 96435 328613 0 0 3 0x14200 bored crynlk 51960 147427 0 0 3 0x14200 bored crypto 12495 336590 0 0 3 0x40014200 acpi0 acpi0 42706 240074 0 0 3 0x40014200 idle1 17022 247625 0 0 3 0x14200 bored softnet 72080 338834 0 0 2 0x14200 systqmp 56679 63539 0 0 3 0x14200 bored systq 36167 118984 0 0 3 0x40014200 bored softclock 42855 120201 0 0 3 0x40014200 idle0 1 366731 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 37599 (syz-fuzzer) thread 0xffff800020e4deb0 (240600) exclusive rwlock netlock r = 0 (0xffffffff82716f68) #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 9494 6409K 6672K 78643K 10745 0 pcb 13 8K 8K 78643K 33 0 rtable 125 8K 9K 78643K 325 0 ifaddr 62 13K 13K 78643K 89 0 counters 43 33K 34K 78643K 45 0 ioctlops 0 0K 4K 78643K 1505 0 iov 0 0K 12K 78643K 14 0 mount 1 1K 1K 78643K 1 0 vnodes 1220 77K 77K 78643K 1277 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 0K 78643K 42 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1824 197K 290K 78643K 13058 0 file desc 4 9K 25K 78643K 155 0 sigio 0 0K 0K 78643K 5 0 proc 60 63K 83K 78643K 452 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 14 0 in_multi 33 2K 2K 78643K 60 0 ether_multi 1 0K 0K 78643K 3 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 43 201K 201K 78643K 43 0 exec 0 0K 1K 78643K 209 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 159 25K 26K 78643K 1486 0 UVM aobj 7 2K 2K 78643K 7 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 14 0 NDP 9 0K 0K 78643K 19 0 temp 87 3855K 3921K 78643K 3774 0 kqueue 3 4K 6K 78643K 5 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 6 0 0 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 25 0 23 1 0 1 1 0 8 0 rtentry 112 59 0 15 2 0 2 2 0 8 0 unpcb 120 84 0 74 1 0 1 1 0 8 0 syncache 264 5 0 5 2 2 0 1 0 8 0 tcpqe 32 40 0 40 1 1 0 1 0 8 0 tcpcb 544 41 0 37 2 1 1 2 0 8 0 inpcb 296 156 0 149 2 0 2 2 0 8 1 nd6 48 11 0 6 1 0 1 1 0 8 0 pkpcb 40 2 0 2 1 0 1 1 0 8 1 ppxss 1136 1 0 1 1 0 1 1 0 8 1 pffrag 232 2 0 1 1 0 1 1 0 482 0 pffrnode 88 2 0 1 1 0 1 1 0 8 0 pffrent 40 46 0 45 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 35 0 28 1 0 1 1 0 8 0 pfstitem 24 19 0 1 1 0 1 1 0 8 0 pfstkey 112 19 0 1 1 0 1 1 0 8 0 pfstate 328 19 0 1 2 0 2 2 0 8 0 pfrule 1360 30 0 21 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 224 0 46 13 0 13 13 0 8 1 art_table 32 225 0 46 2 0 2 2 0 8 0 art_node 16 56 0 16 1 0 1 1 0 8 0 sysvmsgpl 40 6 0 2 1 0 1 1 0 8 0 semupl 112 3 0 3 1 0 1 1 0 8 1 semapl 112 36 0 26 1 0 1 1 0 8 0 shmpl 112 4 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1579 0 178 88 0 88 88 0 8 0 ffsino 272 1579 0 178 94 0 94 94 0 8 0 nchpl 144 2071 0 461 60 0 60 60 0 8 0 uvmvnodes 72 1661 0 0 31 0 31 31 0 8 0 vnodes 208 1661 0 0 88 0 88 88 0 8 0 namei 1024 5473 0 5473 1 0 1 1 0 8 1 percpumem 16 33 0 1 1 0 1 1 0 8 0 pfiaddrpl 120 14 0 8 1 0 1 1 0 8 0 scxspl 192 5732 0 5732 8 2 6 7 0 8 6 plimitpl 152 21 0 13 1 0 1 1 0 8 0 sigapl 424 391 0 340 6 0 6 6 0 8 0 futexpl 56 1959 0 1959 1 0 1 1 0 8 1 knotepl 112 65 0 45 1 0 1 1 0 8 0 kqueuepl 144 27 0 25 1 0 1 1 0 8 0 pipepl 304 100 0 89 2 0 2 2 0 8 1 fdescpl 496 355 0 340 3 0 3 3 0 8 0 filepl 152 2046 0 1943 5 0 5 5 0 8 1 lockfpl 104 33 0 32 1 0 1 1 0 8 0 lockfspl 48 11 0 10 1 0 1 1 0 8 0 sessionpl 112 18 0 7 1 0 1 1 0 8 0 pgrppl 48 22 0 11 1 0 1 1 0 8 0 ucredpl 96 130 0 121 1 0 1 1 0 8 0 zombiepl 144 340 0 340 1 0 1 1 0 8 1 processpl 992 391 0 340 7 0 7 7 0 8 0 procpl 624 679 0 621 6 0 6 6 0 8 1 sosppl 128 2 0 2 1 1 0 1 0 8 0 sockpl 400 267 0 248 3 0 3 3 0 8 1 mcl64k 65536 7 0 0 1 0 1 1 0 8 0 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl9k 9216 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 9 0 0 2 0 2 2 0 8 0 mcl2k 2048 182 0 0 22 0 22 22 0 8 0 mtagpl 96 15 0 0 1 0 1 1 0 8 0 mbufpl 256 245 0 0 15 0 15 15 0 8 0 bufpl 280 3483 0 131 240 0 240 240 0 8 0 anonpl 16 56055 0 38515 89 1 88 88 0 124 16 amapchunkpl 152 2111 0 1818 18 1 17 17 0 158 4 amappl16 192 1731 0 932 53 0 53 53 0 8 12 amappl15 184 1 0 0 1 0 1 1 0 8 0 amappl14 176 3 0 1 1 0 1 1 0 8 0 amappl13 168 87 0 83 1 0 1 1 0 8 0 amappl12 160 81 0 78 1 0 1 1 0 8 0 amappl11 152 56 0 41 1 0 1 1 0 8 0 amappl10 144 24 0 17 1 0 1 1 0 8 0 amappl9 136 363 0 362 1 0 1 1 0 8 0 amappl8 128 348 0 308 2 0 2 2 0 8 0 amappl7 120 125 0 111 1 0 1 1 0 8 0 amappl6 112 35 0 27 1 0 1 1 0 8 0 amappl5 104 198 0 183 1 0 1 1 0 8 0 amappl4 96 551 0 520 1 0 1 1 0 8 0 amappl3 88 180 0 171 1 0 1 1 0 8 0 amappl2 80 1893 0 1832 2 0 2 2 0 8 0 amappl1 72 18882 0 18462 22 12 10 17 0 8 0 amappl 80 965 0 885 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 6 0 0 1 0 1 1 0 8 0 uaddrrnd 24 355 0 340 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 355 0 340 1 0 1 1 0 8 0 vmmpekpl 168 6724 0 6682 3 0 3 3 0 8 0 vmmpepl 168 51973 0 50074 113 5 108 110 0 357 19 vmsppl 368 354 0 340 2 0 2 2 0 8 0 pdppl 4096 717 0 680 6 0 6 6 0 8 1 pvpl 32 175267 0 154564 207 0 207 207 0 265 37 pmappl 232 354 0 340 2 1 1 2 0 8 0 extentpl 40 53 0 36 1 0 1 1 0 8 0 phpool 112 264 0 4 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(ffffffff82420d55) at panic+0x164 sys/kern/subr_prf.c:218 tcp_output(ffff800000ad8540) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000ad8540) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806eaece18,9,fffffd8068d75e00,0,0,ffff800020e4deb0) at tcp_usrreq+0xa55 sosend(fffffd806eaece18,0,ffff800020e2a9e8,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:555 dofilewritev(ffff800020e4deb0,6,ffff800020e2a9e8,0,ffff800020e2aad0) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020e4deb0,ffff800020e2aa80,ffff800020e2aad0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020e2ab50) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020e2ab50) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0003b93d8, count: -9 ddb{0}> machine ddbcpu 1