net: tcp: fix CVE-2026-29007 and CVE-2026-29008
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | net: tcp: drop segments with an invalid data offsetnet/ | +13 | 0 replies | |
| 2/2 | net: tcp: check option lengths in tcp_parse_options()net/ | +23 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] net: tcp: fix CVE-2026-29007 and CVE-2026-29008
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(-)
Signature · 1 line
2.43.0