projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a999a3
)
[CRYPTO] xcbc: Fix algorithm leak when block size check fails
author
Herbert Xu
<herbert@gondor.apana.org.au>
Tue, 1 Jan 2008 04:44:50 +0000
(15:44 +1100)
committer
Herbert Xu
<herbert@gondor.apana.org.au>
Thu, 10 Jan 2008 21:17:00 +0000
(08:17 +1100)
When the underlying algorithm has a block size other than 16 we abort
without freeing it. In fact, we try to return the algorithm itself
as an error!
This patch plugs the leak and makes it return -EINVAL instead.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/xcbc.c
patch
|
blob
|
blame
|
history
diff --git
a/crypto/xcbc.c
b/crypto/xcbc.c
index 789cdeee6b7d65a0bac384d66f3e1233aca6880c..e3d9503a034b5774f0000174b7cec9363f50206e 100644
(file)
--- a/
crypto/xcbc.c
+++ b/
crypto/xcbc.c
@@
-307,7
+307,8
@@
static struct crypto_instance *xcbc_alloc(struct rtattr **tb)
case 16:
break;
default:
- return ERR_PTR(PTR_ERR(alg));
+ inst = ERR_PTR(-EINVAL);
+ goto out_put_alg;
}
inst = crypto_alloc_instance("xcbc", alg);