From: Leon Romanovsky <leon@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
pabeni@redhat.com
Subject: Re: [PATCH net-next 1/3] net: warn about attempts to register negative ifindex
Date: Tue, 15 Aug 2023 10:02:16 +0300 [thread overview]
Message-ID: <20230815070216.GG22185@unreal> (raw)
In-Reply-To: <20230814205627.2914583-2-kuba@kernel.org>
On Mon, Aug 14, 2023 at 01:56:25PM -0700, Jakub Kicinski wrote:
> Since the xarray changes we mix returning valid ifindex and negative
> errno in a single int returned from dev_index_reserve(). This depends
> on the fact that ifindexes can't be negative. Otherwise we may insert
> into the xarray and return a very large negative value. This in turn
> may break ERR_PTR().
>
> OvS is susceptible to this problem and lacking validation (fix posted
> separately for net).
>
> Reject negative ifindex explicitly. Add a warning because the input
> validation is better handled by the caller.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> Turns out concerns from reviewers that callers may not check bounds on
> ifindex were legit...
> ---
> net/core/dev.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
next prev parent reply other threads:[~2023-08-15 7:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-14 20:56 [PATCH net-next 0/3] net: warn about attempts to register negative ifindex Jakub Kicinski
2023-08-14 20:56 ` [PATCH net-next 1/3] " Jakub Kicinski
2023-08-15 7:02 ` Leon Romanovsky [this message]
2023-08-14 20:56 ` [PATCH net-next 2/3] netlink: specs: add ovs_vport new command Jakub Kicinski
2023-08-15 8:06 ` Donald Hunter
2023-08-14 20:56 ` [PATCH net-next 3/3] tools: ynl: add more info to KeyErrors on missing attrs Jakub Kicinski
2023-08-15 8:15 ` Donald Hunter
2023-08-16 2:40 ` [PATCH net-next 0/3] net: warn about attempts to register negative ifindex patchwork-bot+netdevbpf
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=20230815070216.GG22185@unreal \
--to=leon@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).