[Intel-wired-lan] [PATCH iwl-net v2 4/6] ice: check ICE_VSI_DOWN under rtnl_lock when preparing for reset

Rout, ChandanX chandanx.rout at intel.com
Thu Aug 8 02:15:17 UTC 2024



>-----Original Message-----
>From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of
>Zaremba, Larysa
>Sent: Wednesday, July 24, 2024 10:19 PM
>To: intel-wired-lan at lists.osuosl.org
>Cc: Drewek, Wojciech <wojciech.drewek at intel.com>; Fijalkowski, Maciej
><maciej.fijalkowski at intel.com>; Jesper Dangaard Brouer <hawk at kernel.org>;
>Daniel Borkmann <daniel at iogearbox.net>; Zaremba, Larysa
><larysa.zaremba at intel.com>; netdev at vger.kernel.org; John Fastabend
><john.fastabend at gmail.com>; Alexei Starovoitov <ast at kernel.org>; linux-
>kernel at vger.kernel.org; Eric Dumazet <edumazet at google.com>; Kubiak,
>Michal <michal.kubiak at intel.com>; Nguyen, Anthony L
><anthony.l.nguyen at intel.com>; Nambiar, Amritha
><amritha.nambiar at intel.com>; Keller, Jacob E <jacob.e.keller at intel.com>;
>Jakub Kicinski <kuba at kernel.org>; bpf at vger.kernel.org; Paolo Abeni
><pabeni at redhat.com>; David S. Miller <davem at davemloft.net>; Karlsson,
>Magnus <magnus.karlsson at intel.com>
>Subject: [Intel-wired-lan] [PATCH iwl-net v2 4/6] ice: check ICE_VSI_DOWN
>under rtnl_lock when preparing for reset
>
>Consider the following scenario:
>
>.ndo_bpf()		| ice_prepare_for_reset()		|
>________________________|_______________________________________|
>rtnl_lock()		|					|
>ice_down()		|					|
>			| test_bit(ICE_VSI_DOWN) - true		|
>			| ice_dis_vsi() returns			|
>ice_up()		|					|
>			| proceeds to rebuild a running VSI	|
>
>.ndo_bpf() is not the only rtnl-locked callback that toggles the interface to apply
>new configuration. Another example is .set_channels().
>
>To avoid the race condition above, act only after reading ICE_VSI_DOWN under
>rtnl_lock.
>
>Fixes: 0f9d5027a749 ("ice: Refactor VSI allocation, deletion and rebuild flow")
>Reviewed-by: Wojciech Drewek <wojciech.drewek at intel.com>
>Signed-off-by: Larysa Zaremba <larysa.zaremba at intel.com>
>---
> drivers/net/ethernet/intel/ice/ice_lib.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>

Tested-by: Chandan Kumar Rout <chandanx.rout at intel.com> (A Contingent Worker at Intel)



More information about the Intel-wired-lan mailing list