From: Stephan Mueller Date: Fri, 13 Mar 2015 10:44:07 +0000 (+0100) Subject: crypto: algif_rng - zeroize buffer with random data X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2ef4d5c43de945b7c78454eac63e5f4fe68f82fc;p=openwrt%2Fstaging%2Fblogic.git crypto: algif_rng - zeroize buffer with random data Due to the change to RNGs to always return zero in success case, the RNG interface must zeroize the buffer with the length provided by the caller. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu --- diff --git a/crypto/algif_rng.c b/crypto/algif_rng.c index 67f612cfed97..a34617359cd9 100644 --- a/crypto/algif_rng.c +++ b/crypto/algif_rng.c @@ -87,7 +87,7 @@ static int rng_recvmsg(struct kiocb *unused, struct socket *sock, return genlen; err = memcpy_to_msg(msg, result, len); - memzero_explicit(result, genlen); + memzero_explicit(result, len); return err ? err : len; }