Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Demi Marie Obenour <demiobenour@gmail.com>
Cc: Bartosz Golaszewski <brgl@kernel.org>,
	linux-crypto@vger.kernel.org,
	Herbert Xu <herbert@gondor.apana.org.au>,
	linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Kuldeep Singh <kuldeep.singh@oss.qualcomm.com>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Krzysztof Kozlowski <krzk@kernel.org>
Subject: Re: [PATCH] crypto: qce - Replace with stub driver
Date: Thu, 13 Aug 2026 21:34:48 +0000	[thread overview]
Message-ID: <20260813213448.GB987015@google.com> (raw)
In-Reply-To: <b7e697ee-ce3b-4c81-afb8-00205c2997f3@gmail.com>

On Thu, Aug 13, 2026 at 05:00:28PM -0400, Demi Marie Obenour wrote:
> On 8/13/26 16:10, Eric Biggers wrote:
> > On Thu, Aug 13, 2026 at 03:09:36PM -0400, Demi Marie Obenour wrote:
> >>> SM8650 with the QCE is FIPS 140-2 certified and apparently this makes
> >>> a difference. Don't ask me if that makes sense, I don't claim to understand
> >>> the legal aspects of it.
> >>
> >> That sounds like the kind of thing that would cause someone to use
> >> a worse implementation of cryptographic algorithms 🙂.
> >>
> >> For what it is worth, many common uses of kernel cryptography can't
> >> use the QCE.  This notably applies to the CSPRNG (/dev/urandom etc),
> >> storage encryption, and AF_ALG.  Therefore, I expect that anyone who
> >> needs FIPS 140 compliance with Linux needs to ensure that the software
> >> crypto is certified, as that's what actually gets used in most cases.
> > 
> > Well there's that, and also the Inline Crypto Engine (which is actually
> > being used and is unrelated to QCE) has its own FIPS certification.
> > 
> > Which upstream kernel feature, if any, is QCE being used with?  I have
> > asked this multiple times and still not gotten an answer.
> Historically AF_ALG has been used to access FIPS-certified crypto
> from userspace, but that no longer can be used with QCE.  Most kernel
> features reject CRYPTO_ALG_ASYNC, CRYPTO_ALG_ALLOCATES_MEMORY, or both.
> If I exclude tests and fallback paths of other drivers, that leaves
> crypto/asymmetric_keys/public_key.c (hashing), BPF, MACsec, OpenVPN
> data channel offload, ecryptfs, Ceph, SMB, IPsec, mac802154, TIPC, TLS,
> and crypto/kpp.c.  AF_ALG only allows offload drivers for cbc(paes),
> which QCE doesn't implement.  QCE is broken with IPsec and probably
> some other networking protocols, as it would wind up taking a mutex
> in softirq context.

It's a far more narrow list than even that.  asymmetric_keys uses the
shash API, so it cannot use QCE.  BPF crypto uses the lskcipher API, so
it cannot use QCE.  MACsec uses AES-GCM which QCE driver doesn't have.
OpenVPN uses AES-GCM or ChaCha20Poly1305, neither of which the QCE
driver has.  The non-legacy Ceph protocol uses AES-GCM, which again the
QCE driver doesn't have.  IPsec does decryption in softirq context,
which the QCE driver doesn't support.  QCE driver does not implement kpp
algorithms.  SMB, TIPC, TLS, all usually use AES-GCM as well.  Until
just a couple months ago ksmbd crashed if passed an async algorithm,
which proves it was never used with QCE.  There is really not much left,
maybe ecryptfs AES-CBC file contents encryption?  But even for that the
cra_priority makes it not actually used.

But we are going into the weeds here with trying to theorize some way
the code could theoretically be reached.  It seems it's really just not.
Or at least if there is a use it is not upstream and/or is not actually
the appropriate code to be using.

- Eric

  reply	other threads:[~2026-08-13 21:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31  5:08 [PATCH] crypto: qce - Replace with stub driver Eric Biggers
2026-07-31  5:32 ` Demi Marie Obenour
2026-07-31  7:42 ` Bartosz Golaszewski
2026-07-31  9:06 ` Krzysztof Kozlowski
2026-07-31 10:02   ` Eric Biggers
2026-07-31 18:31   ` Demi Marie Obenour
2026-08-01  9:18     ` Krzysztof Kozlowski
2026-08-01 16:29       ` Eric Biggers
2026-08-01 16:35         ` Krzysztof Kozlowski
2026-08-01 17:12           ` Eric Biggers
2026-08-11 13:42             ` Bartosz Golaszewski
2026-08-11 22:41               ` Eric Biggers
2026-08-12  8:07                 ` Bartosz Golaszewski
2026-08-12 16:33                   ` Demi Marie Obenour
2026-08-13 11:53                     ` Bartosz Golaszewski
2026-08-13 19:09                       ` Demi Marie Obenour
2026-08-13 20:10                         ` Eric Biggers
2026-08-13 21:00                           ` Demi Marie Obenour
2026-08-13 21:34                             ` Eric Biggers [this message]
2026-08-02 22:20 ` Uwe Kleine-König

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=20260813213448.GB987015@google.com \
    --to=ebiggers@kernel.org \
    --cc=brgl@kernel.org \
    --cc=demiobenour@gmail.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=krzk@kernel.org \
    --cc=kuldeep.singh@oss.qualcomm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --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