crypto: hash - initializing memory buffer for keys
PATCH 1/1 crypto: hash - initializing memory buffer for keys
"ctx" is uninitialized. To avoid undefined behaviors or memory disclosures, we better initialize it.
Signed-off-by Kangjie Lu <[email protected]>
--- crypto/algif_hash.c | 1 + 1 file changed, 1 insertion(+)
crypto/algif_hash.c +1 -0
@@ -433,6 +433,7 @@ static int hash_accept_parent_nokey(void *private, struct sock *sk) ctx =sock_kmalloc (sk, len,GFP_KERNEL );if (!ctx)return -ENOMEM ; +memset (ctx,0 , len); ctx->result =NULL ; ctx->len = len;
Signature · 1 line
2.17.1
Herbert Xu
maintainerQuoted 4 lines · Kangjie Lu
"ctx" is uninitialized. To avoid undefined behaviors or memory disclosures, we better initialize it.
Signed-off-by Kangjie Lu <[email protected]>
Please be more specific about what undefined behaviours you're referring to.
Cheers,
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