mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
macsec: clear encryption keys from the stack after setting up offload
[ Upstream commitaaab73f8fb
] macsec_add_rxsa and macsec_add_txsa copy the key to an on-stack offloading context to pass it to the drivers, but leaves it there when it's done. Clear it with memzero_explicit as soon as it's not needed anymore. Fixes:3cf3227a21
("net: macsec: hardware offloading infrastructure") Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Reviewed-by: Antoine Tenart <atenart@kernel.org> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
f0d1731d95
commit
c1d3a65203
1 changed files with 2 additions and 0 deletions
|
@ -1861,6 +1861,7 @@ static int macsec_add_rxsa(struct sk_buff *skb, struct genl_info *info)
|
|||
secy->key_len);
|
||||
|
||||
err = macsec_offload(ops->mdo_add_rxsa, &ctx);
|
||||
memzero_explicit(ctx.sa.key, secy->key_len);
|
||||
if (err)
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -2103,6 +2104,7 @@ static int macsec_add_txsa(struct sk_buff *skb, struct genl_info *info)
|
|||
secy->key_len);
|
||||
|
||||
err = macsec_offload(ops->mdo_add_txsa, &ctx);
|
||||
memzero_explicit(ctx.sa.key, secy->key_len);
|
||||
if (err)
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue