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>
This commit is contained in:
Herbert Xu 2015-04-21 10:46:49 +08:00
Родитель 654ae152b3
Коммит b617b702da
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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); err = crypto_rng_alg(tfm)->seed(tfm, seed, slen);
kfree(buf); kzfree(buf);
return err; return err;
} }
EXPORT_SYMBOL_GPL(crypto_rng_reset); EXPORT_SYMBOL_GPL(crypto_rng_reset);