From: Antoine Tenart Date: Tue, 8 Nov 2022 15:34:58 +0000 (+0100) Subject: net: phy: mscc: macsec: clear encryption keys when freeing a flow X-Git-Tag: v6.1-rc5~24^2~8^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b16b3fdf675cca15a537572bac50cc5354368fc;p=platform%2Fkernel%2Flinux-starfive.git net: phy: mscc: macsec: clear encryption keys when freeing a flow 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 --- diff --git a/drivers/net/phy/mscc/mscc_macsec.c b/drivers/net/phy/mscc/mscc_macsec.c index ee5b17e..f81b077 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); }