From: Lukas Wunner <lukas@wunner.de>
To: Changwei Zou <changwei.zou@canonical.com>
Cc: Martin.Kepplinger-Novakovic@ginzinger.com, davem@davemloft.net,
herbert@gondor.apana.org.au, ignat@linux.win,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
martink@posteo.de
Subject: Re: [PATCH v3] crypto: rsassa-pkcs1 - Align DMA buffer to CRYPTO_DMA_ALIGN
Date: Wed, 29 Jul 2026 22:29:08 +0200 [thread overview]
Message-ID: <ampilDNLebSAhAQA@wunner.de> (raw)
In-Reply-To: <20260729004156.11925-1-changwei.zou@canonical.com>
On Wed, Jul 29, 2026 at 10:41:56AM +1000, Changwei Zou wrote:
> out_buf is used as a DMA buffer for the RSA verification operation.
> If out_buf is not aligned to CRYPTO_DMA_ALIGN, cacheline sharing
> problems (data corruption) would occur on CPUs with DMA-incoherent caches,
> leading to -EKEYREJECTED.
>
> Fix by aligning out_buf to CRYPTO_DMA_ALIGN using PTR_ALIGN(), and
> allocating CRYPTO_DMA_ALIGN - 1 extra bytes in the child_req allocation
> to accommodate the alignment padding as child_reqsize is a variable.
sashiko believes that rsassa_pkcs1_sign() suffers from the same issue
as the _verify() code path:
https://sashiko.dev/#/patchset/20260729004156.11925-1-changwei.zou%40canonical.com
That doesn't seem to be the case right now because the only callers
in the tree (test_sig_one() and keyctl_pkey_e_d_s()) use kmalloc()
or kzalloc() for the destination buffer, which should fulfil the
alignment requirements of the caam hardware.
Thanks,
Lukas
prev parent reply other threads:[~2026-07-29 20:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 0:41 [PATCH v3] crypto: rsassa-pkcs1 - Align DMA buffer to CRYPTO_DMA_ALIGN Changwei Zou
2026-07-29 19:26 ` Lukas Wunner
2026-07-29 23:34 ` Herbert Xu
2026-07-29 20:29 ` Lukas Wunner [this message]
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=ampilDNLebSAhAQA@wunner.de \
--to=lukas@wunner.de \
--cc=Martin.Kepplinger-Novakovic@ginzinger.com \
--cc=changwei.zou@canonical.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=ignat@linux.win \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martink@posteo.de \
/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