]> git.baikalelectronics.ru Git - kernel.git/commit
macsec: clear encryption keys from the stack after setting up offload
authorSabrina Dubroca <sd@queasysnail.net>
Wed, 2 Nov 2022 21:33:16 +0000 (22:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Nov 2022 10:43:56 +0000 (10:43 +0000)
commit5d6d7cda5f0c6e92f21a110f452d1636fb3b1328
tree1056d292135103ec50d2fb60c614e4c4a2d450fa
parentcbd6d661283dfd47728fb14eb32c2d5f2173deb8
macsec: clear encryption keys from the stack after setting up offload

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: 98e38d6db896 ("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>
drivers/net/macsec.c