crypto: algif - zeroize IV buffer
authorStephan Mueller <smueller@chronox.de>
Tue, 11 Nov 2014 04:37:57 +0000 (05:37 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 12 Nov 2014 14:14:31 +0000 (22:14 +0800)
Zeroize the buffer holding the IV used for the completed
cipher operation before the buffer is released by the
skcipher AF_ALG interface handler.

Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algif_skcipher.c

index 83187f497c7c65dddd2248170a50976e568d82e5..85e3bdbe214ccbd4f761206333440a07d6221eba 100644 (file)
@@ -566,6 +566,7 @@ static void skcipher_sock_destruct(struct sock *sk)
        struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(&ctx->req);
 
        skcipher_free_sgl(sk);
+       memzero_explicit(ctx->iv, crypto_ablkcipher_ivsize(tfm));
        sock_kfree_s(sk, ctx->iv, crypto_ablkcipher_ivsize(tfm));
        sock_kfree_s(sk, ctx, ctx->len);
        af_alg_release_parent(sk);