[ Upstream commit 23e4099bdc3c8381992f9eb975c79196d6755210 ]
I.G 9.7.B for FIPS 140-3 specifies that variables temporarily holding
cryptographic information should be zeroized once they are no longer
needed. Accomplish this by using kfree_sensitive for buffers that
previously held the private key.
Signed-off-by: Hailey Mothershead <hailmo@amazon.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
CVE-2024-42229
(backported from commit 9db8c299a521813630fcb4154298cb60c37f3133 linux-5.10.y)
[bjamison: ignored context conflict from neighboring line that shouldn't
affect fix - missing commit e8cfed5 (crypto: cipher - remove crt_u.cipher
(struct cipher_tfm)), and used kzfree instead of kfree_sensitive - renamed in
commit 453431a (mm, treewide: rename kzfree() to kfree_sensitive())]
Signed-off-by: Bethany Jamison <bethany.jamison@canonical.com>
Acked-by: Thibault Ferrante <thibault.ferrante@canonical.com>
Acked-by: Mehmet Basaran <mehmet.basaran@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>