panic: tcp_output: template len != hdrlen - optlen Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 377786 9626 0 0x2 0x4000000 1K syz-execprog *230667 40540 0 0x12 0 0 sshd db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff821fea3c) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000a06980) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000a06980) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806eb72648,9,fffffd806f2fd500,0,0,ffff800020ade9d0) at tcp_usrreq+0xa55 sosend(fffffd806eb72648,0,ffff800020acede8,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:549 dofilewritev(ffff800020ade9d0,4,ffff800020acede8,0,ffff800020aceed0) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020ade9d0,ffff800020acee80,ffff800020aceed0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020acef50) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020acef50) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffe5a10, 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(ffffffff821fea3c) at panic+0x15c sys/kern/subr_prf.c:207 tcp_output(ffff800000a06980) at tcp_output+0x2c4b tcp_setpersist sys/netinet/tcp_output.c:1130 [inline] tcp_output(ffff800000a06980) at tcp_output+0x2c4b sys/netinet/tcp_output.c:333 tcp_usrreq(fffffd806eb72648,9,fffffd806f2fd500,0,0,ffff800020ade9d0) at tcp_usrreq+0xa55 sosend(fffffd806eb72648,0,ffff800020acede8,0,0,80) at sosend+0x671 sys/kern/uipc_socket.c:549 dofilewritev(ffff800020ade9d0,4,ffff800020acede8,0,ffff800020aceed0) at dofilewritev+0x1b6 sys/kern/sys_generic.c:365 sys_write(ffff800020ade9d0,ffff800020acee80,ffff800020aceed0) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800020acef50) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800020acef50) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffe5a10, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff800020ace950 rbx 0xffff800020acea00 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81ce63bf kprintf+0x16f r9 0x1 r10 0x48e1bd1501fef8e0 r11 0xfbc2cc64aade41b4 r12 0x3000000008 r13 0xffff800020ace960 r14 0x100 r15 0x1 rip 0xffffffff815a95a8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020ace940 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (sshd) pid=230667 stat=onproc flags process=12 proc=0 pri=24, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff800020ade760,0xffff800020adeec0 process=0xffff800020ac92d8 user=0xffff800020aca000, vmspace=0xfffffd806e9a45c8 estcpu=0, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 88354 456077 9626 0 2 0x2 syz-executor.0 9626 106837 16960 0 3 0x82 nanosleep syz-execprog 9626 152777 16960 0 3 0x4000082 nanosleep syz-execprog 9626 55839 16960 0 3 0x4000082 thrsleep syz-execprog 9626 440374 16960 0 3 0x4000082 thrsleep syz-execprog 9626 377786 16960 0 7 0x4000002 syz-execprog 9626 100025 16960 0 3 0x4000082 thrsleep syz-execprog 9626 516800 16960 0 3 0x4000082 thrsleep syz-execprog 9626 277370 16960 0 3 0x4000082 thrsleep syz-execprog 9626 73057 16960 0 3 0x4000082 thrsleep syz-execprog 9626 119489 16960 0 3 0x4000082 thrsleep syz-execprog 16960 93347 40540 0 3 0x10008a pause ksh *40540 230667 97132 0 7 0x12 sshd 19437 294453 1 0 3 0x100083 ttyin getty 97132 471268 1 0 3 0x80 select sshd 75953 497825 59458 74 3 0x100092 bpf pflogd 59458 135050 1 0 3 0x80 netio pflogd 99472 315724 52448 73 3 0x100090 kqread syslogd 52448 290401 1 0 3 0x100082 netio syslogd 46937 327823 1 77 3 0x100090 poll dhclient 68559 332522 1 0 3 0x80 poll dhclient 80135 363328 0 0 3 0x14200 bored smr 58892 226626 0 0 3 0x14200 pgzero zerothread 36271 18717 0 0 3 0x14200 aiodoned aiodoned 85776 342211 0 0 3 0x14200 syncer update 39827 361724 0 0 3 0x14200 cleaner cleaner 93263 395833 0 0 3 0x14200 reaper reaper 75874 515535 0 0 3 0x14200 pgdaemon pagedaemon 81034 358237 0 0 3 0x14200 bored crynlk 47062 517076 0 0 3 0x14200 bored crypto 32559 240535 0 0 3 0x40014200 acpi0 acpi0 40459 94471 0 0 3 0x40014200 idle1 95085 74653 0 0 3 0x14200 bored softnet 30081 110640 0 0 3 0x14200 bored systqmp 10577 433275 0 0 3 0x14200 bored systq 71708 499505 0 0 3 0x40014200 bored softclock 78837 163174 0 0 3 0x40014200 idle0 1 259369 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 88354 (syz-executor.0) thread 0xffff800020a6c758 (456077) exclusive rrwlock inode r = 0 (0xfffffd806b9e65e8) #0 witness_lock+0x52e sys/kern/subr_witness.c:1164 #1 rw_enter+0x453 sys/kern/kern_rwlock.c:311 #2 rrw_enter+0x88 sys/kern/kern_rwlock.c:462 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #4 vn_lock+0x81 sys/kern/vfs_vnops.c:575 #5 vget+0x1c8 sys/kern/vfs_subr.c:671 #6 ufs_ihashget+0x141 sys/ufs/ufs/ufs_ihash.c:119 #7 ffs_vget+0x74 sys/ufs/ffs/ffs_vfsops.c:1329 #8 ufs_lookup+0x14b7 sys/ufs/ufs/ufs_lookup.c:487 #9 VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 #10 vfs_lookup+0x7a6 sys/kern/vfs_lookup.c:568 #11 namei+0x63c sys/kern/vfs_lookup.c:249 #12 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1860 #13 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] #13 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 #14 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806b9e6098) #0 witness_lock+0x52e sys/kern/subr_witness.c:1164 #1 rw_enter+0x453 sys/kern/kern_rwlock.c:311 #2 rrw_enter+0x88 sys/kern/kern_rwlock.c:462 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #4 vn_lock+0x81 sys/kern/vfs_vnops.c:575 #5 vfs_lookup+0xe6 sys/kern/vfs_lookup.c:419 #6 namei+0x63c sys/kern/vfs_lookup.c:249 #7 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1860 #8 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] #8 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 #9 Xsyscall+0x128 Process 9626 (syz-execprog) thread 0xffff800020adfd50 (377786) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82637780) #0 witness_lock+0x52e sys/kern/subr_witness.c:1164 #1 uvm_map_inentry+0xbe sys/uvm/uvm_map.c:1889 #2 syscall+0x397 mi_syscall sys/sys/syscall_mi.h:81 [inline] #2 syscall+0x397 sys/arch/amd64/amd64/trap.c:570 #3 Xsyscall+0x128 Process 40540 (sshd) thread 0xffff800020ade9d0 (230667) exclusive rwlock netlock r = 0 (0xffffffff8248d648) #0 witness_lock+0x52e sys/kern/subr_witness.c:1164 #1 solock+0x5a sys/kern/uipc_socket2.c:282 #2 sosend+0x559 sys/kern/uipc_socket.c:537 #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 9466 6395K 6395K 78643K 10557 0 pcb 13 8K 8K 78643K 13 0 rtable 83 2K 2K 78643K 163 0 ifaddr 37 9K 9K 78643K 1801 0 counters 41 33K 33K 78643K 41 0 ioctlops 0 0K 4K 78643K 1468 0 mount 1 1K 1K 78643K 1 0 vnodes 1183 74K 75K 78643K 1188 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 1780 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 19 95K 95K 78643K 19 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 78 12K 12K 78643K 2719 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 29 3013K 3077K 78643K 5437 0 kqueue 3 4K 4K 78643K 3 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 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 1796 0 1790 1 0 1 1 0 8 0 nd6 48 3 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 11 0 9 1 0 1 1 0 8 0 pfstkey 112 11 0 9 1 0 1 1 0 8 0 pfstate 328 11 0 9 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 144 0 0 9 0 9 9 0 8 0 art_table 32 145 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 3185 0 1782 46 0 46 46 0 8 0 ffsino 272 3185 0 1782 94 0 94 94 0 8 0 nchpl 144 5173 0 3564 60 0 60 60 0 8 0 uvmvnodes 72 3195 0 0 59 0 59 59 0 8 0 vnodes 208 3195 0 0 169 0 169 169 0 8 0 namei 1024 11175 0 11175 2 1 1 1 0 8 1 percpumem 16 31 0 0 1 0 1 1 0 8 0 scxspl 192 15235 0 15235 10 9 1 7 0 8 1 plimitpl 152 15 0 8 1 0 1 1 0 8 0 sigapl 424 2003 0 1974 4 0 4 4 0 8 0 knotepl 112 39 0 28 1 0 1 1 0 8 0 kqueuepl 144 2 0 0 1 0 1 1 0 8 0 pipelkpl 48 74 0 67 2 1 1 1 0 8 0 pipepl 120 148 0 135 2 1 1 1 0 8 0 fdescpl 496 1988 0 1974 3 0 3 3 0 8 0 filepl 152 4627 0 4569 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 1974 0 1974 2 1 1 1 0 8 1 processpl 960 2003 0 1974 5 1 4 5 0 8 0 procpl 624 2012 0 1974 4 0 4 4 0 8 1 sockpl 400 1842 0 1824 2 0 2 2 0 8 0 mcl4k 4096 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 80 0 0 10 0 10 10 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 135 0 0 6 0 6 6 0 8 0 mbufpl: pool(0xffffffff826426e8:mbufpl): free list modified: page 0xfffffd806f2fd000; item ordinal 0; addr 0xfffffd806f2fd800 (p 0xfffffd807f7c4000); offset 0x0=0x0 pool(mbufpl): free list modified: page 0xfffffd806f2fd000; item ordinal 0; addr 0xfffffd806f2fd800 (p 0xfffffd807f7c4000); offset 0x0=0x0 mbufpl: pool(0xffffffff826426e8:mbufpl): page inconsistency: page 0xfffffd806f2fd000; item ordinal 1; addr 0x8a1c611a100291d8 bufpl 280 5508 0 173 382 0 382 382 0 8 0 anonpl 16 67242 0 64812 16 5 11 13 0 124 0 amapchunkpl 152 2625 0 2537 5 1 4 5 0 158 0 amappl16 192 7308 0 7219 5 0 5 5 0 8 0 amappl15 184 1 0 0 1 0 1 1 0 8 0 amappl14 176 1764 0 1763 2 1 1 1 0 8 0 amappl13 168 21 0 20 2 1 1 1 0 8 0 amappl12 160 9 0 6 2 1 1 1 0 8 0 amappl11 152 72 0 54 1 0 1 1 0 8 0 amappl10 144 19 0 15 1 0 1 1 0 8 0 amappl9 136 232 0 230 1 0 1 1 0 8 0 amappl8 128 271 0 261 1 0 1 1 0 8 0 amappl7 120 119 0 106 1 0 1 1 0 8 0 amappl6 112 20 0 18 3 2 1 1 0 8 0 amappl5 104 127 0 113 1 0 1 1 0 8 0 amappl4 96 2276 0 2245 2 1 1 2 0 8 0 amappl3 88 1874 0 1867 1 0 1 1 0 8 0 amappl2 80 4470 0 4409 3 1 2 3 0 8 0 amappl1 72 29144 0 28719 25 15 10 20 0 8 0 amappl 80 2241 0 2211 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 1988 0 1974 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1988 0 1974 1 0 1 1 0 8 0 vmmpekpl 168 9770 0 9748 2 0 2 2 0 8 0 vmmpepl 168 108166 0 107168 93 42 51 81 0 357 7 vmsppl 368 1987 0 1974 2 0 2 2 0 8 0 pdppl 4096 3984 0 3948 6 0 6 6 0 8 0 pvpl 32 296925 0 291982 121 35 86 115 0 265 44 pmappl 232 1987 0 1974 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