From: Harald Freudenberger <freude@linux.ibm.com>
To: Holger Dengler <dengler@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
ifranzki@linux.ibm.com
Subject: Re: [PATCH v1 1/2] s390/zcrypt: Validate length for CCA AES cipher key requests
Date: Wed, 29 Jul 2026 12:10:55 +0200 [thread overview]
Message-ID: <c5a4def0a6cadeaf3f1d2c169765c8a2@linux.ibm.com> (raw)
In-Reply-To: <20260729093616.4184642-2-dengler@linux.ibm.com>
On 2026-07-29 11:36, Holger Dengler wrote:
> cca_cipher2protkey() derives the copy length for the CPRB parameter
> block directly from the length field in the key token. Reject the
> request early if the token length exceeds the available space in the
> parameter block.
>
> Fixes: 4bc123b18ce6 ("s390/zcrypt: Add low level functions for CCA AES
> cipher keys")
> Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
> Cc: stable@vger.kernel.org # 5.4+
> ---
> drivers/s390/crypto/zcrypt_ccamisc.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/s390/crypto/zcrypt_ccamisc.c
> b/drivers/s390/crypto/zcrypt_ccamisc.c
> index 84936a795b95..db6a4211a97e 100644
> --- a/drivers/s390/crypto/zcrypt_ccamisc.c
> +++ b/drivers/s390/crypto/zcrypt_ccamisc.c
> @@ -1261,6 +1261,9 @@ int cca_cipher2protkey(u16 cardnr, u16 domain,
> const u8 *ckey,
> } __packed * prepparm;
> int keytoklen = ((struct cipherkeytoken *)ckey)->len;
>
> + if (keytoklen > PARMBSIZE - sizeof(struct aureqparm))
> + return -EINVAL;
> +
> /* get already prepared memory for 2 cprbs with param block each */
> rc = alloc_and_prep_cprbmem(PARMBSIZE, &mem,
> &preqcblk, &prepcblk, xflags);
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
next prev parent reply other threads:[~2026-07-29 10:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 9:36 [PATCH v1 0/2] s390/zcrypt: Validate length in CCA key requests Holger Dengler
2026-07-29 9:36 ` [PATCH v1 1/2] s390/zcrypt: Validate length for CCA AES cipher " Holger Dengler
2026-07-29 9:58 ` sashiko-bot
2026-07-29 11:01 ` Holger Dengler
2026-07-29 10:10 ` Harald Freudenberger [this message]
2026-07-29 9:36 ` [PATCH v1 2/2] s390/zcrypt: Validate length for CCA ECC private " Holger Dengler
2026-07-29 10:10 ` Harald Freudenberger
2026-07-29 10:16 ` sashiko-bot
2026-07-29 11:22 ` Holger Dengler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c5a4def0a6cadeaf3f1d2c169765c8a2@linux.ibm.com \
--to=freude@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=dengler@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=ifranzki@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox