netstack: parse quoted IPv6 extension headers by tamird · Pull Request #16096 · google/gvisor · GitHub
Skip to content

netstack: parse quoted IPv6 extension headers - #16096

Open
tamird wants to merge 1 commit into
google:masterfrom
tamird:fix/ipv6-quoted-extension-headers
Open

tamird wants to merge 1 commit into
google:masterfrom
tamird:fix/ipv6-quoted-extension-headers

Conversation

@tamird

@tamird tamird commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

ICMPv6 errors that quoted packets with extension headers could lose
transport error delivery or miss the NAT connection. Control delivery
handled only an immediate fragment header, while conntrack and NAT
assumed the transport header started after the fixed IPv6 header.

Use the existing IPv6 payload iterator to find the transport protocol
and offset, and share that result between control delivery, connection
lookup, and NAT rewriting. Preserve truncated quotes with enough header
bytes, reject incomplete extensions and non-initial fragments, and widen
the iterator's extension-length arithmetic before multiplication.

Regressions cover quoted UDP/TCP NAT errors, direct control delivery,
first and atomic fragments, malformed quotes, long extension headers,
and mutation across buffer views. The affected suites and owning
analyzer and format checks passed on Linux.

@github-actions
github-actions Bot requested review from fvoznika and nybidari October 21, 2026 13:47
@tamird
tamird force-pushed the fix/ipv6-quoted-extension-headers branch from 4913272 to 7a48d5a Compare October 22, 2026 00:19
@EtiennePerot

Copy link
Copy Markdown
Collaborator

@EtiennePerot
EtiennePerot requested a review from nybidari October 25, 2026 04:45
ICMPv6 errors may quote a packet whose transport header follows IPv6
extension headers. Walk the existing payload iterator to find that
header, and share its protocol and offset between control delivery,
conntrack lookup, and NAT rewriting. Accept truncated payloads while
rejecting incomplete extension headers and non-initial fragments.

Widen the iterator's length arithmetic before converting extension
length units to bytes. Preserve the existing IPv4 options policy and
minimum TCP/UDP header requirements.

Cover quoted UDP/TCP NAT errors, first and atomic fragments, malformed
quotes, long extension headers, and mutation across buffer views.
@tamird
tamird force-pushed the fix/ipv6-quoted-extension-headers branch from 7a48d5a to af38f71 Compare October 25, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants