From: Jakub Kicinski <kuba@kernel.org>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: Donald Hunter <donald.hunter@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Andrew Lunn <andrew@lunn.ch>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 3/4] ethtool: strset: check nla_len overflow before nla_nest_end
Date: Wed, 1 Apr 2026 17:49:56 -0700 [thread overview]
Message-ID: <20260401174956.1e526940@kernel.org> (raw)
In-Reply-To: <aczI7FfIScrKhBGQ@fedora>
On Wed, 1 Apr 2026 07:27:40 +0000 Hangbin Liu wrote:
> On Tue, Mar 31, 2026 at 06:46:37PM -0700, Jakub Kicinski wrote:
> > On Tue, 31 Mar 2026 11:56:13 +0800 Hangbin Liu wrote:
> > > + if (skb_tail_pointer(skb) - (unsigned char *)strings_attr > U16_MAX)
> > > + goto nla_put_failure;
> >
> > bit ugly, let's add a variant of nla_nest_end() which can return
> > an error on overflow (without the warning from patch 4) ?
>
> I was tried to not touch nla_nest_end() as it is used everywhere. But it makes
> sense to me to add a new function to check this. I'm not very good at naming,
> maybe `nla_nest_end_validate()` ? Or any other name if you have?
I was thinking nla_nest_end_check() to match the __must_check
attribute. But I also like nla_nest_end_safe()
_validate() is a little long but anything <=5 chars is fine.
next prev parent reply other threads:[~2026-04-02 0:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 3:56 [PATCH net-next 0/4] ynl/ethtool/netlink: warn nla_len overflow for large string sets Hangbin Liu
2026-03-31 3:56 ` [PATCH net-next 1/4] tools: ynl: ethtool: use doit instead of dumpit for per-device GET Hangbin Liu
2026-04-01 1:50 ` Jakub Kicinski
2026-04-01 7:21 ` Hangbin Liu
2026-04-02 0:51 ` Jakub Kicinski
2026-04-02 1:26 ` Hangbin Liu
2026-03-31 3:56 ` [PATCH net-next 2/4] tools: ynl: ethtool: add --dbg-small-recv option Hangbin Liu
2026-03-31 3:56 ` [PATCH net-next 3/4] ethtool: strset: check nla_len overflow before nla_nest_end Hangbin Liu
2026-04-01 1:46 ` Jakub Kicinski
2026-04-01 7:27 ` Hangbin Liu
2026-04-02 0:49 ` Jakub Kicinski [this message]
2026-04-02 1:30 ` Hangbin Liu
2026-03-31 3:56 ` [PATCH net-next 4/4] netlink: warn on nla_len overflow in nla_nest_end() Hangbin Liu
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=20260401174956.1e526940@kernel.org \
--to=kuba@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuhangbin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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