Skip to contentSkip to conversation

Module signing and post-quantum crypto public key algorithms

DISCUSSION David Howells 12 participants 25 messages Jun 13, 2025 – Nov 11, 2025

Subsystems (3)
lore
Share & tools
lore

David Howells

author maintainer
#0 lore raw

Hi,

So we need to do something about the impending quantum-related obsolescence of the RSA signatures that we use for module signing, kexec, BPF signing, IMA and a bunch of other things.

From my point of view, the simplest way would be to implement key verification in the kernel for one (or more) of the available post-quantum algorithms (of which there are at least three), driving this with appropriate changes to the X.509 certificate to indicate that's what we want to use.

The good news is that Stephan Mueller has an implemementation that includes kernel bits that we can use, or, at least, adapt:

https://github.com/smuellerDD/leancrypto/

Note that we only need the signature verification bits. One question, though:
he's done it as a standalone "leancrypto" module, not integrated into crypto/, but should it be integrated into crypto/ or is the standalone fine?

The not so good news, as I understand it, though, is that the X.509 bits are not yet standardised.

However! Not everyone agrees with this. An alternative proposal would rather get the signature verification code out of the kernel entirely. Simo Sorce's proposal, for example, AIUI, is to compile all the hashes we need into the kernel at build time, possibly with a hashed hash list to be loaded later to reduce the amount of uncompressible code in the kernel. If signatures are needed at all, then this should be offloaded to a userspace program (which would also have to be hashed and marked unptraceable and I think unswappable) to do the checking.

I don't think we can dispense with signature checking entirely, though: we need it for third party module loading, quick single-module driver updates and all the non-module checking stuff. If it were to be done in userspace, this might entail an upcall for each signature we want to check - either that, or the kernel has to run a server process that it can delegate checking to.

It's also been suggested that PQ algorithms are really slow. For kernel modules that might not matter too much as we may well not load more than 200 or so during boot - but there are other users that may get used more frequently (IMA, for example).

Now, there's also a possible hybrid approach, if I understand Roberto Sassu's proposal correctly, whereby it caches bundles of hashes obtained from, say, the hashes included in an RPM. These bundles of hashes can be checked by signature generated by the package signing process. This would reduce the PQ overhead to checking a bundle and would also make IMA's measuring easier as the hashes can be added in the right order, rather than being dependent on the order that the binaries are used.

David

#1 lore raw

Hi David,

Quoted 6 lines · David Howells

Hi,

So we need to do something about the impending quantum-related obsolescence of the RSA signatures that we use for module signing, kexec, BPF signing, IMA and a bunch of other things.

Is it that impending? At least for now it seems people are more concerned about quantum-safe TLS, so their communications cannot be decrypted later. But breaking signatures of open source modules probably only makes sense when there is an actual capability to break RSA (or ECDSA)

Quoted 8 lines

From my point of view, the simplest way would be to implement key verification in the kernel for one (or more) of the available post-quantum algorithms (of which there are at least three), driving this with appropriate changes to the X.509 certificate to indicate that's what we want to use.

The good news is that Stephan Mueller has an implemementation that includes kernel bits that we can use, or, at least, adapt:

Quoted 8 lines

https://github.com/smuellerDD/leancrypto/

Note that we only need the signature verification bits. One question, though:
he's done it as a standalone "leancrypto" module, not integrated into crypto/, but should it be integrated into crypto/ or is the standalone fine?

The not so good news, as I understand it, though, is that the X.509 bits are not yet standardised.

Does it matter from a kernel perspective? As far as I remember we just attach the "plain" signature to binary. Or is it about provisioning the key through the keystore?

Quoted 9 lines

However! Not everyone agrees with this. An alternative proposal would rather get the signature verification code out of the kernel entirely. Simo Sorce's proposal, for example, AIUI, is to compile all the hashes we need into the kernel at build time, possibly with a hashed hash list to be loaded later to reduce the amount of uncompressible code in the kernel. If signatures are needed at all, then this should be offloaded to a userspace program (which would also have to be hashed and marked unptraceable and I think unswappable) to do the checking.

Can indeed work for modules, but with our limited deployment of IMA in production with many services even with the current approach we get some complains:
* verification takes too long for some binaries (which were not
stripped for example)
* just hashing the binaries over and over burns some CPU and
actually burns only 1 CPU at a time (stalling it)

We need to consider cases, for example, when a python script calls some binaries via system(3) or similar in a tight loop. Yes, with IMA we would verify only once, but still there are cases, when software updates happen frequently or config management "templates" the binaries, so they change all the time.

Quoted 5 lines

I don't think we can dispense with signature checking entirely, though: we need it for third party module loading, quick single-module driver updates and all the non-module checking stuff. If it were to be done in userspace, this might entail an upcall for each signature we want to check - either that, or the kernel has to run a server process that it can delegate checking to.

Agreed - we should have an in-kernel option

Quoted 4 lines

It's also been suggested that PQ algorithms are really slow. For kernel modules that might not matter too much as we may well not load more than 200 or so during boot - but there are other users that may get used more frequently (IMA, for example).

Yep, mentioned above.

Quoted 8 lines

Now, there's also a possible hybrid approach, if I understand Roberto Sassu's proposal correctly, whereby it caches bundles of hashes obtained from, say, the hashes included in an RPM. These bundles of hashes can be checked by signature generated by the package signing process. This would reduce the PQ overhead to checking a bundle and would also make IMA's measuring easier as the hashes can be added in the right order, rather than being dependent on the order that the binaries are used.

This makes it somewhat similar to UEFI secure boot trusted signature DB, where one can have either a trusted public key to verify the signature or a direct allowlist of hashes

Quoted 2 lines

David

Ignat

author maintainer
#2 lore raw
Quoted 6 lines · Ignat Korchagin
Quoted 2 lines

The not so good news, as I understand it, though, is that the X.509 bits are not yet standardised.

Does it matter from a kernel perspective? As far as I remember we just attach the "plain" signature to binary. Or is it about provisioning the key through the keystore?

PKCS#7 is used for the signatures and X.509 is used to provide the public keys.

David

#3 lore raw
In reply to Ignat Korchagin

Premise: this problem can't be ignored, even if you think Quantum Computers are BS, various government regulations are pushing all commercial entities to require PQ signatures, so we have to deal with this problem.

Quoted 10 lines · Ignat Korchagin

Hi David,

Quoted 6 lines · David Howells

Hi,

So we need to do something about the impending quantum-related obsolescence of the RSA signatures that we use for module signing, kexec, BPF signing, IMA and a bunch of other things.

Quoted 5 lines

Is it that impending? At least for now it seems people are more concerned about quantum-safe TLS, so their communications cannot be decrypted later. But breaking signatures of open source modules probably only makes sense when there is an actual capability to break RSA (or ECDSA)

We do not know when Q-day (or Y2Q if you prefer) will strike, "never" is still a possibility.

But, as a data point, IBM just announced a roadmap for a contraption with 200 error corrected logic qubits.
That is substantial progress, so we cannot assume it will never happen, the risk is too high (it is not me saying this, it is the cryptography community consensus).

In terms of impending, what is pressing businesses at this time is the CNSA 2.0 requirements, which wants software and firmware signatures to transition to PQ algorithm in 2025 (yes this year) with complete phase off of classic signatures by 2030 (it is an aggressive timeline, yes).

This is because a lot of the keys are embedded in HW (think Secure Boot), so you can't wait until *after* you have a machine that can generate forged signatures to protect your software update process.

A Quantum computer capable of breaking RSA == you can load any code in a kernel that uses RSA/ECC signed modules.

Quoted 5 lines

We need to consider cases, for example, when a python script calls some binaries via system(3) or similar in a tight loop. Yes, with IMA we would verify only once, but still there are cases, when software updates happen frequently or config management "templates" the binaries, so they change all the time.

In general, if you care about performance what you want to do is to limit the amount of signatures you have to check to the bare minimum, that is why I proposed to David the use of hashes, where you can have a whole bundle of them and a single signature covering them all. This is paramount for something like IMA if you want to make it usable wrt performance.

Quoted 6 lines
Quoted 5 lines

I don't think we can dispense with signature checking entirely, though: we need it for third party module loading, quick single-module driver updates and all the non-module checking stuff. If it were to be done in userspace, this might entail an upcall for each signature we want to check - either that, or the kernel has to run a server process that it can delegate checking to.

Quoted 8 lines

Agreed - we should have an in-kernel option

Quoted 4 lines

It's also been suggested that PQ algorithms are really slow. For kernel modules that might not matter too much as we may well not load more than 200 or so during boot - but there are other users that may get used more frequently (IMA, for example).

Yep, mentioned above.

Note that PQ algorithms are not all slow, but mostly signatures are large, much larger than hashes, which is another reason to move to storing hashes in the kernel, rather than signatures.

Where the smaller classic signatures (ECC) are 32 bytes, the smallest produced by ML-DSA are 2420 bytes (with a public key of 1312). For SLH-DSA the smaller signature is 7856 bytes (but hey! 32 bytes pubic key).

The proposed FN-DSA standard has smaller signature sizes (the smallest in the drafts is ~666B with a 897B public key, numbers are still subject to change), yet it requires a IEEE-754 FPU to implement and is a bit crazy, and it is generally not recommended for software signatures.

Some algorithm is also slow (eg SLH-DSA with strong parameters), but ML-DSA is comparable to ECC in performance.

In any case reducing the number of verification operations is a net positive for kernel boot/operations performance so moving to hash-based checks instead of full signature verification wherever possible just makes general engineering sense, even if it can make loading of hash lists slightly more complicated.

HTH,
Simo.

Signature · 4 lines
Simo Sorce
Distinguished Engineer
RHEL Crypto Team
Red Hat, Inc
#4 lore raw
Quoted 4 lines · Simo Sorce

Premise: this problem can't be ignored, even if you think Quantum Computers are BS, various government regulations are pushing all commercial entities to require PQ signatures, so we have to deal with this problem.

I agree it's coming, but there's currently no date for post quantum requirement in FIPS, which is the main driver for this.

Quoted 18 lines · Ignat Korchagin
Quoted 11 lines

Hi David,

Quoted 6 lines · David Howells

Hi,

So we need to do something about the impending quantum-related obsolescence of the RSA signatures that we use for module signing, kexec, BPF signing, IMA and a bunch of other things.

Quoted 5 lines

Is it that impending? At least for now it seems people are more concerned about quantum-safe TLS, so their communications cannot be decrypted later. But breaking signatures of open source modules probably only makes sense when there is an actual capability to break RSA (or ECDSA)

Quoted 7 lines

We do not know when Q-day (or Y2Q if you prefer) will strike, "never" is still a possibility.

But, as a data point, IBM just announced a roadmap for a contraption with 200 error corrected logic qubits. That is substantial progress, so we cannot assume it will never happen, the risk is too high (it is not me saying this, it is the cryptography community consensus).

Current estimates say Shor's algorithm in "reasonable[1]" time requires around a million qubits to break RSA2048, so we're still several orders of magnitude off that. Grover's only requires just over 2,000 (which is why NIST is worried about that first).

Regards,

James

[1] you can change this by a couple of orders of magnitude depending on how long you're willing to wait

#5 lore raw

Am Freitag, 13. Juni 2025, 19:50:22 Mitteleuropäische Sommerzeit schrieb James Bottomley:

Hi James,

Quoted 8 lines · Simo Sorce
Quoted 4 lines

Premise: this problem can't be ignored, even if you think Quantum Computers are BS, various government regulations are pushing all commercial entities to require PQ signatures, so we have to deal with this problem.

I agree it's coming, but there's currently no date for post quantum requirement in FIPS, which is the main driver for this.

Perhaps [1] should be considered if you refer to FIPS?

Further, [2] also gives a timeline.

[1] https://csrc.nist.gov/pubs/ir/8547/ipd

[2] https://www.nsa.gov/Press-Room/News-Highlights/Article/Article/3148990/
nsa-releases-future-quantum-resistant-qr-algorithm-requirements-for-national- se/

Ciao
Stephan

#6 lore raw
In reply to James Bottomley
Quoted 2 lines · James Bottomley

I agree it's coming, but there's currently no date for post quantum requirement in FIPS, which is the main driver for this.

The driver is the CNSA 2.0 document which has precise deadlines, not FIPS. That said ML-KEM and ML-DSA can already be validated, so FIPS is also covered.

Quoted 3 lines

Current estimates say Shor's algorithm in "reasonable[1]" time requires around a million qubits to break RSA2048, so we're still several orders of magnitude off that.

Note that you are citing sources that identify needed physical qbits for error correction, but what IBM publishes is a roadmap for *error corrected* logical qbits. If they can pull that off that computer will already be way too uncomfortably close (you need 2n+3 error corrected logical qbits to break RSA).

Quoted 2 lines

Grover's only requires just over 2,000 (which
is why NIST is worried about that first).

Grover can at most half the search space, so it is not really a concern, even with the smallest key sizes the search space is still 2^64 ... so it makes little sense to spend a lot of engineering time to find all places where doubling key size break things and then do a micro-migration to that. It is better to focus the scarce resources on the long term.

Quoted 7 lines

Regards,

James

[1] you can change this by a couple of orders of magnitude depending on how long you're willing to wait

Signature · 4 lines
Simo Sorce
Distinguished Engineer
RHEL Crypto Team
Red Hat, Inc
#7 lore raw
Quoted 6 lines · Simo Sorce
Quoted 2 lines · James Bottomley

I agree it's coming, but there's currently no date for post quantum requirement in FIPS, which is the main driver for this.

The driver is the CNSA 2.0 document which has precise deadlines, not FIPS.

The NSA "hopes" that the CNSA algorithms will be in FIPS by about 2030, yes. However, even if you have CNSA 2.0 requirement, it still includes several classical algorithms (it even includes RSA3072 which is, to say the least, a bit controversial).

Quoted 2 lines

That said ML-KEM and ML-DSA can already be validated, so FIPS is
also covered.

The main worry everyone has is that while it is believed that there's not a quantum short cut over classical for lattice algorithms, they haven't been studied long enough to believe there's no classical short cut to breaking the encryption. The only real algorithms we're sure about are the hash based ones, so perhaps we should start with XMSS/LMS before leaping to ML-. Particularly for kernel uses like modules, the finite signatures problem shouldn't be that limiting.

Quoted 9 lines
Quoted 3 lines

Current estimates say Shor's algorithm in "reasonable[1]" time requires around a million qubits to break RSA2048, so we're still several orders of magnitude off that.

Note that you are citing sources that identify needed physical qbits for error correction, but what IBM publishes is a roadmap for *error corrected* logical qbits. If they can pull that off that computer will already be way too uncomfortably close (you need 2n+3 error corrected logical qbits to break RSA).

The roadmap is based on a linear presumption of physical to logical qbit scaling. Since quantum error effects are usually exponential in nature that seems optimistic ... but, hey, we should know in a couple of years.

Quoted 4 lines
Quoted 2 lines

Grover's only requires just over 2,000 (which
is why NIST is worried about that first).

Grover can at most half the search space,

I assume you're thinking in terms of 2^n spaces, because for a search space of size s, classical brute force takes O(s) and quantum takes O(sqrt(s)). So if s=2^n then quantum takes O(2^(n/2)). Which is why the recommendation is to double the bits of security.

Quoted 5 lines

so it is not really a concern, even with the smallest key sizes the
search space is still 2^64 ... so it makes little sense to spend a lot of engineering time to find all places where doubling key size break things and then do a micro-migration to that. It is better to focus the scarce resources on the long term.

Well the CNSA 2.0 doc you cite above hedges and does a 1.5x security bit increase, so even following it we can't do P-256, 25519 or RSA2048 we have to move to at least P-384 and X448 (even though it allows RSA3072, I don't think we should be supporting that). So if we're going to have to increase key size anyway, we may as well up it to 256 bits of security.

So even if you believe quantum is slightly more imminent than the Kazakh Gerbil invasion, we should still begin with the key size increase.

Regards,

James

#8 lore raw
Quoted 7 lines · James Bottomley

The main worry everyone has is that while it is believed that there's not a quantum short cut over classical for lattice algorithms, they haven't been studied long enough to believe there's no classical short cut to breaking the encryption. The only real algorithms we're sure about are the hash based ones, so perhaps we should start with XMSS/LMS before leaping to ML-. Particularly for kernel uses like modules, the finite signatures problem shouldn't be that limiting.

The only case where you can use LMS/XMSS in software is if you perform exclusively verification, or if you perform a small number of signatures and then immediately destroy the private key.

LMS/and XMSS absolutely cannot be used as software algorithms to generate signatures while keeping a key around because ensuring the status is never reused is fundamentally impossible in software. And a single reuse in LMS/XMSS means complete breakdown of the crypto-system.

Due to the above in general implementing LMS/XMSS signature generation in software is a *very bad idea*(TM) because people do not understand how it can be used safely, and I would seriously discourage it.

The next option in this line of thought is SLH-DSA (which I would favor if not for the following).

The problems with SLH-DSA are that it has rather large signatures and is the slowest of all the algorithms and that CNSA 2.0 does not list SLH-DSA as approved :-(

Quoted 10 lines
Quoted 9 lines
Quoted 3 lines

Current estimates say Shor's algorithm in "reasonable[1]" time requires around a million qubits to break RSA2048, so we're still several orders of magnitude off that.

Note that you are citing sources that identify needed physical qbits for error correction, but what IBM publishes is a roadmap for *error corrected* logical qbits. If they can pull that off that computer will already be way too uncomfortably close (you need 2n+3 error corrected logical qbits to break RSA).

Quoted 4 lines

The roadmap is based on a linear presumption of physical to logical qbit scaling. Since quantum error effects are usually exponential in nature that seems optimistic ... but, hey, we should know in a couple of years.

To be honest it does not really matter, either we'll have a workable quantum computer or not, if we do we do, and the scaling will be rapid enough that the difference in required bits won't really matter. I find it very unlikely that we'll find ourselves in a situation where we'll have a QC that can efficiently performer the Grover's algorithm with enough bits, and yet implementing Shor's one is too hard and will take a decade or more to reach.

Quoted 13 lines
Quoted 5 lines

so it is not really a concern, even with the smallest key sizes the
search space is still 2^64 ... so it makes little sense to spend a lot of engineering time to find all places where doubling key size break things and then do a micro-migration to that. It is better to focus the scarce resources on the long term.

Well the CNSA 2.0 doc you cite above hedges and does a 1.5x security bit increase, so even following it we can't do P-256, 25519 or RSA2048 we have to move to at least P-384 and X448 (even though it allows RSA3072, I don't think we should be supporting that). So if we're going to have to increase key size anyway, we may as well up it to 256 bits of security.

Quoted 3 lines

So even if you believe quantum is slightly more imminent than the Kazakh Gerbil invasion, we should still begin with the key size increase.

What I believe is that we should not worry about Grover, because if we get a workable Grover implementation that works we'll get Shor's too which breaks clsssic algorithms entirely. Therefore we better move to PQ algorithms and not spend time on a "small transition".

Of course we can decide to hedge *all bets* and move to a composed signature (both a classic and a PQ one), in which case I would suggest looking into signatures that use ML-DSA-87 + Ed448 or ML-DSA-87 + P-521 ,ideally disjoint, with a kernel policy that can decide which (or both) needs to be valid/checked so that the policy can be changed quickly via configuration if any of the signature is broken.

This will allow for fears of Lattice not being vetted enough to be managed as well as increasing the strength of the classic option, while maintaining key and signature sizes manageable.

Signature · 4 lines
Simo Sorce
Distinguished Engineer
RHEL Crypto Team
Red Hat, Inc
#9 lore raw
Quoted 8 lines · Simo Sorce

Of course we can decide to hedge *all bets* and move to a composed signature (both a classic and a PQ one), in which case I would suggest looking into signatures that use ML-DSA-87 + Ed448 or ML-DSA-87 + P-521 ,ideally disjoint, with a kernel policy that can decide which (or both) needs to be valid/checked so that the policy can be changed quickly via configuration if any of the signature is broken.

FYI: based on this implementation of ML-DSA-44/65/87

https://github.com/IBM/mlca/tree/main/qsc/crystals

(entry point is mlca_verify)

I created a prototype of a kernel driver for mldsa-44/65/87 that can verify self-signed mldsa certs created with this openssl command:

openssl \
	req \
	-x509 \
	-newkey mldsa44 \
	-keyout localhost-mldsa44.key \
	-subj /CN=localhost \
	-addext subjectAltName=DNS:localhost \
	-days 30 \
	-nodes \
	-out localhost-mldsa44.crt

(it seems to use the shake256 hash by default)

https://github.com/stefanberger/linux-ima-namespaces/commits/mldsa.06092025/

There's lots of cleanup needed, but with a test suite in user space, this should not be too difficult.

author maintainer
#10 lore raw
Quoted 11 lines · Stefan Berger
Quoted 6 lines · Simo Sorce

Of course we can decide to hedge *all bets* and move to a composed signature (both a classic and a PQ one), in which case I would suggest looking into signatures that use ML-DSA-87 + Ed448 or ML-DSA-87 + P-521 ,ideally disjoint, with a kernel policy that can decide which (or both) needs to be valid/checked so that the policy can be changed quickly via configuration if any of the signature is broken.

FYI: based on this implementation of ML-DSA-44/65/87

https://github.com/IBM/mlca/tree/main/qsc/crystals

The problem with that is that the Apache-2 licence is incompatible with GPLv2. Now, it might be possible to persuade IBM to dual-license their code.

David

#11 lore raw

Am Freitag, 7. November 2025, 11:03:49 Mitteleuropäische Normalzeit schrieb David Howells:

Hi David,

Quoted 9 lines
Quoted 8 lines · Stefan Berger
Quoted 6 lines · Simo Sorce

Of course we can decide to hedge *all bets* and move to a composed signature (both a classic and a PQ one), in which case I would suggest looking into signatures that use ML-DSA-87 + Ed448 or ML-DSA-87 + P-521 ,ideally disjoint, with a kernel policy that can decide which (or both) needs to be valid/checked so that the policy can be changed quickly via configuration if any of the signature is broken.

Quoted 7 lines
Quoted 3 lines

FYI: based on this implementation of ML-DSA-44/65/87

https://github.com/IBM/mlca/tree/main/qsc/crystals

The problem with that is that the Apache-2 licence is incompatible with GPLv2. Now, it might be possible to persuade IBM to dual-license their code.

The code used as a basis for the current approach (leancrypto.org) offers hybrids with ED25519 and ED448) including the X.509/PKCS7 support.

However, please note that the X.509 specification for storing hybrid public keys is not yet completed and there is still some work on the draft IETF standard [1].

Side note: the leancrypto code base uses the Linux kernel X.509/PKCS7 parser code where the relevant handler functions (see [2]) could be relatively quickly transplanted into the kernel if needed.

[1] https://lamps-wg.github.io/draft-composite-sigs/draft-ietf-lamps-pq-composite-sigs.html

[2] https://github.com/smuellerDD/leancrypto/blob/master/asn1/src/
x509_cert_parser.c

Ciao
Stephan

#12 lore raw
In reply to David Howells
Quoted 10 lines · David Howells
Quoted 8 lines · Stefan Berger
Quoted 6 lines · Simo Sorce

Of course we can decide to hedge *all bets* and move to a composed signature (both a classic and a PQ one), in which case I would suggest looking into signatures that use ML-DSA-87 + Ed448 or ML-DSA-87 + P-521 ,ideally disjoint, with a kernel policy that can decide which (or both) needs to be valid/checked so that the policy can be changed quickly via configuration if any of the signature is broken.

Quoted 6 lines
Quoted 3 lines

FYI: based on this implementation of ML-DSA-44/65/87

https://github.com/IBM/mlca/tree/main/qsc/crystals

The problem with that is that the Apache-2 licence is incompatible with GPLv2. Now, it might be possible to persuade IBM to dual-license their code.

Correct. It was supposed to become GPLv2 + Apache 2.

Quoted 4 lines

David

#13 lore raw
In reply to Simo Sorce
Quoted 8 lines

-----Original Message-----
From: Simo Sorce <[email protected]>
Sent: Monday, June 16, 2025 12:27 PM
Subject: Re: Module signing and post-quantum crypto public key algorithms

...

Quoted 10 lines

Of course we can decide to hedge *all bets* and move to a composed signature (both a classic and a PQ one), in which case I would suggest looking into signatures that use ML-DSA-87 + Ed448 or ML-DSA-87 + P-521 ,ideally disjoint, with a kernel policy that can decide which (or both) needs to be valid/checked so that the policy can be changed quickly via configuration if any of the signature is broken.

This will allow for fears of Lattice not being vetted enough to be managed as well as increasing the strength of the classic option, while maintaining key and signature sizes manageable.

I like the ML-DSA-87 + Ed448 combination.

Consider signing with two signatures: traditional and composite.

The traditional signature would use whatever algorithm is used today. Legacy verifiers would only check that.

The composite signature would use:
ML-DSA-87 + Ed448 (+ SHAKE256 if using the CMS composite construction)

New verifiers would only check the composite signature (which requires checking both of its parts).

That composite would be
* FIPS compliant (all the algorithms are)
* CNSA compliant (ML-DSA-87 makes it so; the rest is just noise)
* compliant with any European requirements or preferences for using hybrids
* compliant with any requirements or preferences for high security strengths
* even with two algorithms, faster than the traditional choices for signing, and faster than ECDSA but slower than RSASSA for verification. By bringing in Ed448, it might be viewed as an improvement even by PQC skeptics.

It'd be nice if signed kernel modules and packages used the same algorithms. Both of these define ML-DSA-87 + Ed448 composites:
* draft-ietf-lamps-pq-composite-sigs
* id-MLDSA87-Ed448-SHAKE256 with OID: 1.3.6.1.5.5.7.6.51
* draft-ietf-openpgp-pqc
* ML-DSA-87+Ed448 as public key algorithm ID 31

author maintainer
#14 lore raw
Quoted 2 lines · Robert (Servers)

The traditional signature would use whatever algorithm is used today. Legacy verifiers would only check that.

Would there be any legacy verifiers? Kernel modules are generally tied to the kernel version for which they were compiled. Granted there are things like the wifi regulatory stuff that are also signed.

But note also, PKCS#7 supports multiple independent signatures in a single object. The kernel will handle this already. At least one signature must be verifiable and none must be blacklisted.

I assume that the main aim of using a composite algorithm is to share the result of the content hash - but in this case only the authenticatedAttributes are going to be hashed for the signature, and that's relatively small.

David

#15 lore raw
Quoted 18 lines

-----Original Message-----
From: David Howells <[email protected]>
Sent: Saturday, November 8, 2025 1:47 AM
To: Elliott, Robert (Servers) <[email protected]>
Cc: [email protected]; Simo Sorce <[email protected]>; James Bottomley <[email protected]>; Ignat Korchagin <[email protected]>; Herbert Xu <[email protected]>; Stephan Mueller <[email protected]>; [email protected]; Paul Moore <[email protected]>; Lukas Wunner <[email protected]>; Clemens Lang <[email protected]>; David Bohannon <[email protected]>; Roberto Sassu <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: Module signing and post-quantum crypto public key algorithms

Quoted 8 lines
Quoted 2 lines · Robert (Servers)

The traditional signature would use whatever algorithm is used today. Legacy verifiers would only check that.

Would there be any legacy verifiers? Kernel modules are generally tied to the kernel version for which they were compiled. Granted there are things like the wifi regulatory stuff that are also signed.

If the system building and signing a module doesn't have OpenSSL 3.5 yet, it can only provide a legacy signature. If the kernel is only looking for a composite by default, a kernel command line allowing a legacy signature to be accepted would help the transition.

Userspace tools can check signatures, but I don't know if that is done in any non-developer situations. I did it manually while testing x86 optimized crypto module changes a few years ago.

If and when a distro is confident there are no userspace tools, it could stop signing with legacy signatures.

Quoted 3 lines

But note also, PKCS#7 supports multiple independent signatures in a single object. The kernel will handle this already. At least one signature must be verifiable and none must be blacklisted.

Yes, I think that makes multiple signatures viable.

Quoted 4 lines

I assume that the main aim of using a composite algorithm is to share the result of the content hash - but in this case only the authenticatedAttributes are going to be hashed for the signature, and that's relatively small.

The composite motivation is to provide some protection if someone discovers a basic flaw in the PQC algorithm. If quantum computers haven't arrived yet to break the traditional algorithm, the composite still proves validity.

The CMS and OpenPGP constructions ensure that the signatures are non-separable; an attacker cannot strip off the strong one and leave the broken one. The verifier always runs both algorithms (unlike the current OR policy with multiple signatures).

#16 lore raw
Quoted 4 lines · Robert (Servers)

The composite motivation is to provide some protection if someone discovers a basic flaw in the PQC algorithm. If quantum computers haven't arrived yet to break the traditional algorithm, the composite still proves validity.

Given you quoted me wrt composite signatures, I'd like to make clear I do *not* necessarily favor it.

Unlike regular software or firmware, kernel modules are generally tied to a specific version of the kernel, therefore there is no real need for long term resistance (unless you plan to never upgrade a kernel).

If a defect in a signing algorithm is found you can simply distribute a new kernel with modules resigned with a different algorithm.

The problem of using composite algorithms are many:
- You need composite keys (or at least two keys, depending on the implementation).
- You will pay a higher price in terms of CPU/time for verification for each signature.
- You will pay a higher price in terms of disk/ram space to store multiple signatures.

It is generally not worth paying this price when the remediation is easy.

Signature · 4 lines
Simo Sorce
Distinguished Engineer
RHEL Crypto Team
Red Hat, Inc
author maintainer
#17 lore raw
Quoted 2 lines · Simo Sorce

If a defect in a signing algorithm is found you can simply distribute a new kernel with modules resigned with a different algorithm.

Probably more "have to" than "can". The cert providing the composite key for both would have to be invalidated to stop it from being used - and invalidated by having it added to the UEFI dbx table.

David

#18 lore raw
In reply to David Howells
Quoted 2 lines · David Howells

So we need to do something about the impending quantum-related obsolescence [..]

I'd suggest you worry more about the rumors that Kazakhstan is growing a veritable army of gerbils, and giving them all ABACUSES!

What's your plan for that imminent attack vector? Because they could be here any day.

Yes, yes, please stop using RSA and relying over-much on big prime numbers. But let's not throw the "Post Quantum" word around as if it was reality.

The reality of kernel security remains actual bugs - both in hardware and in software - not some buzzword.

Linus

#19 lore raw
In reply to David Howells
Quoted 5 lines · David Howells

Hi,

So we need to do something about the impending quantum-related obsolescence of the RSA signatures that we use for module signing, kexec, BPF signing, IMA and a bunch of other things.

Wait, that's not necessarily the whole threat. There are two possible ways quantum could compromise us. One is a computer that has enough qbits to run the shor algorithm and break non-quantum crypto. The other is that a computer comes along with enough qbits to speed up the brute force attacks using the grover algorithm. NIST still believes the latter will happen way before the former, so our first step should be doubling the number of security bits in existing algorithms, which means ECC of at least 512 bits (so curve25519 needs replacing with at least curve448) and for all practical purposes deprecating RSA (unless someone wants to play with huge keys).

Quoted 5 lines

From my point of view, the simplest way would be to implement key verification in the kernel for one (or more) of the available post- quantum algorithms (of which there are at least three), driving this with appropriate changes to the X.509 certificate to indicate that's what we want to use.

Can you at least enumerate them? There's still a dispute going on about whether we should use pure post-quantum or hybrid. I tend to think myself that hybrid is best for durable things like digital signatures but given the NIST advice, we should be using > 512 bit curves for that.

Quoted 5 lines

The good news is that Stephan Mueller has an implemementation that includes
kernel bits that we can use, or, at least, adapt:

https://github.com/smuellerDD/leancrypto/

So the only hybrid scheme in there is dilithium+25519 which doesn't quite fit the bill (although I'm assuming dilithium+448 could easily be implemented)

Quoted 20 lines

Note that we only need the signature verification bits.  One question, though: he's done it as a standalone "leancrypto" module, not integrated into crypto/, but should it be integrated into crypto/ or is the standalone fine?

The not so good news, as I understand it, though, is that the X.509 bits are not yet standardised.

However!  Not everyone agrees with this.  An alternative proposal would rather get the signature verification code out of the kernel entirely.  Simo Sorce's proposal, for example, AIUI, is to compile all the hashes we need into the kernel at build time, possibly with a hashed hash list to be loaded later to reduce the amount of uncompressible code in the kernel.  If signatures are needed at all, then this should be offloaded to a userspace program (which would also have to be hashed and marked unptraceable and I think unswappable) to do the checking.

Quoted 6 lines

I don't think we can dispense with signature checking entirely,
though: we need it for third party module loading, quick single- module driver updates and all the non-module checking stuff.  If it were to be done in userspace, this might entail an upcall for each signature we want to check - either that, or the kernel has to run a server process that it can delegate checking to.

I agree we can't predict everything at build time, so we need a runtime scheme (like signatures) as well. However, I'm not convinced it should be run outside the kernel. The expansion of the TCB plus the amount of checking the kernel has to do to make sure the upcall is secure adds to the vulnerability over in-kernel where everything just works.

Quoted 4 lines

It's also been suggested that PQ algorithms are really slow.  For kernel modules that might not matter too much as we may well not load more than 200 or so during boot - but there are other users that may get used more frequently (IMA, for example).

If we go with a hybrid signature scheme, we can start off with only verifying the pre-quantum signature and have a switch to verify both.

Quoted 8 lines

Now, there's also a possible hybrid approach, if I understand Roberto Sassu's proposal correctly, whereby it caches bundles of hashes obtained from, say, the hashes included in an RPM.  These bundles of hashes can be checked by signature generated by the package signing process.  This would reduce the PQ overhead to checking a bundle and would also make IMA's measuring easier as the hashes can be added in the right order, rather than being dependent on the order that the binaries are used.

I think you're referring to the IMA digest list extension proposal:

https://github.com/initlove/linux/wiki/IMA-Digest-Lists-Extension

I'm not sure it's been progressed much.

Regards,

James

#20 lore raw

Am Freitag, 13. Juni 2025, 18:13:43 Mitteleuropäische Sommerzeit schrieb James Bottomley:

Hi James,

Quoted 9 lines
Quoted 5 lines

The good news is that Stephan Mueller has an implemementation that includes

kernel bits that we can use, or, at least, adapt:
https://github.com/smuellerDD/leancrypto/

So the only hybrid scheme in there is dilithium+25519 which doesn't quite fit the bill (although I'm assuming dilithium+448 could easily be implemented)

Dilithium-ED448 just landed. One bug to squash though.

Ciao
Stephan

#21 lore raw
In reply to James Bottomley
Quoted 90 lines · James Bottomley
Quoted 5 lines · David Howells

Hi,

So we need to do something about the impending quantum-related obsolescence of the RSA signatures that we use for module signing, kexec, BPF signing, IMA and a bunch of other things.

Wait, that's not necessarily the whole threat. There are two possible ways quantum could compromise us. One is a computer that has enough qbits to run the shor algorithm and break non-quantum crypto. The other is that a computer comes along with enough qbits to speed up the brute force attacks using the grover algorithm. NIST still believes the latter will happen way before the former, so our first step should be doubling the number of security bits in existing algorithms, which means ECC of at least 512 bits (so curve25519 needs replacing with at least curve448) and for all practical purposes deprecating RSA (unless someone wants to play with huge keys).

Quoted 5 lines

From my point of view, the simplest way would be to implement key verification in the kernel for one (or more) of the available post- quantum algorithms (of which there are at least three), driving this with appropriate changes to the X.509 certificate to indicate that's what we want to use.

Can you at least enumerate them? There's still a dispute going on about whether we should use pure post-quantum or hybrid. I tend to think myself that hybrid is best for durable things like digital signatures but given the NIST advice, we should be using > 512 bit curves for that.

Quoted 5 lines

The good news is that Stephan Mueller has an implemementation that includes
kernel bits that we can use, or, at least, adapt:

https://github.com/smuellerDD/leancrypto/

So the only hybrid scheme in there is dilithium+25519 which doesn't quite fit the bill (although I'm assuming dilithium+448 could easily be implemented)

Quoted 20 lines

Note that we only need the signature verification bits.  One question, though: he's done it as a standalone "leancrypto" module, not integrated into crypto/, but should it be integrated into crypto/ or is the standalone fine?

The not so good news, as I understand it, though, is that the X.509 bits are not yet standardised.

However!  Not everyone agrees with this.  An alternative proposal would rather get the signature verification code out of the kernel entirely.  Simo Sorce's proposal, for example, AIUI, is to compile all the hashes we need into the kernel at build time, possibly with a hashed hash list to be loaded later to reduce the amount of uncompressible code in the kernel.  If signatures are needed at all, then this should be offloaded to a userspace program (which would also have to be hashed and marked unptraceable and I think unswappable) to do the checking.

Quoted 6 lines

I don't think we can dispense with signature checking entirely,
though: we need it for third party module loading, quick single- module driver updates and all the non-module checking stuff.  If it were to be done in userspace, this might entail an upcall for each signature we want to check - either that, or the kernel has to run a server process that it can delegate checking to.

I agree we can't predict everything at build time, so we need a runtime scheme (like signatures) as well. However, I'm not convinced it should be run outside the kernel. The expansion of the TCB plus the amount of checking the kernel has to do to make sure the upcall is secure adds to the vulnerability over in-kernel where everything just works.

Quoted 4 lines

It's also been suggested that PQ algorithms are really slow.  For kernel modules that might not matter too much as we may well not load more than 200 or so during boot - but there are other users that may get used more frequently (IMA, for example).

If we go with a hybrid signature scheme, we can start off with only verifying the pre-quantum signature and have a switch to verify both.

Quoted 8 lines

Now, there's also a possible hybrid approach, if I understand Roberto Sassu's proposal correctly, whereby it caches bundles of hashes obtained from, say, the hashes included in an RPM.  These bundles of hashes can be checked by signature generated by the package signing process.  This would reduce the PQ overhead to checking a bundle and would also make IMA's measuring easier as the hashes can be added in the right order, rather than being dependent on the order that the binaries are used.

Quoted 5 lines

I think you're referring to the IMA digest list extension proposal:

https://github.com/initlove/linux/wiki/IMA-Digest-Lists-Extension

I'm not sure it's been progressed much.

The latest iteration can be found here:

https://lore.kernel.org/linux-integrity/[email protected]/

It is more or less ready for upstreaming (from my point of view), with the exception of a few comments that I still need to address.

The main problem was parsing the RPM headers in the kernel, that Linus didn't like, but I believe I solved it now with Mimi's suggestion of making the digest list parsers pluggable (so the RPM parser has been removed from this submission, and moved to a kernel module that is expected to be signed by distros).

I explored the alternative of moving the parser to user space, but as you mentioned, it is a more risky approach.

Other than that, yes, it makes IMA much faster in my benchmarks (~34 seconds to lookup 12312 digests and verify 303 ECDSA signatures, as opposed to ~98 seconds to verify 12312 ECDSA signatures).

Roberto

#22 lore raw
In reply to David Howells
Quoted 11 lines · David Howells

Hi,

So we need to do something about the impending quantum-related obsolescence of the RSA signatures that we use for module signing, kexec, BPF signing, IMA and a bunch of other things.

From my point of view, the simplest way would be to implement key verification in the kernel for one (or more) of the available post-quantum algorithms (of which there are at least three), driving this with appropriate changes to the X.509 certificate to indicate that's what we want to use.

Quoted 8 lines

The good news is that Stephan Mueller has an implemementation that includes kernel bits that we can use, or, at least, adapt:

https://github.com/smuellerDD/leancrypto/

Note that we only need the signature verification bits. One question, though:
he's done it as a standalone "leancrypto" module, not integrated into crypto/, but should it be integrated into crypto/ or is the standalone fine?

The proper place for crypto algorithm implementations, both new and existing, is lib/crypto/. crypto/ should contain only the compatibility code to integrate the algorithm implementations into the generic APIs like crypto_akcipher, *if* it's needed.

ML-DSA a.k.a. Dilithium support is fairly low on my priority list at the moment, so if someone really wants it soon they would need to drive that effort.

- Eric

#23 lore raw
In reply to David Howells
Quoted 4 lines · David Howells

The good news is that Stephan Mueller has an implemementation that includes kernel bits that we can use, or, at least, adapt:

https://github.com/smuellerDD/leancrypto/

I assume Herbert will insist that any new algorithm is hardened against side channel attacks. Thankfully, Stephan seems to have put some effort into that:

"side-channel-resistant: A valgrind-based dynamic side channel
analysis is applied to find time-variant code paths based on secret data."

Quoted 6 lines

However! Not everyone agrees with this. An alternative proposal would rather get the signature verification code out of the kernel entirely. Simo Sorce's proposal, for example, AIUI, is to compile all the hashes we need into the kernel at build time, possibly with a hashed hash list to be loaded later to reduce the amount of uncompressible code in the kernel.

Module signing isn't the only motivation to add PQC algorithms to the kernel. Another is SPDM, a protocol for device authentication, measurement and secure channel setup.

The DMTF has finally published SPDM 1.4.0 on May 25th and this revision adds support for PQC algorithms (see list on page 216):

https://www.dmtf.org/sites/default/files/standards/documents/DSP0274_1.4.0.pdf

An in-kernel implementation is being worked on by Jonathan (+cc) and me:

https://github.com/l1k/linux/commits/doe

We haven't added SPDM 1.4 support yet, but will have to eventually. So far we only support RSA and ECDSA, because that's the baseline mandated by the PCIe Base Specification for PCI device authentication. I expect there'll be an ECN sooner rather than later to extend the baseline to PQC algorithms.

Thanks,

Lukas

maintainer
#24 lore raw
Quoted 4 lines · Lukas Wunner

I assume Herbert will insist that any new algorithm is hardened against side channel attacks. Thankfully, Stephan seems to have put some effort into that:

No I think we should instead only support public keys. There is no valid use-case for private keys in the kernel.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt