[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <32cae443-95d2-408d-9864-b4fed172291b@intel.com>
Date: Thu, 21 Nov 2024 12:57:17 -0800
From: Jacob Keller <jacob.e.keller@...el.com>
To: Breno Leitao <leitao@...ian.org>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, "Paolo
Abeni" <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, Michal Kubiak
<michal.kubiak@...el.com>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<kernel-team@...a.com>, Herbert Xu <herbert@...dor.apana.org.au>
Subject: Re: [PATCH net] netpoll: Use rtnl_dereference() for npinfo pointer
access
On 11/21/2024 6:58 AM, Breno Leitao wrote:
> In the __netpoll_setup() function, when accessing the device's npinfo
> pointer, replace rcu_access_pointer() with rtnl_dereference(). This
> change is more appropriate, as suggested by Herbert Xu.
>
> The function is called with the RTNL mutex held, and the pointer is
> being dereferenced later, so, dereference earlier and just reuse the
> pointer for the if/else.
>
> The replacement ensures correct pointer access while maintaining
> the existing locking and RCU semantics of the netpoll subsystem.
>
> Fixes: c75964e40e69 ("netpoll: Use rtnl_dereference() for npinfo pointer access")
> Suggested-by: Herbert Xu <herbert@...dor.apana.org.au>
> Signed-off-by: Breno Leitao <leitao@...ian.org>
> ---
Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
Powered by blists - more mailing lists