summaryrefslogtreecommitdiffstats
path: root/crypto/cryptomgr.c
diff options
context:
space:
mode:
authorHerbert Xu2007-09-28 03:06:11 +0200
committerDavid S. Miller2007-10-11 01:55:45 +0200
commit720a650f8ab3166d32fc5da64961e8d2158b9452 (patch)
tree87676471c8550ec09935982a910bda5454928d92 /crypto/cryptomgr.c
parent[CRYPTO] xts: XTS blockcipher mode implementation without partial blocks (diff)
downloadkernel-qcow2-linux-720a650f8ab3166d32fc5da64961e8d2158b9452.tar.gz
kernel-qcow2-linux-720a650f8ab3166d32fc5da64961e8d2158b9452.tar.xz
kernel-qcow2-linux-720a650f8ab3166d32fc5da64961e8d2158b9452.zip
[CRYPTO] cryptomgr: Fix parsing of recursive algorithms
As Joy Latten points out, inner algorithm parameters will miss the closing bracket which will also cause the outer algorithm to terminate prematurely. This patch fixes that also kills the WARN_ON if the number of parameters exceed the maximum as that is a user error. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/cryptomgr.c')
-rw-r--r--crypto/cryptomgr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/cryptomgr.c b/crypto/cryptomgr.c
index c83884fec5f9..e5e3cf848d42 100644
--- a/crypto/cryptomgr.c
+++ b/crypto/cryptomgr.c
@@ -129,6 +129,7 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval)
}
notnum = 1;
+ p++;
}
len = p - name;
@@ -151,7 +152,7 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval)
param->tb[i + 1] = &param->attrs[i].attr;
i++;
- if (WARN_ON(i >= CRYPTO_MAX_ATTRS))
+ if (i >= CRYPTO_MAX_ATTRS)
goto err_free_param;
if (*p == ')')