All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] net: tcp: fix CVE-2026-29007 and CVE-2026-29008
@ 2026-11-17  8:56 Prasanth R
  2026-11-17  8:56 ` [PATCH 1/2] net: tcp: drop segments with an invalid data offset Prasanth R
  2026-11-17  8:56 ` [PATCH 2/2] net: tcp: check option lengths in tcp_parse_options() Prasanth R
  0 siblings, 2 replies; 3+ messages in thread
From: Prasanth R @ 2026-11-17  8:56 UTC (permalink / raw)
  To: u-boot; +Cc: jerome.forissier, trini, Prasanth R

The legacy TCP stack trusts the data offset and the option lengths of
received segments. A segment whose data offset points past its end
makes tcp_parse_options() read beyond the packet (CVE-2026-29007) and
makes payload_len negative, which reaches memcpy() as a huge size in
TCP_SYN_SENT (CVE-2026-29008). Both were disclosed on this list by
VulnCheck in May; as far as I can see they are not fixed yet.

Patch 1 drops segments whose data offset does not fit. Patch 2 makes
tcp_parse_options() check each option against the option area, which
also fixes a read past the end when the last option byte is
TCP_O_END, and limits the window scale to 14.

Testing: ran tcp_parse_options() and the length handling from main
and from this series under AddressSanitizer with the malformed
segments. Main reads past the packet in all cases; with the series
the segments are dropped or the options ignored.
Also built sandbox on current main and ran ut cmd net_test_wget: no
failures.

I used an AI assistant (Claude) to help write and test these patches;
I reviewed the changes and the results.

Prasanth R (2):
  net: tcp: drop segments with an invalid data offset
  net: tcp: check option lengths in tcp_parse_options()

 net/tcp.c | 56 +++++++++++++++++++++++++++++++++++--------------------
 1 file changed, 36 insertions(+), 20 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-17 13:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17  8:56 [PATCH 0/2] net: tcp: fix CVE-2026-29007 and CVE-2026-29008 Prasanth R
2026-11-17  8:56 ` [PATCH 1/2] net: tcp: drop segments with an invalid data offset Prasanth R
2026-11-17  8:56 ` [PATCH 2/2] net: tcp: check option lengths in tcp_parse_options() Prasanth R

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.