Message ID | 41f8d44fe2b46ac2e1f0c54e550aa8bffe9e1cf3.1746176535.git.herbert@gondor.apana.org.au |
---|---|
State | New |
Headers | show |
Series | [1/3] crypto: shash - Cap state size to HASH_MAX_DESCSIZE | expand |
diff --git a/crypto/shash.c b/crypto/shash.c index c4a724e55d7a..4f446463340e 100644 --- a/crypto/shash.c +++ b/crypto/shash.c @@ -479,6 +479,8 @@ static int shash_prepare_alg(struct shash_alg *alg) if (alg->descsize > HASH_MAX_DESCSIZE) return -EINVAL; + if (alg->statesize > HASH_MAX_DESCSIZE) + return -EINVAL; return 0; }
Now that all shash algorithms have converted over to the generic export format, limit the shash state size to HASH_MAX_DESCSIZE. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> --- crypto/shash.c | 2 ++ 1 file changed, 2 insertions(+)