Skip to contentSkip to conversation

ixgbevf: fix possible race in the reset subtask

PATCH New Emil Tantilov 2 participants 2 messages May 22, 2018 – May 23, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index 0830411..1e0c5ae 100644
@@ -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();
 }
#1 lore raw

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 subtask

Extend the RTNL lock in ixgbevf_reset_subtask() to protect the state bits check in addition to the call to ixgbevf_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.

---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)