Patch "e1000e: add rtnl_lock() to e1000_reset_task" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    e1000e: add rtnl_lock() to e1000_reset_task

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     e1000e-add-rtnl_lock-to-e1000_reset_task.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d0e80d96c259d927ca7c3e5ad522e7de0925510b
Author: Vitaly Lifshits <vitaly.lifshits@xxxxxxxxx>
Date:   Wed Oct 21 14:59:37 2020 +0300

    e1000e: add rtnl_lock() to e1000_reset_task
    
    [ Upstream commit 21f857f0321d0d0ea9b1a758bd55dc63d1cb2437 ]
    
    A possible race condition was found in e1000_reset_task,
    after discovering a similar issue in igb driver via
    commit 024a8168b749 ("igb: reinit_locked() should be called
    with rtnl_lock").
    
    Added rtnl_lock() and rtnl_unlock() to avoid this.
    
    Fixes: bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver (currently for ICH9 devices only)")
    Suggested-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Vitaly Lifshits <vitaly.lifshits@xxxxxxxxx>
    Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@xxxxxxxxxxxxxxx>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index e9b82c209c2d..a0948002ddf8 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -5974,15 +5974,19 @@ static void e1000_reset_task(struct work_struct *work)
 	struct e1000_adapter *adapter;
 	adapter = container_of(work, struct e1000_adapter, reset_task);
 
+	rtnl_lock();
 	/* don't run the task if already down */
-	if (test_bit(__E1000_DOWN, &adapter->state))
+	if (test_bit(__E1000_DOWN, &adapter->state)) {
+		rtnl_unlock();
 		return;
+	}
 
 	if (!(adapter->flags & FLAG_RESTART_NOW)) {
 		e1000e_dump(adapter);
 		e_err("Reset adapter unexpectedly\n");
 	}
 	e1000e_reinit_locked(adapter);
+	rtnl_unlock();
 }
 
 /**



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux