From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E84DF9E1 for ; Mon, 11 Sep 2023 15:04:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE3B7C433C7; Mon, 11 Sep 2023 15:04:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694444691; bh=gJ2if7JVhd9EzKXdMy2/WvkVlurddx1W3m5R8VRSIQg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J7R8yKAhN7YUw/3wPFMEHMD8POj0rSufyUuYh6x9Fyq7I0X2IXCJYPHsDEK7UNDVb sJb3MhDrYXLv+/2HtR7iAjZGtzRSt0ncMmfyeYgHdnpBPYxs997pp3+gZj5wD6UfuV qgFcepLvFaDKh1u4Q4glCJTaTfTg2o+QS3+0ZJ3g= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Herbert Xu , Giovanni Cabiddu Subject: [PATCH 6.1 080/600] crypto: rsa-pkcs1pad - Use helper to set reqsize Date: Mon, 11 Sep 2023 15:41:53 +0200 Message-ID: <20230911134635.978850494@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230911134633.619970489@linuxfoundation.org> References: <20230911134633.619970489@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Herbert Xu commit 5b11d1a360ea23c80c6d4ec3f5986a788d0a0995 upstream. The value of reqsize must only be changed through the helper. Signed-off-by: Herbert Xu Cc: Giovanni Cabiddu Signed-off-by: Greg Kroah-Hartman --- crypto/rsa-pkcs1pad.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/crypto/rsa-pkcs1pad.c +++ b/crypto/rsa-pkcs1pad.c @@ -575,6 +575,10 @@ static int pkcs1pad_init_tfm(struct cryp return PTR_ERR(child_tfm); ctx->child = child_tfm; + + akcipher_set_reqsize(tfm, sizeof(struct pkcs1pad_request) + + crypto_akcipher_reqsize(child_tfm)); + return 0; } @@ -670,7 +674,6 @@ static int pkcs1pad_create(struct crypto 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;