Commit 7302533aac2df321b76e8a113e5cfa529c825b09

Authored by Herbert Xu
Committed by David S. Miller
1 parent bcb0ad2b34

[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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -251,7 +251,7 @@
251 251 if (alg->cra_alignmask & alg->cra_blocksize)
252 252 return -EINVAL;
253 253  
254   - if (alg->cra_blocksize > PAGE_SIZE)
  254 + if (alg->cra_blocksize > PAGE_SIZE / 8)
255 255 return -EINVAL;
256 256  
257 257 if (alg->cra_priority < 0)