From: Jakub Kicinski <kuba@kernel.org>
To: 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: Fri, 15 May 2026 17:55:22 -0700 [thread overview]
Message-ID: <20260515175522.0aafbfb4@kernel.org> (raw)
In-Reply-To: <20260514035802.1540395-1-tpluszz77@gmail.com>
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?
--
pw-bot: cr
prev parent reply other threads:[~2026-05-16 0:55 UTC|newest]
Thread overview: 2+ 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 [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=20260515175522.0aafbfb4@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tpluszz77@gmail.com \
/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