From: Bruno Meneguele <bmeneg@redhat.com>
To: linux-integrity@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, keyrings@vger.kernel.org,
zohar@linux.ibm.com, roberto.sassu@huawei.com,
dhowells@redhat.com, bauerman@linux.ibm.com,
Bruno Meneguele <bmeneg@redhat.com>
Subject: [RFC PATCH 0/8] ima: measure modules with multiple appended signatures
Date: Thu, 26 Nov 2026 23:59:03 -0300 [thread overview]
Message-ID: <20261127025912.1383750-1-bmeneg@redhat.com> (raw)
Hi,
This RFC presents the support for modules with multiple signatures, *and mixed
algorithms*, appended. A scenario that requires it today is the PQC transition
period where modules are signed with both, eg., ML-DSA and ECDSA.
Appraisal already handles that: pkcs7_verify() accepts the file if a trusted
signer verifies and no other signer fails (unknown keys is not considered
failure). But measurement doesn't: 'd-modsig' and the binary blacklist check
take the content digest from pkcs7_get_digest(), which fails with more than one
signer, so the file loads unmeasured.
Patches #1 and #2 (for stable) fix two PKCS#7 bugs found on the way: a failed
digest left in sig->m, and pkcs7_get_digest() returning the signed attributes
instead of the content digest. Patch #3 adds support for multiple signers on
PKCS#7 code, but IMA 'd-modsig' can't describe it, so patches #4-#7 add a
template (patch #5 standardizes how ima-modsig records ML-DSA in the same way
proposed here for its v2):
ima-modsigv2 = d-ngv2 | n-ng | sig | d-modsig-list | modsig
'd-modsig-list' is <u32 count> x (<u32 entry_len><entry>), one 'd-modsig' entry
per signer in 'modsig' order, or "<sig algo>:" for direct data (eg. ML-DSA)
signatures:
d-ngv2: ima:sha256:a4fa30a9...48d3a449
n-ng: /test/t10-ecdsa512-mldsa65-noattr.ko
sig: 030304...feff
d-modsig-list: sha512:0e750939...f8c18dcb,mldsa65:
modsig: 30820e1706092a864886f70d010702a0...
Another example with ECDSA-SHA512+RSA-SHA256 and ML-DSA-65+ML-DSA-87:
d-modsig-list: sha512:0e750939...f8c18dcb,sha256:0ae76371...e37306f2
d-modsig-list: mldsa65:,mldsa87:
A signer with no usable digest gets an empty entry; with none, the measurement
list entry is dropped, as with 'd-modsig'. Patch #8 blocks a file if any
signer's digest is blacklisted.
Open questions: (1) should a dropped measurement be reported more explicitly
than by its audit record? (2) a pure ML-DSA signer has no content digest to
match a 'bin:' entry; how should that fit with the 'skid:' proposal [1]?
I tested module loading in a QEMU/KVM x86_64 and kernel image kexec in a PPC64LE
LPAR with RSA, ECDSA and ML-DSA-65/87, one or two signers, mixed hash algorithms
and rejected cases (bad messageDigest, two ML-DSA signers with one bad).
Claude Opus helped read the code, review the patches and write the tests (and
this cover-letter). I reviewed and reworked every diff and I'm responsible for
all of it.
Thanks,
Bruno
[1] https://lore.kernel.org/all/20261106173149.707244-1-zohar@linux.ibm.com/
Bruno Meneguele (8):
pkcs7: don't cache a failed digest in pkcs7_digest()
pkcs7: return the content digest from pkcs7_get_digest()
pkcs7: support multiple signers in pkcs7_get_digest()
ima: get the modsig content digest of each signer
ima: record data-signing algorithms by name in 'd-modsig'
ima: add the 'd-modsig-list' template field
ima: define the ima-modsigv2 template
ima: check the digest of every modsig signer against the blacklist
Documentation/security/IMA-templates.rst | 8 +-
crypto/asymmetric_keys/pkcs7_verify.c | 83 +++++++--
include/crypto/pkcs7.h | 7 +-
security/integrity/ima/ima.h | 15 +-
security/integrity/ima/ima_appraise.c | 15 +-
security/integrity/ima/ima_modsig.c | 48 +++--
security/integrity/ima/ima_policy.c | 3 +-
security/integrity/ima/ima_template.c | 8 +-
security/integrity/ima/ima_template_lib.c | 208 ++++++++++++++++++----
security/integrity/ima/ima_template_lib.h | 4 +
10 files changed, 314 insertions(+), 85 deletions(-)
--
2.55.0
next reply other threads:[~2026-11-27 2:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 2:59 Bruno Meneguele [this message]
2026-11-27 2:59 ` [RFC PATCH 1/8] pkcs7: don't cache a failed digest in pkcs7_digest() Bruno Meneguele
2026-11-27 2:59 ` [RFC PATCH 2/8] pkcs7: return the content digest from pkcs7_get_digest() Bruno Meneguele
2026-11-27 2:59 ` [RFC PATCH 3/8] pkcs7: support multiple signers in pkcs7_get_digest() Bruno Meneguele
2026-11-27 2:59 ` [RFC PATCH 4/8] ima: get the modsig content digest of each signer Bruno Meneguele
2026-11-27 2:59 ` [RFC PATCH 5/8] ima: record data-signing algorithms by name in 'd-modsig' Bruno Meneguele
2026-11-27 2:59 ` [RFC PATCH 6/8] ima: add the 'd-modsig-list' template field Bruno Meneguele
2026-11-27 2:59 ` [RFC PATCH 7/8] ima: define the ima-modsigv2 template Bruno Meneguele
2026-11-27 2:59 ` [RFC PATCH 8/8] ima: check the digest of every modsig signer against the blacklist Bruno Meneguele
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=20261127025912.1383750-1-bmeneg@redhat.com \
--to=bmeneg@redhat.com \
--cc=bauerman@linux.ibm.com \
--cc=dhowells@redhat.com \
--cc=keyrings@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roberto.sassu@huawei.com \
--cc=zohar@linux.ibm.com \
/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
all inboxes | Powered by JetHome®