diff mbox

crypto: AF_ALG: zeroize key data

Message ID 4092638.L73RGXcGnC@tachyon.chronox.de (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Stephan Mueller Dec. 23, 2014, 8:34 a.m. UTC
alg_setkey should zeroize the sensitive data after use.

Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
 crypto/af_alg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Herbert Xu Dec. 25, 2014, 10:46 p.m. UTC | #1
On Tue, Dec 23, 2014 at 09:34:03AM +0100, Stephan Mueller wrote:
> alg_setkey should zeroize the sensitive data after use.
> 
> Signed-off-by: Stephan Mueller <smueller@chronox.de>

Patch applied.
diff mbox

Patch

diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index a8ff3c4..76d739d 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -188,7 +188,7 @@  static int alg_setkey(struct sock *sk, char __user *ukey,
 	err = type->setkey(ask->private, key, keylen);
 
 out:
-	sock_kfree_s(sk, key, keylen);
+	sock_kzfree_s(sk, key, keylen);
 
 	return err;
 }