diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2015-04-21 04:46:49 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-04-22 03:30:21 +0200 |
commit | b617b702da4e922277806f81c411d3051107d462 (patch) | |
tree | 580d9202c8b14f0798c16e14be7beeb5cd08f440 /crypto/rng.c | |
parent | crypto: algif_rng - Remove obsolete const-removal cast (diff) | |
download | linux-b617b702da4e922277806f81c411d3051107d462.tar.xz linux-b617b702da4e922277806f81c411d3051107d462.zip |
crypto: rng - Zero seed in crypto_rng_reset
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 <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/rng.c')
-rw-r--r-- | crypto/rng.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/rng.c b/crypto/rng.c index 055e276427b1..13155058b193 100644 --- a/crypto/rng.c +++ b/crypto/rng.c @@ -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); |