netstack: fix forwarded IPv6 checksums by tamird · Pull Request #16095 · google/gvisor · GitHub
Skip to content

netstack: fix forwarded IPv6 checksums - #16095

Open
tamird wants to merge 1 commit into
google:masterfrom
tamird:fix/ipv6-forwarded-checksums
Open

tamird wants to merge 1 commit into
google:masterfrom
tamird:fix/ipv6-forwarded-checksums

Conversation

@tamird

@tamird tamird commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Forwarding IPv6 packets with extension headers could replace valid TCP
and UDP checksums with invalid ones. Software checksum recalculation
used the IPv6 base header's next-header field, which identifies the
first extension rather than the upper-layer protocol.

Build the pseudoheader with the protocol of the matched TCP or UDP
header. Extend the existing masquerade test with hop-by-hop and
destination options, explicitly validate UDP checksums, and cover the
same protocol selection at the packet buffer boundary.

Assisted-by: OpenAI Codex

Forwarded IPv6 TCP and UDP packets with extension headers had their
checksums recalculated using the base header's next-header value. That
field identifies the first extension, so it produced an incorrect
transport pseudoheader checksum.

Use the protocol of the matched transport header when constructing the
pseudoheader. Cover TCP and UDP with hop-by-hop and destination options
at the checksum helper and through forwarding with masquerade. Validate
UDP checksums explicitly in the existing forwarding test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant