diff mbox

crypto: algif_rng - zeroize buffer holding random data

Message ID 7837811.JDlpL5zc04@tachyon.chronox.de (mailing list archive)
State Changes Requested
Delegated to: Herbert Xu
Headers show

Commit Message

Stephan Mueller March 11, 2015, 6:45 a.m. UTC
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 <smueller@chronox.de>
---
 crypto/algif_rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

 }

Comments

Herbert Xu March 13, 2015, 10:31 a.m. UTC | #1
On Wed, Mar 11, 2015 at 07:45:35AM +0100, Stephan Mueller wrote:
> 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 <smueller@chronox.de>

Your patch is line-wrapped and doesn't apply.  Please resend.

Thanks,
diff mbox

Patch

diff --git a/crypto/algif_rng.c b/crypto/algif_rng.c
index 67f612c..a346173 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;