Commit d8c40b9
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: 0f9d502 ("ice: Refactor VSI allocation, deletion and rebuild flow")
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>1 parent f50c687 commit d8c40b9
1 file changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2672 | 2672 | | |
2673 | 2673 | | |
2674 | 2674 | | |
2675 | | - | |
2676 | | - | |
| 2675 | + | |
2677 | 2676 | | |
2678 | 2677 | | |
2679 | 2678 | | |
2680 | 2679 | | |
2681 | 2680 | | |
2682 | 2681 | | |
2683 | 2682 | | |
2684 | | - | |
2685 | | - | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
2686 | 2686 | | |
2687 | 2687 | | |
2688 | 2688 | | |
2689 | | - | |
| 2689 | + | |
2690 | 2690 | | |
2691 | 2691 | | |
2692 | | - | |
| 2692 | + | |
2693 | 2693 | | |
2694 | 2694 | | |
2695 | 2695 | | |
| |||
0 commit comments