Skip to content

Commit

Permalink
crypto: gf128mul - Zero memory when freeing multiplication table
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
alexcope authored and herbertx committed Nov 17, 2016
1 parent b516b88 commit 75aa0a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crypto/gf128mul.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion include/crypto/gf128mul.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit 75aa0a7

Please sign in to comment.