[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iKuj-R8Y9GREQ46UROMpRPeHALQr8+TiG959uTj9FxfKw@mail.gmail.com>
Date: Mon, 13 Mar 2023 16:26:37 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Lorenzo Bianconi <lorenzo@...nel.org>
Cc: netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
pabeni@...hat.com, lorenzo.bianconi@...hat.com,
matthieu.baerts@...sares.net
Subject: Re: [PATCH net] veth: rely on rtnl_dereference() instead of on
rcu_dereference() in veth_set_xdp_features()
On Mon, Mar 13, 2023 at 4:08 PM Lorenzo Bianconi <lorenzo@...nel.org> wrote:
>
> Fix the following kernel warning in veth_set_xdp_features routine
> relying on rtnl_dereference() instead of on rcu_dereference():
>
> =============================
> WARNING: suspicious RCU usage
> 6.3.0-rc1-00144-g064d70527aaa #149 Not tainted
> -----------------------------
> drivers/net/veth.c:1265 suspicious rcu_dereference_check() usage!
>
> other info that might help us debug this:
>
> rcu_scheduler_active = 2, debug_locks = 1
> 1 lock held by ip/135:
> (net/core/rtnetlink.c:6172)
>
> Fixes: fccca038f300 ("veth: take into account device reconfiguration for xdp_features flag")
> Suggested-by: Eric Dumazet <edumazet@...gle.com>
> Reported-by: Matthieu Baerts <matthieu.baerts@...sares.net>
> Link: https://lore.kernel.org/netdev/cover.1678364612.git.lorenzo@kernel.org/T/#me4c9d8e985ec7ebee981cfdb5bc5ec651ef4035d
> Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.org>
> ---
Reported-by: syzbot+c3d0d9c42d59ff644ea6@...kaller.appspotmail.com
Reviewed-by: Eric Dumazet <edumazet@...gle.com>
Thanks.
> drivers/net/veth.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> index 293dc3b2c84a..4da74ac27f9a 100644
> --- a/drivers/net/veth.c
> +++ b/drivers/net/veth.c
> @@ -1262,7 +1262,7 @@ static void veth_set_xdp_features(struct net_device *dev)
> struct veth_priv *priv = netdev_priv(dev);
> struct net_device *peer;
>
> - peer = rcu_dereference(priv->peer);
> + peer = rtnl_dereference(priv->peer);
> if (peer && peer->real_num_tx_queues <= dev->real_num_rx_queues) {
> xdp_features_t val = NETDEV_XDP_ACT_BASIC |
> NETDEV_XDP_ACT_REDIRECT |
> --
> 2.39.2
>
Powered by blists - more mailing lists