From: sashiko-bot@kernel.org
To: "Harald Freudenberger" <freude@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, "Vasily Gorbik" <gor@linux.ibm.com>,
"Heiko Carstens" <hca@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>
Subject: Re: [PATCH v4 2/7] s390/crypto: Fix missing scrub of temp buffers with PAES algorithm
Date: Wed, 19 Aug 2026 09:30:51 +0000 [thread overview]
Message-ID: <20260819093052.22F411F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260819091734.7331-3-freude@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Incomplete fix: stack buffers containing sensitive user plaintext/ciphertext are left unscrubbed in standard AES functions, identical to the pattern fixed in the PAES functions.
--
--- Patch [2]: [PATCH v4 2/7] s390/crypto: Fix missing scrub of temp buffers with PAES algorithm ---
commit 4d897eecbd2aa1ba90d2105c4cb807323e706e6b
Author: Harald Freudenberger <freude@linux.ibm.com>
s390/crypto: Fix missing scrub of temp buffers with PAES algorithm
This commit explicitly scrubs a stack buffer used to process remaining bytes
in ctr_paes_do_crypt(), and broadens a scrub in __xts_2keys_prep_param() to
clear the entire parameter block. This prevents potentially sensitive data
from being left exposed.
Cc: stable@vger.kernel.org # 6.16+
> diff --git a/arch/s390/crypto/paes_s390.c b/arch/s390/crypto/paes_s390.c
> index ccc7da106c3a0..d075b0241f1f5 100644
> --- a/arch/s390/crypto/paes_s390.c
> +++ b/arch/s390/crypto/paes_s390.c
> @@ -1044,6 +1044,7 @@ static int ctr_paes_do_crypt(struct s390_paes_ctx *ctx,
> }
>
> out:
> + memzero_explicit(buf, sizeof(buf));
[Severity: High]
This isn't a bug introduced by this patch, but does this missing scrub pattern
also need to be fixed in the standard AES functions?
In arch/s390/crypto/aes_s390.c:ctr_aes_crypt(), the buf stack array
is used to process the final block data, but it doesn't appear to be
explicitly zeroed before the function returns:
arch/s390/crypto/aes_s390.c:ctr_aes_crypt() {
...
ret = skcipher_walk_done(&walk, 0);
}
return ret;
}
Similarly, in arch/s390/crypto/aes_s390.c:gcm_aes_crypt(), the gw_in
and gw_out structs contain local buf arrays that store block data
and seem to remain on the stack without being scrubbed:
arch/s390/crypto/aes_s390.c:gcm_aes_crypt() {
...
memzero_explicit(¶m, sizeof(param));
return ret;
}
Could cryptographic operations using ctr(aes) or gcm(aes) with data lengths
not aligned to block boundaries leave unscrubbed plaintext or ciphertext on
the stack, similar to the vulnerability fixed here for PAES?
> pr_debug("rc=%d\n", rc);
> return rc;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260819091734.7331-1-freude@linux.ibm.com?part=2
next prev parent reply other threads:[~2026-08-19 9:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 9:17 [PATCH v4 0/7] Fixes and rework for paes_s390 and phmac_s390 Harald Freudenberger
2026-08-19 9:17 ` [PATCH v4 1/7] s390/crypto: Fix return code handling at skcipher_walk_done in PAES algorithms Harald Freudenberger
2026-08-19 9:31 ` sashiko-bot
2026-08-19 9:17 ` [PATCH v4 2/7] s390/crypto: Fix missing scrub of temp buffers with PAES algorithm Harald Freudenberger
2026-08-19 9:30 ` sashiko-bot [this message]
2026-08-19 9:17 ` [PATCH v4 3/7] s390/crypto: Fix use of mutex in atomic context in PAES Harald Freudenberger
2026-08-19 9:27 ` sashiko-bot
2026-08-19 9:17 ` [PATCH v4 4/7] s390/crypto: Fix missing cra_flags in paes_s390 Harald Freudenberger
2026-08-19 9:22 ` sashiko-bot
2026-08-19 9:17 ` [PATCH v4 5/7] s390/crypto: Fix handling of EBUSY in PAES when req is pushed to crypto engine Harald Freudenberger
2026-08-19 9:30 ` sashiko-bot
2026-08-19 9:47 ` Holger Dengler
2026-08-19 9:17 ` [PATCH v4 6/7] s390/crypto: Fix handling of EBUSY in PHMAC " Harald Freudenberger
2026-08-19 9:37 ` sashiko-bot
2026-08-19 9:17 ` [PATCH v4 7/7] s390/crypto: Fix wrong return code to engine in asynch callbacks Harald Freudenberger
2026-08-19 9:28 ` sashiko-bot
2026-08-19 10:00 ` 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=20260819093052.22F411F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=freude@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.