cryptd: Fix uninitialized return value
PATCH 1/1 cryptd: Fix uninitialized return value
If cryptd_alloc_instance() fails, the return value is uninitialized. This patch fixes this by setting the return value.
Signed-off-by Steffen Klassert <[email protected]>
--- crypto/cryptd.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
crypto/cryptd.c +2 -0
@@ -303,6 +303,7 @@ static int cryptd_create_blkcipher(struct crypto_template *tmpl,return PTR_ERR (alg); inst =cryptd_alloc_instance (alg,0 ,sizeof (*ctx)); + err =PTR_ERR (inst);if (IS_ERR (inst)) goto out_put_alg;
@@ -522,6 +523,7 @@ static int cryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb, alg = &salg->base; inst =cryptd_alloc_instance (alg,ahash_instance_headroom (),sizeof (*ctx)); + err =PTR_ERR (inst);if (IS_ERR (inst)) goto out_put_alg;
Signature · 1 line
1.5.4.2
Herbert Xu
maintainerQuoted 4 lines · Steffen Klassert
If
cryptd_alloc_instance()fails, the return value is uninitialized. This patch fixes this by setting the return value.Signed-off-by Steffen Klassert <[email protected]>
Patch applied. Thanks Steffen!
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtHerbert Xu
maintainerQuoted 4 lines · Steffen Klassert
If
cryptd_alloc_instance()fails, the return value is uninitialized. This patch fixes this by setting the return value.Signed-off-by Steffen Klassert <[email protected]>
Just found two similar bugs in xcbc and hmac. I'll fix them up.
Thanks,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt