[RFC PATCH 7/8] ima: define the ima-modsigv2 template

From: Bruno Meneguele

Date: Thu Nov 26 2026 - 22:00:27 EST


Add the "ima-modsigv2" template with the following format:

d-ngv2|n-ng|sig|d-modsig-list|modsig

the counterpart of ima-modsig with support for multiple appended signatures
that records the content digest for every signer instead of just one. The
existing ima-modsig template and its 'd-modsig' field are left unchanged.

Signed-off-by: Bruno Meneguele <bmeneg@xxxxxxxxxx>
---
Documentation/security/IMA-templates.rst | 1 +
security/integrity/ima/ima_template.c | 2 ++
2 files changed, 3 insertions(+)

diff --git a/Documentation/security/IMA-templates.rst b/Documentation/security/IMA-templates.rst
index 161aed3da8b7..38d6d27344e2 100644
--- a/Documentation/security/IMA-templates.rst
+++ b/Documentation/security/IMA-templates.rst
@@ -99,6 +99,7 @@ Below, there is the list of defined template descriptors:
- "ima-sigv2": its format is ``d-ngv2|n-ng|sig``;
- "ima-buf": its format is ``d-ng|n-ng|buf``;
- "ima-modsig": its format is ``d-ng|n-ng|sig|d-modsig|modsig``;
+ - "ima-modsigv2": its format is ``d-ngv2|n-ng|sig|d-modsig-list|modsig``;
- "evm-sig": its format is ``d-ng|n-ng|evmsig|xattrnames|xattrlengths|xattrvalues|iuid|igid|imode``;


diff --git a/security/integrity/ima/ima_template.c b/security/integrity/ima/ima_template.c
index 584f970e553e..721af4b1828b 100644
--- a/security/integrity/ima/ima_template.c
+++ b/security/integrity/ima/ima_template.c
@@ -24,6 +24,8 @@ static struct ima_template_desc builtin_templates[] = {
{.name = "ima-sigv2", .fmt = "d-ngv2|n-ng|sig"},
{.name = "ima-buf", .fmt = "d-ng|n-ng|buf"},
{.name = "ima-modsig", .fmt = "d-ng|n-ng|sig|d-modsig|modsig"},
+ {.name = "ima-modsigv2",
+ .fmt = "d-ngv2|n-ng|sig|d-modsig-list|modsig"},
{.name = "evm-sig",
.fmt = "d-ng|n-ng|evmsig|xattrnames|xattrlengths|xattrvalues|iuid|igid|imode"},
{.name = "", .fmt = ""}, /* placeholder for a custom format */
--
2.55.0