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 3D0764C6A for ; Mon, 14 Nov 2022 12:50:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CF78C433C1; Mon, 14 Nov 2022 12:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1668430221; bh=6wZbWtX0447m3dqN179O85Iu8PadKz4h4y/HDJ8kDI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OFRHYC3aHcb+d1Fcn2vVUmeq7guccdMTcZi7mK08LmLbNCVWGvAUThcMDlFs1wYsV LKawsq6O9/eka/vqtB/bDkGn2Fxt1TCs2yUM98vbD00SFbi74wCpxWEwXXWjNlsLxj ZzCgQZhwWLGnY2QGwqONIB/aCa+AuG9hnvpJT/K4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Antoine Tenart , Paolo Abeni , Sasha Levin Subject: [PATCH 5.10 44/95] net: phy: mscc: macsec: clear encryption keys when freeing a flow Date: Mon, 14 Nov 2022 13:45:38 +0100 Message-Id: <20221114124444.368316728@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221114124442.530286937@linuxfoundation.org> References: <20221114124442.530286937@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Antoine Tenart [ Upstream commit 1b16b3fdf675cca15a537572bac50cc5354368fc ] Commit aaab73f8fba4 ("macsec: clear encryption keys from the stack after setting up offload") made sure to clean encryption keys from the stack after setting up offloading, but the MSCC PHY driver made a copy, kept it in the flow data and did not clear it when freeing a flow. Fix this. Fixes: 28c5107aa904 ("net: phy: mscc: macsec support") Signed-off-by: Antoine Tenart Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/phy/mscc/mscc_macsec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/phy/mscc/mscc_macsec.c b/drivers/net/phy/mscc/mscc_macsec.c index b7b2521c73fb..c00eef457b85 100644 --- a/drivers/net/phy/mscc/mscc_macsec.c +++ b/drivers/net/phy/mscc/mscc_macsec.c @@ -632,6 +632,7 @@ static void vsc8584_macsec_free_flow(struct vsc8531_private *priv, list_del(&flow->list); clear_bit(flow->index, bitmap); + memzero_explicit(flow->key, sizeof(flow->key)); kfree(flow); } -- 2.35.1