Thread View: muc.lists.freebsd.bugs
4 messages
4 total messages
Started by bugzilla-noreply
Fri, 27 Nov 2026 12:24
[Bug 301183] rack: rack_setup_offset_for_rsm() counts the SYN byte, so split TFO maps crash clients on 15.1, 14.5 and 14.4
Author: bugzilla-noreply
Date: Fri, 27 Nov 2026 12:24
Date: Fri, 27 Nov 2026 12:24
101 lines
6028 bytes
6028 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=301183
Bug ID: 301183
Summary: rack: rack_setup_offset_for_rsm() counts the SYN byte,
so split TFO maps crash clients on 15.1, 14.5 and 14.4
Product: Base System
Version: 15.1-RELEASE
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: kern
Assignee: bugs@FreeBSD.org
Reporter: laamalif@proton.me
The RACK stack counts the SYN flag as a socket-buffer
byte when it computes the mbuf offset for the right-hand
piece of a split send map, so a TCP Fast Open client
crashes when a server splits the map holding its SYN and
data. The fix, ff066579fd77 (PR 297006, D61149), landed on
main on November 7, was cherry-picked to stable/15 and
releng/15.2, but not to the supported releases below.
rack_log_output() records a TFO SYN carrying data as one
send map covering the SYN byte plus the payload (releng/15.1
bb03631fe3b7, rack.c:8182-8185 and 8233-8238). A reply
forcing a split of that map makes rack_clone_rsm() keep
RACK_HAS_SYN on the left piece and call
rack_setup_offset_for_rsm(), which unfixed computes
soff = src_rsm->soff + (src_rsm->r_end - src_rsm->r_start);
at rack.c:6841. The SYN byte has no socket-buffer counterpart,
so the walk at 6842 runs one byte past the payload. With a
one-byte TFO payload the walk exits the last mbuf and the
KASSERT at 6846 is compiled out on GENERIC; the re-derivation
stores the NULL sbsndmbuf() returns at 6851-6853; the
m->m_len read at 6854 faults first. The fix skips the SYN
byte when RACK_HAS_SYN is set.
The function is byte-identical on releng/15.1 (bb03631fe3b7,
rack.c:6829-6868), 14.5, 14.4 and stable/14, and the
ff066579fd77 diff applies cleanly to each.
I reproduced the crash with tfo_split_peer.c, attached. It
scripts the server side on a tap(4) interface: the first
connection primes the client's TFO cookie cache, the second
sends one byte inside the SYN and receives the
bare-SYN-with-data reply from the packetdrill script in
PR 297006. On 15.1-RELEASE-p6 GENERIC arm64
(releng/15.1-n283643-95719d8a895b) with tcp_rack loaded,
five runs rebooted the box within seconds of the scripted
reply; SSH died before the program printed anything:
last shows the boots:
boot time Thu Nov 26 23:28
boot time Thu Nov 26 23:03
boot time Thu Nov 26 22:59
boot time Thu Nov 26 22:54
boot time Thu Nov 26 22:45
The same program rebooted the June 29 16.0-CURRENT
GENERIC amd64 build (main-n287061-65251c43415a, pre-fix)
mid-run at 19:07, no panic text captured either.
The reproducer builds and runs as:
cc -Wall -Wextra -Werror -o tfo_split_peer tfo_split_peer.c
./tfo_split_peer
On the fixed kernel, a GENERIC-KASAN build of the
November 22 main tip (main-6edecf52def6), four runs
printed the control then completed the exchange:
CONTROL-OK
trigger: SYN seq=1751611167 with 1 data byte (valid cookie)
trigger: post-bare-SYN frame flags 0x02 seq 1751611168 ack 0 data 0
SPLIT-NO-CRASH
An earlier build with a no-data trigger variant left the
connection silent and never called rack_clone_rsm() under
dtrace; the attached program carries only the 42-byte
trigger. The panic text went to the serial console these
VMs hold in the kernel, and neither accepts a crash dump,
so I have no trap frame; the CURRENT panic messages are
in PR 297006. The fix
needs no new code: please MFC ff066579fd77 to releng/15.1,
14.5 and 14.4. I have not run the trigger on 14.5, 14.4 or stable/14,
and I have not built or booted the attached fix on 15.1;
the fixed-kernel runs were on 16.0-CURRENT, not a
supported release.
--
You are receiving this mail because:
You are the assignee for the bug.
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
[Bug 301183] rack: rack_setup_offset_for_rsm() counts the SYN byte, so split TFO maps crash clients on 15.1, 14.5 and 14.4
Author: bugzilla-noreply
Date: Fri, 27 Nov 2026 12:24
Date: Fri, 27 Nov 2026 12:24
18 lines
2589 bytes
2589 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=301183 --- Comment #1 from laamalif@proton.me --- Created attachment 277798 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=277798&action=edit the ff066579fd77 fix, byte-identical to the upstream commit, applies cleanly to releng/15.1, 14.5, 14.4 and stable/14 -- You are receiving this mail because: You are the assignee for the bug. -- Posted automagically by a mail2news gateway at muc.de e.V. Please direct questions, flames, donations, etc. to news-admin@muc.de
[Bug 301183] rack: rack_setup_offset_for_rsm() counts the SYN byte, so split TFO maps crash clients on 15.1, 14.5 and 14.4
Author: bugzilla-noreply
Date: Fri, 27 Nov 2026 12:24
Date: Fri, 27 Nov 2026 12:24
18 lines
2662 bytes
2662 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=301183 --- Comment #2 from laamalif@proton.me --- Created attachment 277799 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=277799&action=edit reproducer: tap(4)-based TFO cookie-priming control connection then the one-data-byte SYN with the bare-SYN reply; CONTROL-OK / SPLIT-NO-CRASH verdicts, exit 0 on a fixed kernel -- You are receiving this mail because: You are the assignee for the bug. -- Posted automagically by a mail2news gateway at muc.de e.V. Please direct questions, flames, donations, etc. to news-admin@muc.de
[Bug 301183] rack: rack_setup_offset_for_rsm() counts the SYN byte, so split TFO maps crash clients on 15.1, 14.5 and 14.4
Author: bugzilla-noreply
Date: Fri, 27 Nov 2026 16:02
Date: Fri, 27 Nov 2026 16:02
16 lines
2572 bytes
2572 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=301183
Mark Linimon <linimon@FreeBSD.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|bugs@FreeBSD.org |net@FreeBSD.org
--
You are receiving this mail because:
You are the assignee for the bug.
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads