LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH RESEND] crypto: algif_rng - zeroize buffer with random data
@ 2015-03-13 10:44 Stephan Mueller
  2015-03-16 10:49 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Stephan Mueller @ 2015-03-13 10:44 UTC (permalink / raw)
  To: 'Herbert Xu; +Cc: linux-crypto, 'LKML'

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	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND] crypto: algif_rng - zeroize buffer with random data
  2015-03-13 10:44 [PATCH RESEND] crypto: algif_rng - zeroize buffer with random data Stephan Mueller
@ 2015-03-16 10:49 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2015-03-16 10:49 UTC (permalink / raw)
  To: Stephan Mueller; +Cc: linux-crypto, 'LKML'

On Fri, Mar 13, 2015 at 11:44:07AM +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>

Applied.
-- 
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-16 10:50 UTC | newest]

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).