summaryrefslogtreecommitdiffstats
path: root/crypto/hmac.c
diff options
context:
space:
mode:
authorHerbert Xu2019-06-20 08:17:24 +0200
committerHerbert Xu2019-06-20 08:17:24 +0200
commitbdb275bb6486d19888cb669fedd7d3eea2031669 (patch)
treea6d78624f1e8d7a797803636d1d92e6ae584949b /crypto/hmac.c
parentcrypto: sahara - Use devm_platform_ioremap_resource() (diff)
parentcrypto: hmac - fix memory leak in hmac_init_tfm() (diff)
downloadkernel-qcow2-linux-bdb275bb6486d19888cb669fedd7d3eea2031669.tar.gz
kernel-qcow2-linux-bdb275bb6486d19888cb669fedd7d3eea2031669.tar.xz
kernel-qcow2-linux-bdb275bb6486d19888cb669fedd7d3eea2031669.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Merge crypto tree to pick up vmx changes.
Diffstat (limited to 'crypto/hmac.c')
-rw-r--r--crypto/hmac.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/hmac.c b/crypto/hmac.c
index a68c1266121f..ac8c611ee33e 100644
--- a/crypto/hmac.c
+++ b/crypto/hmac.c
@@ -157,6 +157,10 @@ static int hmac_init_tfm(struct crypto_tfm *tfm)
parent->descsize = sizeof(struct shash_desc) +
crypto_shash_descsize(hash);
+ if (WARN_ON(parent->descsize > HASH_MAX_DESCSIZE)) {
+ crypto_free_shash(hash);
+ return -EINVAL;
+ }
ctx->hash = hash;
return 0;