All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: algif_rng - zeroize buffer holding random data
@ 2015-03-11  6:45 Stephan Mueller
  2015-03-13 10:31 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Stephan Mueller @ 2015-03-11  6:45 UTC (permalink / raw)
  To: 'Herbert Xu; +Cc: linux-kernel, linux-crypto

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(-)

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;
 }
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: algif_rng - zeroize buffer holding random data
  2015-03-11  6:45 [PATCH] crypto: algif_rng - zeroize buffer holding random data Stephan Mueller
@ 2015-03-13 10:31 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2015-03-13 10:31 UTC (permalink / raw)
  To: Stephan Mueller; +Cc: linux-kernel, linux-crypto

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,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-13 10:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-11  6:45 [PATCH] crypto: algif_rng - zeroize buffer holding random data Stephan Mueller
2015-03-13 10:31 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.