Skip to content

Commit

Permalink
crypto: rng - Zero seed in crypto_rng_reset
Browse files Browse the repository at this point in the history
If we allocate a seed on behalf ot the user in crypto_rng_reset,
we must ensure that it is zeroed afterwards or the RNG may be
compromised.

Reported-by: Stephan Mueller <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Apr 22, 2015
1 parent 654ae15 commit b617b70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int crypto_rng_reset(struct crypto_rng *tfm, const u8 *seed, unsigned int slen)

err = crypto_rng_alg(tfm)->seed(tfm, seed, slen);

kfree(buf);
kzfree(buf);
return err;
}
EXPORT_SYMBOL_GPL(crypto_rng_reset);
Expand Down

0 comments on commit b617b70

Please sign in to comment.