panic: tcp_output: template len != hdrlen - optlen Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 57946 63618 0 0x2 0x80 0 syz-execprog *340595 59943 0 0x12 0 1 sshd db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff821de023) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff8000009fb540) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff8000009fb540) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806e965188,9,fffffd806f22d800,0,0,ffff800020ad18c0) at tcp_usrreq+0xa55 sosend(fffffd806e965188,0,ffff800020afb348,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:524 dofilewritev(ffff800020ad18c0,4,ffff800020afb348,0,ffff800020afb430) at dofilewritev+0x1b7 sys/kern/sys_generic.c:364 sys_write(ffff800020ad18c0,ffff800020afb3e0,ffff800020afb430) at sys_write+0x83 sys/kern/sys_generic.c:284 syscall(ffff800020afb4b0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800020afb4b0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffca730, 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(ffffffff821de023) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff8000009fb540) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff8000009fb540) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806e965188,9,fffffd806f22d800,0,0,ffff800020ad18c0) at tcp_usrreq+0xa55 sosend(fffffd806e965188,0,ffff800020afb348,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:524 dofilewritev(ffff800020ad18c0,4,ffff800020afb348,0,ffff800020afb430) at dofilewritev+0x1b7 sys/kern/sys_generic.c:364 sys_write(ffff800020ad18c0,ffff800020afb3e0,ffff800020afb430) at sys_write+0x83 sys/kern/sys_generic.c:284 syscall(ffff800020afb4b0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800020afb4b0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffca730, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff800020afaeb0 rbx 0xffff800020afaf60 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81208dbf kprintf+0x16f r9 0x1 r10 0x3084b40fe6f77e4b r11 0xbdea5bb573591091 r12 0x3000000008 r13 0xffff800020afaec0 r14 0x100 r15 0x1 rip 0xffffffff81d4f1f8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020afaea0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (sshd) pid=340595 stat=onproc flags process=12 proc=0 pri=50, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff800020ad09f0,0xffff800020ad0ef0 process=0xffff800020a9b8c8 user=0xffff800020af6000, vmspace=0xfffffd806e7a6178 estcpu=0, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 83488 417384 63618 0 2 0x2 syz-executor.0 63618 57946 17129 0 7 0x82 syz-execprog 63618 44806 17129 0 2 0x4000002 syz-execprog 63618 33238 17129 0 3 0x4000082 thrsleep syz-execprog 63618 453478 17129 0 3 0x4000082 thrsleep syz-execprog 63618 415482 17129 0 3 0x4000082 thrsleep syz-execprog 63618 412101 17129 0 2 0x4000082 syz-execprog 63618 402468 17129 0 3 0x4000082 thrsleep syz-execprog 63618 115739 17129 0 2 0x4000002 syz-execprog 63618 401935 17129 0 3 0x4000082 thrsleep syz-execprog 17129 179231 59943 0 3 0x10008a pause ksh *59943 340595 28763 0 7 0x12 sshd 50916 11422 1 0 3 0x100083 ttyin getty 28763 105954 1 0 3 0x80 select sshd 73202 95541 25346 74 3 0x100092 bpf pflogd 25346 304294 1 0 3 0x80 netio pflogd 37804 434446 63162 73 3 0x100090 kqread syslogd 63162 42939 1 0 3 0x100082 netio syslogd 43920 153377 1 77 3 0x100090 poll dhclient 27270 11012 1 0 3 0x80 poll dhclient 11856 154410 0 0 3 0x14200 pgzero zerothread 84676 465176 0 0 3 0x14200 aiodoned aiodoned 36261 337071 0 0 3 0x14200 syncer update 32352 177818 0 0 3 0x14200 cleaner cleaner 43219 243067 0 0 3 0x14200 reaper reaper 88027 244479 0 0 3 0x14200 pgdaemon pagedaemon 52147 433674 0 0 3 0x14200 bored crynlk 93348 174785 0 0 3 0x14200 bored crypto 89191 177888 0 0 3 0x40014200 acpi0 acpi0 93827 204436 0 0 3 0x40014200 idle1 1039 510306 0 0 3 0x14200 bored softnet 99252 184625 0 0 3 0x14200 bored systqmp 43519 425360 0 0 3 0x14200 bored systq 80718 148707 0 0 3 0x40014200 bored softclock 27018 33334 0 0 3 0x40014200 idle0 29969 79500 0 0 3 0x14200 bored smr 1 455914 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks CPU 0: exclusive sched_lock &sched_lock r = 0 (0xffffffff8265d420) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 wakeup_n+0x37 sys/kern/kern_synch.c:539 #2 sys___thrwakeup+0xd0 sys/kern/kern_synch.c:741 #3 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] #3 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 #4 Xsyscall+0x128 Process 63618 (syz-execprog) thread 0xffff800020a6f8b8 (115739) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82642030) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 syscall+0x400 mi_syscall sys/sys/syscall_mi.h:83 [inline] #1 syscall+0x400 sys/arch/amd64/amd64/trap.c:555 #2 Xsyscall+0x128 Process 59943 (sshd) thread 0xffff800020ad18c0 (340595) exclusive rwlock netlock r = 0 (0xffffffff824b1238) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 solock+0x5a sys/kern/uipc_socket2.c:282 #2 sosend+0x559 sys/kern/uipc_socket.c:512 #3 dofilewritev+0x1b7 sys/kern/sys_generic.c:364 #4 sys_write+0x83 sys/kern/sys_generic.c:284 #5 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] #5 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 #6 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9465 6395K 6395K 78643K 10556 0 pcb 13 8K 8K 78643K 13 0 rtable 83 2K 2K 78643K 165 0 ifaddr 37 9K 9K 78643K 281 0 counters 39 33K 33K 78643K 39 0 ioctlops 0 0K 4K 78643K 1468 0 mount 1 1K 1K 78643K 1 0 vnodes 1181 74K 74K 78643K 1186 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 1K 78643K 2 0 VM map 2 1K 1K 78643K 2 0 sem 2 0K 0K 78643K 2 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1809 196K 290K 78643K 12766 0 file desc 2 4K 12K 78643K 260 0 proc 59 63K 83K 78643K 398 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 in_multi 22 1K 1K 78643K 22 0 ether_multi 1 0K 0K 78643K 1 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 18 79K 79K 78643K 18 0 exec 0 0K 1K 78643K 197 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 80 12K 12K 78643K 1216 0 UVM aobj 2 2K 2K 78643K 2 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 NDP 5 0K 0K 78643K 7 0 temp 33 3022K 3086K 78643K 3808 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 4 0 0 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 17 0 15 1 0 1 1 0 8 0 rtentry 112 34 0 1 1 0 1 1 0 8 0 unpcb 120 29 0 19 1 0 1 1 0 8 0 syncache 264 5 0 5 2 2 0 1 0 8 0 tcpcb 544 8 0 5 1 0 1 1 0 8 0 inpcb 280 276 0 270 1 0 1 1 0 8 0 nd6 48 2 0 0 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 pfstitem 24 10 0 2 1 0 1 1 0 8 0 pfstkey 112 10 0 2 1 0 1 1 0 8 0 pfstate 328 10 0 2 1 0 1 1 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 167 0 0 11 0 11 11 0 8 0 art_table 32 168 0 0 2 0 2 2 0 8 0 art_node 16 33 0 3 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1666 0 262 46 0 46 46 0 8 0 ffsino 272 1666 0 262 94 0 94 94 0 8 0 nchpl 144 2134 0 523 60 0 60 60 0 8 0 uvmvnodes 72 1676 0 0 31 0 31 31 0 8 0 vnodes 208 1676 0 0 89 0 89 89 0 8 0 namei 1024 5125 0 5125 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 5741 0 5741 8 5 3 7 0 8 3 plimitpl 152 15 0 8 1 0 1 1 0 8 0 sigapl 432 467 0 454 2 0 2 2 0 8 0 knotepl 112 39 0 28 1 0 1 1 0 8 0 kqueuepl 104 2 0 0 1 0 1 1 0 8 0 pipepl 160 148 0 135 3 2 1 1 0 8 0 fdescpl 488 468 0 454 3 0 3 3 0 8 0 filepl 152 1621 0 1563 3 0 3 3 0 8 0 lockfpl 104 5 0 4 1 0 1 1 0 8 0 lockfspl 48 3 0 2 1 0 1 1 0 8 0 sessionpl 112 19 0 9 1 0 1 1 0 8 0 pgrppl 48 19 0 9 1 0 1 1 0 8 0 ucredpl 96 52 0 43 1 0 1 1 0 8 0 zombiepl 144 454 0 454 2 1 1 1 0 8 1 processpl 904 483 0 454 4 0 4 4 0 8 0 procpl 632 491 0 454 4 0 4 4 0 8 0 sockpl 384 322 0 304 2 0 2 2 0 8 0 mcl4k 4096 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 76 0 0 10 0 10 10 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 111 0 0 6 0 6 6 0 8 0 mbufpl: pool(0xffffffff8261e650:mbufpl): free list modified: page 0xfffffd806d737000; item ordinal 0; addr 0xfffffd806d737200 (p 0xfffffd806e22f000); offset 0x0=0x0 pool(mbufpl): free list modified: page 0xfffffd806d737000; item ordinal 0; addr 0xfffffd806d737200 (p 0xfffffd806e22f000); offset 0x0=0x0 mbufpl: pool(0xffffffff8261e650:mbufpl): page inconsistency: page 0xfffffd806d737000; item ordinal 1; addr 0xf709c8dc1f91eb66 bufpl 280 6188 0 1340 347 0 347 347 0 8 0 anonpl 16 29428 0 27136 16 3 13 13 0 125 3 amapchunkpl 152 1038 0 973 5 0 5 5 0 158 2 amappl16 192 1104 0 1025 5 0 5 5 0 8 0 amappl15 184 60 0 56 1 0 1 1 0 8 0 amappl14 176 26 0 23 3 2 1 1 0 8 0 amappl12 160 11 0 9 2 1 1 1 0 8 0 amappl11 152 57 0 41 1 0 1 1 0 8 0 amappl10 144 261 0 258 1 0 1 1 0 8 0 amappl9 136 436 0 433 1 0 1 1 0 8 0 amappl8 128 94 0 84 1 0 1 1 0 8 0 amappl7 120 343 0 331 1 0 1 1 0 8 0 amappl6 112 62 0 54 1 0 1 1 0 8 0 amappl5 104 122 0 109 1 0 1 1 0 8 0 amappl4 96 736 0 710 1 0 1 1 0 8 0 amappl3 88 122 0 115 1 0 1 1 0 8 0 amappl2 80 1442 0 1377 5 2 3 3 0 8 1 amappl1 72 17192 0 16759 27 9 18 21 0 8 8 amappl 80 718 0 690 1 0 1 1 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 1 0 0 1 0 1 1 0 8 0 uaddrrnd 24 468 0 454 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 468 0 454 1 0 1 1 0 8 0 vmmpekpl 168 6674 0 6651 2 0 2 2 0 8 0 vmmpepl 168 43987 0 42967 96 14 82 82 0 357 36 vmsppl 368 467 0 454 2 0 2 2 0 8 0 pdppl 4096 943 0 908 6 0 6 6 0 8 1 pvpl 32 138911 0 134103 120 5 115 115 0 265 75 pmappl 232 467 0 454 1 0 1 1 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 145 0 4 5 0 5 5 0 8 0 ddb{1}>