WSL2-Linux-Kernel/drivers/net/ethernet/intel
Larysa Zaremba fa797f4e30 ice: check ICE_VSI_DOWN under rtnl_lock when preparing for reset
[ Upstream commit d8c40b9d3a6cef61eb5a0c58c34a3090ea938d89 ]

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: 0f9d5027a7 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-09-12 11:07:47 +02:00
..
e1000 ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
e1000e e1000e: Fix S0ix residency on corporate systems 2024-07-18 13:07:30 +02:00
fm10k ethernet: use eth_hw_addr_set() instead of ether_addr_copy() 2023-07-27 08:46:59 +02:00
i40e i40e: Fix XDP program unloading while removing the driver 2024-07-18 13:07:37 +02:00
iavf iavf: Fix TC config comparison with existing adapter TC config 2024-05-02 16:24:46 +02:00
ice ice: check ICE_VSI_DOWN under rtnl_lock when preparing for reset 2024-09-12 11:07:47 +02:00
igb igb: Fix not clearing TimeSync interrupts for 82580 2024-09-12 11:07:46 +02:00
igbvf igbvf: Change IGBVF_MIN to allow set rx/tx value between 64 and 80 2023-09-19 12:22:59 +02:00
igc igc: Unlock on error in igc_io_resume() 2024-09-12 11:07:47 +02:00
ixgb ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
ixgbe ixgbe: avoid sleeping allocation in ixgbe_ipsec_vf_add_sa() 2024-04-10 16:19:35 +02:00
ixgbevf ethernet: use eth_hw_addr_set() instead of ether_addr_copy() 2023-07-27 08:46:59 +02:00
Kconfig igc: fix build errors for PTP 2021-09-19 12:20:53 +01:00
Makefile
e100.c e100: Fix possible use after free in e100_xmit_prepare 2022-12-08 11:28:39 +01:00