[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZHCMksmHg5nk0ULX@corigine.com>
Date: Fri, 26 May 2023 12:40:18 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Xin Long <lucien.xin@...il.com>
Cc: network dev <netdev@...r.kernel.org>, davem@...emloft.net,
kuba@...nel.org, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, Thomas Graf <tgraf@...radead.org>,
Alexander Duyck <alexanderduyck@...com>
Subject: Re: [PATCH net 1/3] rtnetlink: move validate_linkmsg into
rtnl_create_link
On Thu, May 25, 2023 at 05:49:15PM -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()")
> Signed-off-by: Xin Long <lucien.xin@...il.com>
Reviewed-by: Simon Horman <simon.horman@...igine.com>
Powered by blists - more mailing lists