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 <smuel...@chronox.de>
Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au>
---

 crypto/rng.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/rng.c b/crypto/rng.c
index 055e276..1315505 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);
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to