From: Herbert Xu Date: Tue, 21 Apr 2015 02:46:49 +0000 (+0800) Subject: crypto: rng - Zero seed in crypto_rng_reset X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b617b702da4e922277806f81c411d3051107d462;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Herbert Xu --- 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);