Skip to content

Commit

Permalink
[CRYPTO] api: Require block size to be less than PAGE_SIZE/8
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jan 9, 2006
1 parent bcb0ad2 commit 7302533
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7302533

Please sign in to comment.