Re: [PATCH 2/3] AF_ALG: Drop support for off-CPU cryptography
From: Dominique Martinet
Date: Fri Jul 24 2026 - 12:53:10 EST
Eric Biggers wrote on Fri, Jul 24, 2026 at 09:00:34AM -0700:
> On Sat, Jul 25, 2026 at 12:35:55AM +0900, Dominique Martinet wrote:
> > The tool source is available here:
> > https://github.com/nxp-imx/crypto_af_alg
> > (which now fails with:
> > bind(3, {sa_family=AF_ALG, salg_type="skcipher", salg_feat=0, salg_mask=0, salg_name="tk(cbc(aes))"}, 88) = -1 ENOENT (No such file or directory)
> > )
> >
> >
> > I don't particularily care for the API used as long as we can keep using
> > the hardware key, but as far as I can see there's no alternative API --
> > what's the path forward?
>
> There's no "tk(cbc(aes))" algorithm in the upstream kernel. So, it's
> not possible that this ever worked with upstream. Given that, there's
> no regression in upstream for this program, and it wouldn't be
> appropriate to consider a sysctl knob in upstream at this time.
Bleh, you are correct, it's an NXP patch in
drivers/crypto/caam/caamalg.c that they've been carrying in their
tree(s) since 2018[1] and has apparently never been upstreamed...
[1] https://github.com/nxp-imx/linux-imx/commit/6868c9e49c1854028fb46022daac3b1b10ca2c70
Sorry for not having checked, I was hoping for better.
(I should be used to it by now...)
Regardless of the specific algorithm, most recent SoCs flaunt some
"secure element" or similiar hardware-backed keys (so one wouldn't be
able to decrypt $whatever without running on the specific board it was
intended for); I'm sure _some_ of them are upstream?
(Never used it so not sure if they are reachable from af_alg, but for
example drivers/crypto/ccree/cc_cipher.c talks about hardware key...)
There's not much I can do about the vendor's kernel I'm stuck with, but
that doesn't make having encryption material not accessible to userspace
useless as a concept;
forgetting about the sysctl for now, what are the alternatives API this
kind of implementations could be based on?
I guess I should start looking at how tpm backed encryption works,
some other day, it's getting late here...
Thank you,
--
Dominique Martinet | Asmadeus