>-----Original Message-----
>From: Intel-wired-lan <[email protected]> On Behalf Of
>Zaremba, Larysa
>Sent: Wednesday, July 24, 2024 10:19 PM
>To: [email protected]
>Cc: Drewek, Wojciech <[email protected]>; Fijalkowski, Maciej
><[email protected]>; Jesper Dangaard Brouer <[email protected]>;
>Daniel Borkmann <[email protected]>; Zaremba, Larysa
><[email protected]>; [email protected]; John Fastabend
><[email protected]>; Alexei Starovoitov <[email protected]>; linux-
>[email protected]; Eric Dumazet <[email protected]>; Kubiak,
>Michal <[email protected]>; Nguyen, Anthony L
><[email protected]>; Nambiar, Amritha
><[email protected]>; Keller, Jacob E <[email protected]>;
>Jakub Kicinski <[email protected]>; [email protected]; Paolo Abeni
><[email protected]>; David S. Miller <[email protected]>; Karlsson,
>Magnus <[email protected]>
>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 <[email protected]>
>Signed-off-by: Larysa Zaremba <[email protected]>
>---
> drivers/net/ethernet/intel/ice/ice_lib.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>

Tested-by: Chandan Kumar Rout <[email protected]> (A Contingent Worker at 
Intel)

Reply via email to