From: Eric Biggers <ebiggers@kernel.org>
To: Jeff Barnes <jeffbarnes@linux.microsoft.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
Joachim Vandersmissen <git@jvdsn.com>,
"David S. Miller" <davem@davemloft.net>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
Jeff Barnes <jeffbarnes@microsoft.com>
Subject: Re: [PATCH] crypto: aead: add service indicator flag for RFC4106 AES-GCM
Date: Sat, 14 Mar 2026 12:37:23 -0700 [thread overview]
Message-ID: <20260314193723.GD40504@quark> (raw)
In-Reply-To: <a9e6bf51-1222-4901-b7a9-9d47c0abbac5@linux.microsoft.com>
On Thu, Mar 12, 2026 at 10:00:59AM -0400, Jeff Barnes wrote:
>
>
> On 3/2/26 22:37, Herbert Xu wrote:
> > On Mon, Mar 02, 2026 at 04:51:38PM -0500, Jeff Barnes wrote:
> > >
> > > For instance, ceph, samba, tls, to name a few. They all instantiate the
> > > gcm(aes) template. They all construct their own IV. They are all compliant
> > > to SP 800-38d. I am pretty sure that at least one constructs it per 8.2.2
> > > while the rest construct per 8.2.1.
> >
> > Perhaps they could switch to IV generation in a way that's similar
> > to seqiv?
> Actually, there's no need to do that. They are all compliant already with
> the spec.
>
> The issue according to the CMVP (NIST) is that because the kernel crypto api
> is, well, an api, that it is *possible* to instantiate the gcm(aes) template
> and generate an IV in a non-compliant way. Even when pressing the point that
> the kernel is monolithic, hence self-contained, and booted with
> lockdown=integrity, the point is lost on the certifying body. Their response
> is to implement the service indicator "like all the other distros". That is
> a very unfortunate way of putting it. It is what it is.
>
> So currently, for the kernel (crypto api) to pass FIPS 140-3 certification,
> the only viable solution is to either implement the out-of-tree patch or
> disallow gcm(aes) in FIPS mode. Of the two, the out-of-tree patch is
> expensive but the lesser of the two evils.
>
> I like the idea of automatically switching to seqiv or rfc4106 templates
> when in FIPS mode. The unfortunate consequence is scale. There are 24
> gcm(aes) template instantiations spread out through the kernel tree with
> about as many maintainers. Each of them generate an IV. That seems to me to
> be too large scale.
>
> Please reconsider.
This whole exercise seems awfully silly, given that no code is actually
going to check the CRYPTO_TFM_FIPS_COMPLIANCE flag, either upstream or
downstream. So this is just unused code which exists only to satisfy a
check box for something that FIPS 140 says has to be there but is never
used in practice. While upstream does have limited support for FIPS
140, that limited support tends to be for things which at least actually
do *something*, not completely unused code.
I guess I have to ask, if the theoretical possibility of code calling
'crypto_tfm_get_flags(tfm) & CRYPTO_TFM_FIPS_COMPLIANCE' is sufficient
to count as a service indicator for AES-GCM, is there any reason why the
procedure for retrieving the service indicator can't be something like
'strncmp("seqiv(", crypto_tfm_alg_name(tfm), 6) == 0'? That would
effectively be the same thing, and it wouldn't require any new code.
If that's not enough and your FIPS certification lab will only accept
the solution with unused code, I don't think that's very compatible with
upstream, sorry. Any unused code upstream is going to tend to be
removed, as per the usual kernel development practices.
- Eric
next prev parent reply other threads:[~2026-03-14 19:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-29 21:04 [PATCH] crypto: aead: add service indicator flag for RFC4106 AES-GCM jeffbarnes
2026-01-30 5:10 ` Herbert Xu
2026-02-17 20:59 ` Jeff Barnes
2026-02-28 8:56 ` Herbert Xu
2026-03-01 20:41 ` Joachim Vandersmissen
2026-03-02 12:26 ` Herbert Xu
2026-03-02 21:34 ` Jeff Barnes
2026-03-02 21:51 ` Jeff Barnes
2026-03-03 3:37 ` Herbert Xu
2026-03-12 14:00 ` Jeff Barnes
2026-03-14 19:37 ` Eric Biggers [this message]
2026-03-03 15:14 ` Christoph Hellwig
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=20260314193723.GD40504@quark \
--to=ebiggers@kernel.org \
--cc=davem@davemloft.net \
--cc=git@jvdsn.com \
--cc=herbert@gondor.apana.org.au \
--cc=jeffbarnes@linux.microsoft.com \
--cc=jeffbarnes@microsoft.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@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