From: Jakub Kicinski <kuba@kernel.org>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
davem@davemloft.net, Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Thomas Graf <tgraf@infradead.org>,
Alexander Duyck <alexanderduyck@fb.com>
Subject: Re: [PATCH net 1/3] rtnetlink: move validate_linkmsg into rtnl_create_link
Date: Fri, 26 May 2023 20:49:56 -0700 [thread overview]
Message-ID: <20230526204956.4cc0ddf3@kernel.org> (raw)
In-Reply-To: <7fde1eac7583cc93bc5b1cb3b386c522b32a94c9.1685051273.git.lucien.xin@gmail.com>
On Thu, 25 May 2023 17:49:15 -0400 Xin Long wrote:
> In commit 644c7eebbfd5 ("rtnetlink: validate attributes in do_setlink()"),
> it moved validate_linkmsg() from rtnl_setlink() to do_setlink(). However,
> as validate_linkmsg() is also called in __rtnl_newlink(), it caused
> validate_linkmsg() being called twice when running 'ip link set'.
>
> The validate_linkmsg() was introduced by commit 1840bb13c22f5b ("[RTNL]:
> Validate hardware and broadcast address attribute for RTM_NEWLINK") for
> existing links. After adding it in do_setlink(), there's no need to call
> it in __rtnl_newlink().
>
> Instead of deleting it from __rtnl_newlink(), this patch moves it to
> rtnl_create_link() to fix the missing validation for the new created
> links.
>
> Fixes: 644c7eebbfd5 ("rtnetlink: validate attributes in do_setlink()")
I don't see any bug in here, is there one? Or you're just trying
to avoid calling validation twice? I think it's better to validate
twice than validate after some changes have already been applied
by __rtnl_newlink()... If we really care about the double validation
we should pull the validation out of do_setlink(), IMHO.
--
pw-bot: cr
next prev parent reply other threads:[~2023-05-27 3:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-25 21:49 [PATCH net 0/3] rtnetlink: a couple of fixes in linkmsg validation Xin Long
2023-05-25 21:49 ` [PATCH net 1/3] rtnetlink: move validate_linkmsg into rtnl_create_link Xin Long
2023-05-26 10:40 ` Simon Horman
2023-05-27 3:49 ` Jakub Kicinski [this message]
2023-05-27 20:36 ` Xin Long
2023-05-30 1:25 ` Jakub Kicinski
2023-05-25 21:49 ` [PATCH net 2/3] rtnetlink: move IFLA_GSO_ tb check to validate_linkmsg Xin Long
2023-05-26 10:40 ` Simon Horman
2023-05-25 21:49 ` [PATCH net 3/3] rtnetlink: add the missing IFLA_GRO_ tb check in validate_linkmsg Xin Long
2023-05-26 10:41 ` Simon Horman
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=20230526204956.4cc0ddf3@kernel.org \
--to=kuba@kernel.org \
--cc=alexanderduyck@fb.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=lucien.xin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tgraf@infradead.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;
as well as URLs for NNTP newsgroup(s).