From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7934D846D; Tue, 11 Mar 2025 15:24:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741706672; cv=none; b=JeAHWP4e/ip/lJKvSWt4z3O01OWm61DJ8ClrCl+CIYmRh8DH1AP6pplEt1Rf8K6bC8yQDnIioasQDxLbS5AC0dDe6v7DymkCpLlS3E1g2i0ARC0DOaXKLWMoGpt0Pi8vWO+p0Vj5RyyTlO3pxJdRG+VrIYaeUWdY1R/DL/YtH2A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741706672; c=relaxed/simple; bh=7wK/mDkuat0x5JK917lw7NLHvrBjU4AhwVKaYWCoCXU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XZcvDr0yJ18LG9wG60zGis9mrJSnN3ls+4j2qGm0hyTXKJTj3+qTkIuXLpXUTuSRwQUmSJMiu5wLL4U+PiBDa5CaRPUd5wfrE18NiwivcP6lQAXUIS0cRcLO9eWx8SsDaA2/vhOaOSq1ft1qnmXQXwlUuN4/Yw5Spm6bSIY4ZQc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qfa1qH1/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qfa1qH1/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03D61C4CEE9; Tue, 11 Mar 2025 15:24:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741706672; bh=7wK/mDkuat0x5JK917lw7NLHvrBjU4AhwVKaYWCoCXU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qfa1qH1/wlyxHV35BjepAhkKhXvwt6zvKBRWiAyqyupoOW1RIpq7muDewOh8mEWjt kYO1041+PbbPPnCnV3ZPqJ8RSvPtAaRHwPNlyPGskfojJJZ2wKgH8zJVhbv8V4YzjS FBt13TH9um4ntl3AP7DR5x8PjVilkShJOvRSmPdQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Sergey Shtylyov , Kory Maincent , Paolo Abeni , Sasha Levin Subject: [PATCH 5.10 110/462] net: sh_eth: Fix missing rtnl lock in suspend/resume path Date: Tue, 11 Mar 2025 15:56:16 +0100 Message-ID: <20250311145802.709965999@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250311145758.343076290@linuxfoundation.org> References: <20250311145758.343076290@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kory Maincent [ 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 Reviewed-by: Sergey Shtylyov Signed-off-by: Kory Maincent Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/renesas/sh_eth.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 8927d59977458..e2019dc3ac563 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -3446,10 +3446,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; } @@ -3463,10 +3465,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; -- 2.39.5