ixgbevf: fix possible race in the reset subtask
Subsystems (2)
PATCH 1/1 ixgbevf: fix possible race in the reset subtask
Extend the RTNL lock in ixgbevf_reset_subtask() to protect the state bits check in addition to the call to ixgbevf_reinit_locked().
This is to make sure that we get the most up-to-date values for the bits and avoid a possible race when going down.
--- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +4 -2
@@ -3119,15 +3119,17 @@ static void ixgbevf_reset_subtask(struct ixgbevf_adapter *adapter)if (!test_and_clear_bit (__IXGBEVF_RESET_REQUESTED, &adapter->state))return ; +rtnl_lock ();/* If we're already down or resetting, just bail */ if (test_bit (__IXGBEVF_DOWN, &adapter->state) ||test_bit (__IXGBEVF_REMOVING, &adapter->state) || -test_bit (__IXGBEVF_RESETTING, &adapter->state)) +test_bit (__IXGBEVF_RESETTING, &adapter->state)) { +rtnl_unlock ();return ; + } adapter->tx_timeout_count++; -rtnl_lock ();ixgbevf_reinit_locked (adapter);rtnl_unlock (); }
Bowers
PATCH 1/1 ixgbevf: fix possible race in the reset subtask
Quoted 11 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Emil Tantilov
Sent: Tuesday, May 22, 2018 9:19 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH] ixgbevf: fix possible race in the reset subtaskExtend the RTNL lock in
ixgbevf_reset_subtask()to protect the state bits check in addition to the call toixgbevf_reinit_locked().
Quoted 8 lines
This is to make sure that we get the most up-to-date values for the bits and avoid a possible race when going down.
Suggested-by Zhiping du <[email protected]>Signed-off-by Emil Tantilov <[email protected]>--- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)