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: https://git.stricted.de/?a=commitdiff_plain;h=2ef4d5c43de945b7c78454eac63e5f4fe68f82fc;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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; }