From: Eric Biggers <ebiggers@kernel.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org,
sparclinux@vger.kernel.org, linux-s390@vger.kernel.org,
x86@kernel.org, Ard Biesheuvel <ardb@kernel.org>,
"Jason A . Donenfeld " <Jason@zx2c4.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [v2 PATCH 00/13] Architecture-optimized SHA-256 library API
Date: Sun, 27 Apr 2025 05:56:41 -0700 [thread overview]
Message-ID: <20250427125641.GB1161@quark> (raw)
In-Reply-To: <aA4mAlozk3RvxvTe@gondor.apana.org.au>
On Sun, Apr 27, 2025 at 08:41:38PM +0800, Herbert Xu wrote:
> On Sun, Apr 27, 2025 at 05:35:14AM -0700, Eric Biggers wrote:
> >
> > Well, barely a day and you've already ruined my patch series. Now instead of a
> > clean design where the crypto_shash API is built on top of the normal library
> > API (sha256_update() etc.), there's now a special low-level API
> > "sha256_choose_blocks()" just for shash that it's built on top of instead, for
> > no good reason. You're also still pushing your broken BLOCK_HASH_UPDATE_BLOCKS
> > macro that doesn't work with size_t, and putting my name on your broken code
> > that uses it.
>
> Your design is unacceptable because you're forcing the partial block
> handling on shash where it's not needed,
Excuse me? It's the other way around. In my version the partial block handling
is only in the library, not shash. In your version you've forced it into the
shash layer, even though the library does it already. I understand that you've
added support for partial block handling to crypto/shash.c and you want to feel
like your work is useful, but in this case it's not, since the libray has to
handle arbitrary-length inputs anyway.
> just as you're forcing the hardirq support on everything.
If you want crypto_shash to warn on hardirq usage you should just put a
WARN_ON(in_hardirq()) in crypto_shash_*(), which will actually achieve that.
Not add a shash-specific non-hardirq-safe low-level API to the library that can
silently corrupt random tasks' SIMD registers on production systems.
- Eric
next prev parent reply other threads:[~2025-04-27 12:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-27 6:30 [v2 PATCH 00/13] Architecture-optimized SHA-256 library API Herbert Xu
2025-04-27 6:30 ` [v2 PATCH 01/13] crypto: sha256 - support arch-optimized lib and expose through shash Herbert Xu
2025-04-27 6:30 ` [v2 PATCH 02/13] crypto: arm/sha256 - implement library instead of shash Herbert Xu
2025-04-27 6:30 ` [v2 PATCH 03/13] crypto: arm64/sha256 - remove obsolete chunking logic Herbert Xu
2025-04-27 6:30 ` [v2 PATCH 04/13] crypto: arm64/sha256 - implement library instead of shash Herbert Xu
2025-04-27 6:30 ` [v2 PATCH 05/13] crypto: mips/sha256 " Herbert Xu
2025-04-27 6:30 ` [v2 PATCH 06/13] crypto: powerpc/sha256 " Herbert Xu
2025-04-27 6:30 ` [v2 PATCH 07/13] crypto: riscv/sha256 " Herbert Xu
2025-04-27 6:31 ` [v2 PATCH 08/13] crypto: s390/sha256 " Herbert Xu
2025-04-27 6:31 ` [v2 PATCH 09/13] crypto: sparc - move opcodes.h into asm directory Herbert Xu
2025-04-27 6:31 ` [v2 PATCH 10/13] crypto: sparc/sha256 - implement library instead of shash Herbert Xu
2025-04-27 6:31 ` [v2 PATCH 11/13] crypto: x86/sha256 " Herbert Xu
2025-04-27 6:31 ` [v2 PATCH 12/13] crypto: sha256 - remove sha256_base.h Herbert Xu
2025-04-27 6:31 ` [v2 PATCH 13/13] crypto: lib/sha256 - improve function prototypes Herbert Xu
2025-04-27 12:35 ` [v2 PATCH 00/13] Architecture-optimized SHA-256 library API Eric Biggers
2025-04-27 12:41 ` Herbert Xu
2025-04-27 12:56 ` Eric Biggers [this message]
2025-04-27 13:11 ` Eric Biggers
2025-04-27 14:07 ` Herbert Xu
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=20250427125641.GB1161@quark \
--to=ebiggers@kernel.org \
--cc=Jason@zx2c4.com \
--cc=ardb@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=sparclinux@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=x86@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;
as well as URLs for NNTP newsgroup(s).