]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
crypto: gf128mul - Zero memory when freeing multiplication table
authorAlex Cope <alexcope@google.com>
Mon, 14 Nov 2016 19:02:54 +0000 (11:02 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 17 Nov 2016 15:34:59 +0000 (23:34 +0800)
GF(2^128) multiplication tables are typically used for secret
information, so it's a good idea to zero them on free.

Signed-off-by: Alex Cope <alexcope@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/gf128mul.c
include/crypto/gf128mul.h

index 57c85ddbd85214378686af20f13ac6b175d7a1a9..72015fee533deed95aff7e41866472358244682e 100644 (file)
@@ -310,8 +310,8 @@ void gf128mul_free_64k(struct gf128mul_64k *t)
        int i;
 
        for (i = 0; i < 16; i++)
-               kfree(t->t[i]);
-       kfree(t);
+               kzfree(t->t[i]);
+       kzfree(t);
 }
 EXPORT_SYMBOL(gf128mul_free_64k);
 
index b611aa99f9b4ba736ee7a50eb6600a88d06a971b..592d47e565a8b305406ca8e4b8745d0c9715f109 100644 (file)
@@ -177,7 +177,7 @@ void gf128mul_4k_bbe(be128 *a, struct gf128mul_4k *t);
 
 static inline void gf128mul_free_4k(struct gf128mul_4k *t)
 {
-       kfree(t);
+       kzfree(t);
 }