From: Tudor-Dan Ambarus Date: Tue, 3 Apr 2018 06:39:01 +0000 (+0300) Subject: crypto: authencesn - don't leak pointers to authenc keys X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a07fc8dd2bd4f790940c9a5ac3b7fae1e6738800;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git crypto: authencesn - don't leak pointers to authenc keys [ Upstream commit 31545df391d58a3bb60e29b1192644a6f2b5a8dd ] In crypto_authenc_esn_setkey we save pointers to the authenc keys in a local variable of type struct crypto_authenc_keys and we don't zeroize it after use. Fix this and don't leak pointers to the authenc keys. Signed-off-by: Tudor Ambarus Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/crypto/authencesn.c b/crypto/authencesn.c index 0cf5fefdb859..6de852ce4cf8 100644 --- a/crypto/authencesn.c +++ b/crypto/authencesn.c @@ -90,6 +90,7 @@ static int crypto_authenc_esn_setkey(struct crypto_aead *authenc_esn, const u8 * CRYPTO_TFM_RES_MASK); out: + memzero_explicit(&keys, sizeof(keys)); return err; badkey: