Netdev List
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Hui Peng <benquike@gmail.com>,
	dsahern@kernel.org, idosch@nvidia.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org
Cc: horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ipv6: fix payload_len inflation in ip6_xmit() when IPV6_RTHDRDSTOPTS is set without IPV6_RTHDR
Date: Thu, 24 Sep 2026 13:16:23 +0200	[thread overview]
Message-ID: <dea7ccae-6da8-4ec0-b931-61f865b2ac84@redhat.com> (raw)
In-Reply-To: <20260919210620.3029622-1-benquike@gmail.com>

On 9/19/26 23:06, Hui Peng wrote:
> When ipv6_fixup_options() was introduced to ignore destination options
> before a routing header (opt->dst0opt) unless a routing header
> (opt->srcrt) is also present, rawv6_sendmsg(), udpv6_sendmsg(), and
> inet6_csk_xmit() were updated to normalize `opt` via
> ipv6_fixup_options(), while other callers pass `np->opt` directly into
> ip6_xmit() (such as tcp_v6_send_response(), sctp_v6_xmit(), and
> l2tp_ip6_xmit()).
> 
> In ip6_xmit(), ipv6_push_nfrag_opts() only pushes opt->dst0opt into the
> packet if opt->srcrt is non-NULL. However, ip6_xmit() unconditionally
> adds opt->opt_nflen (which still includes ipv6_optlen(opt->dst0opt) if
> __ipv6_fixup_options() was not called by the caller) to `seg_len` and
> writes `hdr->payload_len = htons(seg_len)`. This causes the transmitted
> IPv6 header's payload_len to exceed the actual packet payload by
> ipv6_optlen(opt->dst0opt), causing receivers to drop the packet as
> truncated.

Are there any in tree call site leading to the above? If so I think
we are better of calling __ipv6_fixup_options() there instead of
adding more conditionals in the fastpath.

/P


      parent reply	other threads:[~2026-09-24 11:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19 21:06 [PATCH] ipv6: fix payload_len inflation in ip6_xmit() when IPV6_RTHDRDSTOPTS is set without IPV6_RTHDR Hui Peng
2026-09-23 15:06 ` netdev-bot+sashiko
2026-09-24 11:16 ` Paolo Abeni [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dea7ccae-6da8-4ec0-b931-61f865b2ac84@redhat.com \
    --to=pabeni@redhat.com \
    --cc=benquike@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox