1
0
Fork 0

[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>
hifive-unleashed-5.1
Herbert Xu 2006-01-07 16:24:15 +11:00 committed by David S. Miller
parent bcb0ad2b34
commit 7302533aac
1 changed files with 1 additions and 1 deletions

View File

@ -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)