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-Tag: v4.17.12~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=296805b12d9df058860fd891c6d418a09399e4f2;p=thirdparty%2Fkernel%2Fstable.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 15f91ddd7f0e4..50b804747e20a 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: