From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: "David C.C.M. Gall" <david.ccm.gall@googlemail.com>,
David Howells <dhowells@redhat.com>,
Lukas Wunner <lukas@wunner.de>, Ignat Korchagin <ignat@linux.win>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
keyrings@vger.kernel.org, linux-crypto@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org
Subject: Re: [PATCH] crypto: pkcs7_verify: use constant-time comparison for digest and signature verification
Date: Fri, 10 Jul 2026 13:56:51 -0400 [thread overview]
Message-ID: <8607c6f25d3bad7601665bc4c4ce528e9f4cabef.camel@HansenPartnership.com> (raw)
In-Reply-To: <alEsSl8i1_FpoU0f@fudgebox>
On Fri, 2026-07-10 at 19:30 +0200, David C.C.M. Gall wrote:
> Replace memcmp() with crypto_memneq() for cryptographic digest and
> signature comparisons to prevent timing side-channel attacks.
>
> crypto/asymmetric_keys/pkcs7_verify.c: PKCS#7 message digest
> comparison during signature verification passes argument pkcs7 and
> attached signatures to pkcs7_digest via pkcs7_verify_one.
> pkcs7_digest utilized memcmp which could leak valid prefix length for
> attached signatures via timing side-channel.
Please explain how this information is usable by an attacker? The
assumption is the attacker sees the module (or whatever is signed) so
the pkcs7 digest is inside the signature in plain text and the digest
of the entity being compared should be computable by any attacker.
Regards,
James
prev parent reply other threads:[~2026-07-10 17:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 17:30 [PATCH] crypto: pkcs7_verify: use constant-time comparison for digest and signature verification David C.C.M. Gall
2026-07-10 17:56 ` James Bottomley [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=8607c6f25d3bad7601665bc4c4ce528e9f4cabef.camel@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=davem@davemloft.net \
--cc=david.ccm.gall@googlemail.com \
--cc=dhowells@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=ignat@linux.win \
--cc=keyrings@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas@wunner.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