public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail•com>
To: Jakub Kicinski <kuba@kernel•org>,  Qi Tang <tpluszz77@gmail•com>
Cc: "David S . Miller" <davem@davemloft•net>,
	 David Ahern <dsahern@kernel•org>,
	 Eric Dumazet <edumazet@google•com>,
	 Paolo Abeni <pabeni@redhat•com>,
	 Simon Horman <horms@kernel•org>,
	 netdev@vger•kernel.org,  linux-kernel@vger•kernel.org
Subject: Re: [PATCH net v4] ipv6: validate extension header length before copying to cmsg
Date: Sat, 16 May 2026 09:41:07 -0400	[thread overview]
Message-ID: <willemdebruijn.kernel.1c02e791312d@gmail.com> (raw)
In-Reply-To: <20260515175522.0aafbfb4@kernel.org>

Jakub Kicinski wrote:
> On Thu, 14 May 2026 11:58:02 +0800 Qi Tang wrote:
> > +	return (ptr + len <= skb_tail_pointer(skb)) ? len : 0;
> 
> This is probably better written as:
> 
> 	return (len <= skb_tail_pointer(skb) - ptr) ? len : 0;
> 
> ? len can't be too large so unlikely to matter in practice
> but technically ptr + len may overflow and wrap on 32b?

If making changes, also time to replace the open coded offset with
sizeof ipv6_opt_hdr and opt_hdr->hdrlen?

Or perhaps better left for net-next.

  reply	other threads:[~2026-05-16 13:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14  3:58 [PATCH net v4] ipv6: validate extension header length before copying to cmsg Qi Tang
2026-05-16  0:55 ` Jakub Kicinski
2026-05-16 13:41   ` Willem de Bruijn [this message]
2026-05-16 15:31     ` Qi Tang

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=willemdebruijn.kernel.1c02e791312d@gmail.com \
    --to=willemdebruijn.kernel@gmail$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=dsahern@kernel$(echo .)org \
    --cc=edumazet@google$(echo .)com \
    --cc=horms@kernel$(echo .)org \
    --cc=kuba@kernel$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=tpluszz77@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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