Patch "net: sh_eth: Fix missing rtnl lock in suspend/resume path" has been added to the 5.4-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

    net: sh_eth: Fix missing rtnl lock in suspend/resume path

to the 5.4-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:
     net-sh_eth-fix-missing-rtnl-lock-in-suspend-resume-p.patch
and it can be found in the queue-5.4 subdirectory.

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



commit 7fbac4f7cfedea8e346044ef183b641151f84c6b
Author: Kory Maincent <kory.maincent@xxxxxxxxxxx>
Date:   Wed Jan 29 10:50:47 2025 +0100

    net: sh_eth: Fix missing rtnl lock in suspend/resume path
    
    [ Upstream commit b95102215a8d0987789715ce11c0d4ec031cbfbe ]
    
    Fix the suspend/resume path by ensuring the rtnl lock is held where
    required. Calls to sh_eth_close, sh_eth_open and wol operations must be
    performed under the rtnl lock to prevent conflicts with ongoing ndo
    operations.
    
    Fixes: b71af04676e9 ("sh_eth: add more PM methods")
    Tested-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>
    Reviewed-by: Sergey Shtylyov <s.shtylyov@xxxxxx>
    Signed-off-by: Kory Maincent <kory.maincent@xxxxxxxxxxx>
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 50d85d0372302..f808e60b4ee4f 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -3496,10 +3496,12 @@ static int sh_eth_suspend(struct device *dev)
 
 	netif_device_detach(ndev);
 
+	rtnl_lock();
 	if (mdp->wol_enabled)
 		ret = sh_eth_wol_setup(ndev);
 	else
 		ret = sh_eth_close(ndev);
+	rtnl_unlock();
 
 	return ret;
 }
@@ -3513,10 +3515,12 @@ static int sh_eth_resume(struct device *dev)
 	if (!netif_running(ndev))
 		return 0;
 
+	rtnl_lock();
 	if (mdp->wol_enabled)
 		ret = sh_eth_wol_restore(ndev);
 	else
 		ret = sh_eth_open(ndev);
+	rtnl_unlock();
 
 	if (ret < 0)
 		return ret;




[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