From e811b7a0cfe66ca8e1073e1544c18e600c4e451d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 5 Jun 2025 11:01:00 +0000 Subject: [PATCH] Revert "crypto: ahash - Set default reqsize from ahash_alg" This reverts commit 3a0c8429ab1e47e9156011519abee8d6892e60cb which is commit 9e01aaa1033d6e40f8d7cf4f20931a61ce9e3f04 upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: I29c21260e15c6e3982fe7eccd38330f470fa0167 Signed-off-by: Greg Kroah-Hartman --- crypto/ahash.c | 4 ---- include/crypto/hash.h | 3 --- 2 files changed, 7 deletions(-) diff --git a/crypto/ahash.c b/crypto/ahash.c index 6168f3532f55..709ef0940799 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -427,7 +427,6 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) hash->setkey = ahash_nosetkey; crypto_ahash_set_statesize(hash, alg->halg.statesize); - crypto_ahash_set_reqsize(hash, alg->reqsize); if (tfm->__crt_alg->cra_type != &crypto_ahash_type) return crypto_init_shash_ops_async(tfm); @@ -600,9 +599,6 @@ static int ahash_prepare_alg(struct ahash_alg *alg) if (alg->halg.statesize == 0) return -EINVAL; - if (alg->reqsize && alg->reqsize < alg->halg.statesize) - return -EINVAL; - err = hash_prepare_alg(&alg->halg); if (err) return err; diff --git a/include/crypto/hash.h b/include/crypto/hash.h index 72a0e880287b..6440aab3de44 100644 --- a/include/crypto/hash.h +++ b/include/crypto/hash.h @@ -154,7 +154,6 @@ struct ahash_request { * This is a counterpart to @init_tfm, used to remove * various changes set in @init_tfm. * @clone_tfm: Copy transform into new object, may allocate memory. - * @reqsize: Size of the request context. * @halg: see struct hash_alg_common */ struct ahash_alg { @@ -171,8 +170,6 @@ struct ahash_alg { void (*exit_tfm)(struct crypto_ahash *tfm); int (*clone_tfm)(struct crypto_ahash *dst, struct crypto_ahash *src); - unsigned int reqsize; - struct hash_alg_common halg; };