From 7302533aac2df321b76e8a113e5cfa529c825b09 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sat, 7 Jan 2006 16:24:15 +1100 Subject: [PATCH] [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 --- crypto/api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.41.1