Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7302533a authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller
Browse files

[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: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent bcb0ad2b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -251,7 +251,7 @@ int crypto_register_alg(struct crypto_alg *alg)
	if (alg->cra_alignmask & alg->cra_blocksize)
	if (alg->cra_alignmask & alg->cra_blocksize)
		return -EINVAL;
		return -EINVAL;


	if (alg->cra_blocksize > PAGE_SIZE)
	if (alg->cra_blocksize > PAGE_SIZE / 8)
		return -EINVAL;
		return -EINVAL;


	if (alg->cra_priority < 0)
	if (alg->cra_priority < 0)