Skip to contentSkip to conversation

crypto: algif_rng - zeroize buffer with random data

PATCH RESEND Applied Stephan Mueller 2 participants 2 messages Mar 13, 2015 – Mar 16, 2015 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 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.

---
 crypto/algif_rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/algif_rng.c +1 -1
index 67f612c..a346173 100644
@@ -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;
 }
Signature · 1 line
2.1.0
maintainer Applied
#1 lore raw
Quoted 5 lines · Stephan Mueller

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.

Applied.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt