APPLIED: [SRU][J][PATCH] crypto: rsa-pkcs1pad - Use helper to set reqsize

Stefan Bader stefan.bader at canonical.com
Tue Sep 19 15:10:16 UTC 2023


On 15.09.23 10:35, Timo Aaltonen wrote:
> From: Herbert Xu <herbert at gondor.apana.org.au>
> 
> BugLink: https://bugs.launchpad.net/bugs/2034447
> 
> The value of reqsize must only be changed through the helper.
> 
> Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
> (cherry picked from commit 5b11d1a360ea23c80c6d4ec3f5986a788d0a0995)
> Signed-off-by: Timo Aaltonen <timo.aaltonen at canonical.com>
> ---

Applied to jammy:linux/master-prep (for re-spin). Thanks.

-Stefan

>   crypto/rsa-pkcs1pad.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/crypto/rsa-pkcs1pad.c b/crypto/rsa-pkcs1pad.c
> index a4ebbb889274e..e2f4ccbd71dd8 100644
> --- a/crypto/rsa-pkcs1pad.c
> +++ b/crypto/rsa-pkcs1pad.c
> @@ -574,6 +574,10 @@ static int pkcs1pad_init_tfm(struct crypto_akcipher *tfm)
>   		return PTR_ERR(child_tfm);
>   
>   	ctx->child = child_tfm;
> +
> +	akcipher_set_reqsize(tfm, sizeof(struct pkcs1pad_request) +
> +				  crypto_akcipher_reqsize(child_tfm));
> +
>   	return 0;
>   }
>   
> @@ -669,7 +673,6 @@ static int pkcs1pad_create(struct crypto_template *tmpl, struct rtattr **tb)
>   	inst->alg.set_pub_key = pkcs1pad_set_pub_key;
>   	inst->alg.set_priv_key = pkcs1pad_set_priv_key;
>   	inst->alg.max_size = pkcs1pad_get_max_size;
> -	inst->alg.reqsize = sizeof(struct pkcs1pad_request) + rsa_alg->reqsize;
>   
>   	inst->free = pkcs1pad_free;
>   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xE8675DEECBEECEA3.asc
Type: application/pgp-keys
Size: 44613 bytes
Desc: OpenPGP public key
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20230919/bb312518/attachment-0001.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20230919/bb312518/attachment-0001.sig>


More information about the kernel-team mailing list