summaryrefslogtreecommitdiff
path: root/crypto/api.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-01-07 16:24:15 +1100
committerDavid S. Miller <davem@sunset.davemloft.net>2006-01-09 14:15:58 -0800
commitf0b417f3babd0c640f7a9ebc6a465191a97afebb (patch)
tree1c80405b5d3011a29a2cd9d2d6b2cef647fb6526 /crypto/api.c
parent9046d8a967e9cd5658c500685d0773c314732b82 (diff)
downloadlinux-crypto-f0b417f3babd0c640f7a9ebc6a465191a97afebb.tar.gz
linux-crypto-f0b417f3babd0c640f7a9ebc6a465191a97afebb.zip
[CRYPTO] api: Require block size to be less than PAGE_SIZE/8
The cipher code path may allocate up to two blocks of data on the stack. Therefore we need to place limits on the maximum block size. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--crypto/api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/api.c b/crypto/api.c
index 2715afdf..e26156f7 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -251,7 +251,7 @@ int crypto_register_alg(struct crypto_alg *alg)
if (alg->cra_alignmask & alg->cra_blocksize)
return -EINVAL;
- if (alg->cra_blocksize > PAGE_SIZE)
+ if (alg->cra_blocksize > PAGE_SIZE / 8)
return -EINVAL;
if (alg->cra_priority < 0)