Skip to content

Commit

Permalink
net: phy: mscc: macsec: clear encryption keys when freeing a flow
Browse files Browse the repository at this point in the history
[ Upstream commit 1b16b3f ]

Commit aaab73f ("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: 28c5107 ("net: phy: mscc: macsec support")
Signed-off-by: Antoine Tenart <atenart@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
atenart authored and gregkh committed Nov 16, 2022
1 parent 74918e0 commit 6bfb549
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/phy/mscc/mscc_macsec.c
Expand Up @@ -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);
}

Expand Down

0 comments on commit 6bfb549

Please sign in to comment.