From: Herbert Xu Date: Sat, 7 Jan 2006 05:24:15 +0000 (+1100) Subject: [CRYPTO] api: Require block size to be less than PAGE_SIZE/8 X-Git-Tag: v2.6.16-rc1~658^2~17 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=7302533aac2df321b76e8a113e5cfa529c825b09;p=linux-2.6-omap-h63xx.git [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 --- diff --git a/crypto/api.c b/crypto/api.c index 2715afdf678..e26156f7183 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)