提交 7302533a 编写于 作者: H Herbert Xu 提交者: David S. Miller

[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: NHerbert Xu <herbert@gondor.apana.org.au>
上级 bcb0ad2b
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册