]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
crypto: algif - zeroize message digest buffer
authorStephan Mueller <smueller@chronox.de>
Tue, 11 Nov 2014 04:37:07 +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 message digest calculated for the
consumer before the buffer is released by the hash AF_ALG interface
handler.

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

index 850246206b1258a697f83e86c39acc9b0a17f973..f75db4ce48bf11383dc7309e81b81ffa67b3c42d 100644 (file)
@@ -258,6 +258,8 @@ static void hash_sock_destruct(struct sock *sk)
        struct alg_sock *ask = alg_sk(sk);
        struct hash_ctx *ctx = ask->private;
 
+       memzero_explicit(ctx->result,
+                    crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req)));
        sock_kfree_s(sk, ctx->result,
                     crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req)));
        sock_kfree_s(sk, ctx, ctx->len);