* [PATCH] efi/tpcm: Add TPCM module support
@ 2024-10-31 11:34 chench246
2025-05-14 12:12 ` Fwd: " hao chen
0 siblings, 1 reply; 9+ messages in thread
From: chench246 @ 2024-10-31 11:34 UTC (permalink / raw)
To: grub-devel; +Cc: chench246, hao chen
From: chench246 <chench246@hotmail.com>
TPCM(Trusted Platform Control Module) is a Chinese standard and has similar function
to tpm, but tpcm adds the function of active monitoring and control to the system.
It can realize active startup measurement when the system starts,as well as dynamic
measurement and monitoring when the program is running, further enhance the security
of the system.
Signed-off-by: hao chen <chench246@gmail.com>
---
grub-core/Makefile.core.def | 7 ++
grub-core/commands/efi/tpcm.c | 163 ++++++++++++++++++++++++++++++++++
grub-core/commands/tpcm.c | 99 +++++++++++++++++++++
include/grub/efi/tpcm.h | 60 +++++++++++++
include/grub/err.h | 3 +-
5 files changed, 331 insertions(+), 1 deletion(-)
create mode 100755 grub-core/commands/efi/tpcm.c
create mode 100755 grub-core/commands/tpcm.c
create mode 100644 include/grub/efi/tpcm.h
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index 063ef5dd7..f1250601b 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -2562,6 +2562,13 @@ module = {
enable = efi;
};
+module = {
+ name = tpcm;
+ common = commands/tpcm.c;
+ efi = commands/efi/tpcm.c;
+ enable = x86_64_efi;
+};
+
module = {
name = tr;
common = commands/tr.c;
diff --git a/grub-core/commands/efi/tpcm.c b/grub-core/commands/efi/tpcm.c
new file mode 100755
index 000000000..bc97e800c
--- /dev/null
+++ b/grub-core/commands/efi/tpcm.c
@@ -0,0 +1,163 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2018 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * EFI TPCM support code.
+ */
+
+#include <grub/err.h>
+#include <grub/efi/tpcm.h>
+
+
+static grub_uint32_t g_measured_id = STAGE_START;
+
+/*
+ get_tpcm_stage:
+ TPCM does not make a distinction with the type of
+ measured target, so we use g_measured_id directly
+ for the stage.
+ */
+static grub_uint32_t get_tpcm_stage(void)
+{
+ grub_uint32_t stage = STAGE_INVALID;
+
+ stage = g_measured_id;
+
+ if (stage < STAGE_START || stage > STAGE_END)
+ stage = STAGE_INVALID;
+
+ return stage;
+}
+
+/*
+ update_measured_id:
+ update g_measured_id +1 every time measured, and g_measured_id
+ will never be decreased.
+ */
+static void update_measured_id(void)
+{
+ g_measured_id++;
+}
+
+/*
+ measure_memory:
+ measure the memery region--(addr, size) through the TPCM protocol.
+ if TPCM protocol is not exist in BIOS, it will return SUCC to keep
+ compatible with non-measurement-support bios; if TPCM protocol is
+ exist but not enabled, it will also return SUCC.
+ */
+static grub_err_t measure_memory(enum grub_file_type type __attribute__((unused)),
+ char *desc,
+ grub_addr_t addr,
+ grub_size_t size)
+{
+ grub_efi_handle_t *handles = 0;
+ grub_efi_uintn_t num_handles;
+ grub_efi_handle_t grub_c2p_handle = 0;
+ grub_err_t test_c2p_err = GRUB_ERR_BAD_OS;
+ grub_guid_t c2p_guid = C2PGUID;
+ grub_uint32_t measure_result = 0;
+ grub_uint32_t control_result = 0;
+ grub_efi_boolean_t verify_enable = 0;
+ grub_size_t desc_len = 0;
+
+ handles = grub_efi_locate_handle(GRUB_EFI_BY_PROTOCOL, &c2p_guid, NULL, &num_handles);
+ if (handles && (num_handles > 0))
+ {
+ struct c2p_protocol *c2p;
+
+ grub_c2p_handle = handles[0];
+ grub_dprintf ("tpcm", "measue memory addr 0x%lx size 0x%lx \n", addr, size);
+ c2p = grub_efi_open_protocol(grub_c2p_handle, &c2p_guid,
+ GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
+ if (c2p)
+ {
+ verify_enable = c2p->verify_is_enabled (c2p);
+ if (verify_enable)
+ {
+ struct addr_range range;
+ grub_efi_status_t status = 0;
+ grub_uint32_t stage = STAGE_INVALID;
+
+ range.start = addr;
+ range.length = size;
+
+ stage = get_tpcm_stage();
+ if (stage != STAGE_INVALID)
+ {
+ desc_len = grub_strlen(desc) + 1;
+ status = c2p->verify_raw (c2p, stage, (grub_uint64_t)desc, desc_len, 1, &range, &measure_result, &control_result);
+ if ((!status) && ((control_result & MEASURE_ACTION_MASK) == 0) )
+ {
+ grub_dprintf ("tpcm", "verify_raw success. stage[%d]desc:[%s]\n", stage, desc);
+ test_c2p_err = GRUB_ERR_NONE;
+ }
+ else
+ {
+ grub_dprintf ("tpcm", "verify_raw error\n");
+ while(1)
+ {
+ grub_error (GRUB_ERR_TPCM_VERIFY, "tpcm verify error. stage[%d]desc[%s]\n", stage, desc);
+ asm volatile ("hlt");
+ }
+ }
+ }
+ else {
+ grub_dprintf ("tpcm", "invalid stage\n");
+ }
+
+ update_measured_id();
+
+ }
+ else {
+ grub_dprintf ("tpcm", "image verify not enabled\n");
+ test_c2p_err = GRUB_ERR_NONE;
+ }
+ }
+ else
+ grub_dprintf ("tpcm", "open c2p protocol failed\n");
+ }
+ else
+ {
+ /* keep compatible with non-measurement-support bios. */
+ grub_dprintf ("tpcm", "not found C2P protocol\n");
+ test_c2p_err = GRUB_ERR_NONE;
+ }
+
+ return test_c2p_err;
+}
+
+/*
+ grub_tpcm_measure_memory:
+ */
+grub_err_t grub_tpcm_measure_memory(void *context, grub_addr_t buf, grub_size_t size)
+{
+ char *p_context = (char *)context;
+ char *p, *p_desc;
+ char tmp[TPCM_MAX_BUF_SIZE] = {'0'};
+ enum grub_file_type type;
+
+ if (!p_context)
+ return GRUB_ERR_BUG;
+
+ p = grub_strchr(p_context, '|');
+ p_desc = p + 1;
+ grub_memcpy(tmp, p_context, (p-p_context));
+ type = grub_strtoul(tmp, 0, 10);
+
+ return measure_memory(type, p_desc, buf, size);
+}
+
diff --git a/grub-core/commands/tpcm.c b/grub-core/commands/tpcm.c
new file mode 100755
index 000000000..1c8bd77ce
--- /dev/null
+++ b/grub-core/commands/tpcm.c
@@ -0,0 +1,99 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2018 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Core TPCM support code.
+ */
+
+#include <grub/err.h>
+#include <grub/verify.h>
+#include <grub/dl.h>
+#include <grub/efi/tpcm.h>
+
+GRUB_MOD_LICENSE ("GPLv3+");
+
+static char context_buf[TPCM_MAX_BUF_SIZE];
+
+static grub_err_t grub_tpcm_verify_init(grub_file_t io,
+ enum grub_file_type type,
+ void **context,
+ enum grub_verify_flags *flags)
+{
+ grub_memset(context_buf, 0, TPCM_MAX_BUF_SIZE);
+ grub_snprintf(context_buf, TPCM_MAX_BUF_SIZE, "%d|%s", (type & GRUB_FILE_TYPE_MASK), io->name);
+ *context = context_buf;
+ *flags |= GRUB_VERIFY_FLAGS_SINGLE_CHUNK;
+
+ return GRUB_ERR_NONE;
+}
+
+static grub_err_t grub_tpcm_verify_write(void *context, void *buf , grub_size_t size )
+{
+ return grub_tpcm_measure_memory(context, (grub_addr_t)buf, size);
+}
+
+static grub_err_t grub_tpcm_verify_string (char *str, enum grub_verify_string_type type)
+{
+ const char *prefix = NULL;
+ char *description, *context;
+ grub_err_t status;
+
+ switch (type)
+ {
+ case GRUB_VERIFY_KERNEL_CMDLINE:
+ prefix = "kernel_cmdline: ";
+ break;
+ case GRUB_VERIFY_MODULE_CMDLINE:
+ prefix = "module_cmdline: ";
+ break;
+ case GRUB_VERIFY_COMMAND:
+ prefix = "grub_cmd: ";
+ break;
+ }
+
+ context = grub_zalloc(grub_strlen (str) + grub_strlen (prefix) + 1 + 4); /* 4 for type */
+ if (!context)
+ return grub_errno;
+
+ grub_snprintf(context, 4, "%d|", (type & GRUB_FILE_TYPE_MASK));
+ description = context + grub_strlen(context);
+ grub_memcpy(description, prefix, grub_strlen (prefix));
+ grub_memcpy(description + grub_strlen (prefix), str, grub_strlen (str) + 1);
+
+ status = grub_tpcm_measure_memory(context, (grub_addr_t)str, grub_strlen(str));
+
+ grub_free(context);
+
+ return status;
+}
+
+struct grub_file_verifier grub_tpcm_verifier = {
+ .name = "tpcm",
+ .init = grub_tpcm_verify_init,
+ .write = grub_tpcm_verify_write,
+ .verify_string = grub_tpcm_verify_string,
+};
+
+GRUB_MOD_INIT (tpcm)
+{
+ grub_verifier_register(&grub_tpcm_verifier);
+}
+
+GRUB_MOD_FINI (tpcm)
+{
+ grub_verifier_unregister(&grub_tpcm_verifier);
+}
+
diff --git a/include/grub/efi/tpcm.h b/include/grub/efi/tpcm.h
new file mode 100644
index 000000000..a4e0c765a
--- /dev/null
+++ b/include/grub/efi/tpcm.h
@@ -0,0 +1,60 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2018 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GRUB_EFI_TPCM_HEADER
+#define GRUB_EFI_TPCM_HEADER 1
+
+#include <grub/file.h>
+#include <grub/efi/api.h>
+#include <grub/efi/efi.h>
+
+#define C2PGUID {0xf89ab5cd, 0x2829, 0x422f, {0xa5, 0xf3, 0x03, 0x28, 0xe0, 0x6c, 0xfc, 0xbb}}
+#define MEASURE_RESULT_MASK (0xff00)
+#define MEASURE_RESULT_SHIFT (16)
+#define MEASURE_ACTION_MASK (0x1)
+#define TPCM_MAX_BUF_SIZE 128
+
+/*
+ stage layout:
+ 2000~2999: +1 every time
+*/
+
+#define STAGE_START 2000
+#define STAGE_END 2999
+#define STAGE_INVALID 3000
+
+struct addr_range {
+ grub_uint64_t start;
+ grub_uint64_t length;
+};
+struct c2p_protocol {
+ grub_efi_status_t (__grub_efi_api *verify_raw) (struct c2p_protocol *this,
+ grub_uint32_t measure_stage,
+ grub_uint64_t image_info,
+ grub_uint32_t image_info_size,
+ grub_uint32_t num_addr_range,
+ struct addr_range ranges[],
+ grub_uint32_t *measure_result,
+ grub_uint32_t *control_result);
+ grub_efi_boolean_t (__grub_efi_api *verify_is_enabled)(struct c2p_protocol *this);
+};
+typedef struct c2p_protocol c2p_protocol_t;
+
+grub_err_t grub_tpcm_measure_memory(void *context, grub_addr_t buf, grub_size_t size);
+
+#endif
diff --git a/include/grub/err.h b/include/grub/err.h
index 1c07034cd..f5268dd47 100644
--- a/include/grub/err.h
+++ b/include/grub/err.h
@@ -73,7 +73,8 @@ typedef enum
GRUB_ERR_NET_NO_DOMAIN,
GRUB_ERR_EOF,
GRUB_ERR_BAD_SIGNATURE,
- GRUB_ERR_BAD_FIRMWARE
+ GRUB_ERR_BAD_FIRMWARE,
+ GRUB_ERR_TPCM_VERIFY
}
grub_err_t;
--
2.17.1
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Fwd: [PATCH] efi/tpcm: Add TPCM module support
2024-10-31 11:34 [PATCH] efi/tpcm: Add TPCM module support chench246
@ 2025-05-14 12:12 ` hao chen
2025-05-15 19:26 ` Fwd " khaalid cali
0 siblings, 1 reply; 9+ messages in thread
From: hao chen @ 2025-05-14 12:12 UTC (permalink / raw)
To: grub-devel; +Cc: daniel.kiper
[-- Attachment #1.1: Type: text/plain, Size: 13820 bytes --]
[PATCH RESEND] efi/tpcm: Add TPCM module support
Hi GRUB maintainers,
I submitted the following patch a few months ago, but haven't yet received
any feedback.
Could someone kindly review it? Please let me know if there's anything I
can improve or clarify.
Thank you very much for your time!
Best regards,
chench
---------- Forwarded message ---------
发件人: chench246 <chench246@gmail.com>
Date: 2024年10月31日周四 19:35
Subject: [PATCH] efi/tpcm: Add TPCM module support
To: <grub-devel@gnu.org>
Cc: chench246 <chench246@hotmail.com>, hao chen <chench246@gmail.com>
From: chench246 <chench246@hotmail.com>
TPCM(Trusted Platform Control Module) is a Chinese standard and has similar
function
to tpm, but tpcm adds the function of active monitoring and control to the
system.
It can realize active startup measurement when the system starts,as well as
dynamic
measurement and monitoring when the program is running, further enhance the
security
of the system.
Signed-off-by: hao chen <chench246@gmail.com>
---
grub-core/Makefile.core.def | 7 ++
grub-core/commands/efi/tpcm.c | 163 ++++++++++++++++++++++++++++++++++
grub-core/commands/tpcm.c | 99 +++++++++++++++++++++
include/grub/efi/tpcm.h | 60 +++++++++++++
include/grub/err.h | 3 +-
5 files changed, 331 insertions(+), 1 deletion(-)
create mode 100755 grub-core/commands/efi/tpcm.c
create mode 100755 grub-core/commands/tpcm.c
create mode 100644 include/grub/efi/tpcm.h
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index 063ef5dd7..f1250601b 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -2562,6 +2562,13 @@ module = {
enable = efi;
};
+module = {
+ name = tpcm;
+ common = commands/tpcm.c;
+ efi = commands/efi/tpcm.c;
+ enable = x86_64_efi;
+};
+
module = {
name = tr;
common = commands/tr.c;
diff --git a/grub-core/commands/efi/tpcm.c b/grub-core/commands/efi/tpcm.c
new file mode 100755
index 000000000..bc97e800c
--- /dev/null
+++ b/grub-core/commands/efi/tpcm.c
@@ -0,0 +1,163 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2018 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * EFI TPCM support code.
+ */
+
+#include <grub/err.h>
+#include <grub/efi/tpcm.h>
+
+
+static grub_uint32_t g_measured_id = STAGE_START;
+
+/*
+ get_tpcm_stage:
+ TPCM does not make a distinction with the type of
+ measured target, so we use g_measured_id directly
+ for the stage.
+ */
+static grub_uint32_t get_tpcm_stage(void)
+{
+ grub_uint32_t stage = STAGE_INVALID;
+
+ stage = g_measured_id;
+
+ if (stage < STAGE_START || stage > STAGE_END)
+ stage = STAGE_INVALID;
+
+ return stage;
+}
+
+/*
+ update_measured_id:
+ update g_measured_id +1 every time measured, and g_measured_id
+ will never be decreased.
+ */
+static void update_measured_id(void)
+{
+ g_measured_id++;
+}
+
+/*
+ measure_memory:
+ measure the memery region--(addr, size) through the TPCM protocol.
+ if TPCM protocol is not exist in BIOS, it will return SUCC to keep
+ compatible with non-measurement-support bios; if TPCM protocol is
+ exist but not enabled, it will also return SUCC.
+ */
+static grub_err_t measure_memory(enum grub_file_type type
__attribute__((unused)),
+ char *desc,
+ grub_addr_t addr,
+ grub_size_t size)
+{
+ grub_efi_handle_t *handles = 0;
+ grub_efi_uintn_t num_handles;
+ grub_efi_handle_t grub_c2p_handle = 0;
+ grub_err_t test_c2p_err = GRUB_ERR_BAD_OS;
+ grub_guid_t c2p_guid = C2PGUID;
+ grub_uint32_t measure_result = 0;
+ grub_uint32_t control_result = 0;
+ grub_efi_boolean_t verify_enable = 0;
+ grub_size_t desc_len = 0;
+
+ handles = grub_efi_locate_handle(GRUB_EFI_BY_PROTOCOL, &c2p_guid,
NULL, &num_handles);
+ if (handles && (num_handles > 0))
+ {
+ struct c2p_protocol *c2p;
+
+ grub_c2p_handle = handles[0];
+ grub_dprintf ("tpcm", "measue memory addr 0x%lx size 0x%lx \n",
addr, size);
+ c2p = grub_efi_open_protocol(grub_c2p_handle, &c2p_guid,
+ GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
+ if (c2p)
+ {
+ verify_enable = c2p->verify_is_enabled (c2p);
+ if (verify_enable)
+ {
+ struct addr_range range;
+ grub_efi_status_t status = 0;
+ grub_uint32_t stage = STAGE_INVALID;
+
+ range.start = addr;
+ range.length = size;
+
+ stage = get_tpcm_stage();
+ if (stage != STAGE_INVALID)
+ {
+ desc_len = grub_strlen(desc) + 1;
+ status = c2p->verify_raw (c2p, stage,
(grub_uint64_t)desc, desc_len, 1, &range, &measure_result, &control_result);
+ if ((!status) && ((control_result &
MEASURE_ACTION_MASK) == 0) )
+ {
+ grub_dprintf ("tpcm", "verify_raw success.
stage[%d]desc:[%s]\n", stage, desc);
+ test_c2p_err = GRUB_ERR_NONE;
+ }
+ else
+ {
+ grub_dprintf ("tpcm", "verify_raw error\n");
+ while(1)
+ {
+ grub_error (GRUB_ERR_TPCM_VERIFY, "tpcm verify
error. stage[%d]desc[%s]\n", stage, desc);
+ asm volatile ("hlt");
+ }
+ }
+ }
+ else {
+ grub_dprintf ("tpcm", "invalid stage\n");
+ }
+
+ update_measured_id();
+
+ }
+ else {
+ grub_dprintf ("tpcm", "image verify not enabled\n");
+ test_c2p_err = GRUB_ERR_NONE;
+ }
+ }
+ else
+ grub_dprintf ("tpcm", "open c2p protocol failed\n");
+ }
+ else
+ {
+ /* keep compatible with non-measurement-support bios. */
+ grub_dprintf ("tpcm", "not found C2P protocol\n");
+ test_c2p_err = GRUB_ERR_NONE;
+ }
+
+ return test_c2p_err;
+}
+
+/*
+ grub_tpcm_measure_memory:
+ */
+grub_err_t grub_tpcm_measure_memory(void *context, grub_addr_t buf,
grub_size_t size)
+{
+ char *p_context = (char *)context;
+ char *p, *p_desc;
+ char tmp[TPCM_MAX_BUF_SIZE] = {'0'};
+ enum grub_file_type type;
+
+ if (!p_context)
+ return GRUB_ERR_BUG;
+
+ p = grub_strchr(p_context, '|');
+ p_desc = p + 1;
+ grub_memcpy(tmp, p_context, (p-p_context));
+ type = grub_strtoul(tmp, 0, 10);
+
+ return measure_memory(type, p_desc, buf, size);
+}
+
diff --git a/grub-core/commands/tpcm.c b/grub-core/commands/tpcm.c
new file mode 100755
index 000000000..1c8bd77ce
--- /dev/null
+++ b/grub-core/commands/tpcm.c
@@ -0,0 +1,99 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2018 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Core TPCM support code.
+ */
+
+#include <grub/err.h>
+#include <grub/verify.h>
+#include <grub/dl.h>
+#include <grub/efi/tpcm.h>
+
+GRUB_MOD_LICENSE ("GPLv3+");
+
+static char context_buf[TPCM_MAX_BUF_SIZE];
+
+static grub_err_t grub_tpcm_verify_init(grub_file_t io,
+ enum grub_file_type type,
+ void **context,
+ enum grub_verify_flags *flags)
+{
+ grub_memset(context_buf, 0, TPCM_MAX_BUF_SIZE);
+ grub_snprintf(context_buf, TPCM_MAX_BUF_SIZE, "%d|%s", (type &
GRUB_FILE_TYPE_MASK), io->name);
+ *context = context_buf;
+ *flags |= GRUB_VERIFY_FLAGS_SINGLE_CHUNK;
+
+ return GRUB_ERR_NONE;
+}
+
+static grub_err_t grub_tpcm_verify_write(void *context, void *buf ,
grub_size_t size )
+{
+ return grub_tpcm_measure_memory(context, (grub_addr_t)buf, size);
+}
+
+static grub_err_t grub_tpcm_verify_string (char *str, enum
grub_verify_string_type type)
+{
+ const char *prefix = NULL;
+ char *description, *context;
+ grub_err_t status;
+
+ switch (type)
+ {
+ case GRUB_VERIFY_KERNEL_CMDLINE:
+ prefix = "kernel_cmdline: ";
+ break;
+ case GRUB_VERIFY_MODULE_CMDLINE:
+ prefix = "module_cmdline: ";
+ break;
+ case GRUB_VERIFY_COMMAND:
+ prefix = "grub_cmd: ";
+ break;
+ }
+
+ context = grub_zalloc(grub_strlen (str) + grub_strlen (prefix) + 1 +
4); /* 4 for type */
+ if (!context)
+ return grub_errno;
+
+ grub_snprintf(context, 4, "%d|", (type & GRUB_FILE_TYPE_MASK));
+ description = context + grub_strlen(context);
+ grub_memcpy(description, prefix, grub_strlen (prefix));
+ grub_memcpy(description + grub_strlen (prefix), str, grub_strlen (str)
+ 1);
+
+ status = grub_tpcm_measure_memory(context, (grub_addr_t)str,
grub_strlen(str));
+
+ grub_free(context);
+
+ return status;
+}
+
+struct grub_file_verifier grub_tpcm_verifier = {
+ .name = "tpcm",
+ .init = grub_tpcm_verify_init,
+ .write = grub_tpcm_verify_write,
+ .verify_string = grub_tpcm_verify_string,
+};
+
+GRUB_MOD_INIT (tpcm)
+{
+ grub_verifier_register(&grub_tpcm_verifier);
+}
+
+GRUB_MOD_FINI (tpcm)
+{
+ grub_verifier_unregister(&grub_tpcm_verifier);
+}
+
diff --git a/include/grub/efi/tpcm.h b/include/grub/efi/tpcm.h
new file mode 100644
index 000000000..a4e0c765a
--- /dev/null
+++ b/include/grub/efi/tpcm.h
@@ -0,0 +1,60 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2018 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GRUB_EFI_TPCM_HEADER
+#define GRUB_EFI_TPCM_HEADER 1
+
+#include <grub/file.h>
+#include <grub/efi/api.h>
+#include <grub/efi/efi.h>
+
+#define C2PGUID {0xf89ab5cd, 0x2829, 0x422f, {0xa5, 0xf3, 0x03,
0x28, 0xe0, 0x6c, 0xfc, 0xbb}}
+#define MEASURE_RESULT_MASK (0xff00)
+#define MEASURE_RESULT_SHIFT (16)
+#define MEASURE_ACTION_MASK (0x1)
+#define TPCM_MAX_BUF_SIZE 128
+
+/*
+ stage layout:
+ 2000~2999: +1 every time
+*/
+
+#define STAGE_START 2000
+#define STAGE_END 2999
+#define STAGE_INVALID 3000
+
+struct addr_range {
+ grub_uint64_t start;
+ grub_uint64_t length;
+};
+struct c2p_protocol {
+ grub_efi_status_t (__grub_efi_api *verify_raw) (struct c2p_protocol
*this,
+ grub_uint32_t measure_stage,
+ grub_uint64_t image_info,
+ grub_uint32_t image_info_size,
+ grub_uint32_t num_addr_range,
+ struct addr_range ranges[],
+ grub_uint32_t *measure_result,
+ grub_uint32_t *control_result);
+ grub_efi_boolean_t (__grub_efi_api *verify_is_enabled)(struct
c2p_protocol *this);
+};
+typedef struct c2p_protocol c2p_protocol_t;
+
+grub_err_t grub_tpcm_measure_memory(void *context, grub_addr_t buf,
grub_size_t size);
+
+#endif
diff --git a/include/grub/err.h b/include/grub/err.h
index 1c07034cd..f5268dd47 100644
--- a/include/grub/err.h
+++ b/include/grub/err.h
@@ -73,7 +73,8 @@ typedef enum
GRUB_ERR_NET_NO_DOMAIN,
GRUB_ERR_EOF,
GRUB_ERR_BAD_SIGNATURE,
- GRUB_ERR_BAD_FIRMWARE
+ GRUB_ERR_BAD_FIRMWARE,
+ GRUB_ERR_TPCM_VERIFY
}
grub_err_t;
--
2.17.1
[-- Attachment #1.2: Type: text/html, Size: 17725 bytes --]
[-- Attachment #2: Type: text/plain, Size: 141 bytes --]
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: Fwd [PATCH] efi/tpcm: Add TPCM module support
2025-05-14 12:12 ` Fwd: " hao chen
@ 2025-05-15 19:26 ` khaalid cali
2025-06-27 7:42 ` [RFC PATCH v2 0/2] efi/tpcm: Add Trusted Platform Control chench246
0 siblings, 1 reply; 9+ messages in thread
From: khaalid cali @ 2025-05-15 19:26 UTC (permalink / raw)
To: grub-devel; +Cc: Khalid Ali
From: Khalid Ali <khaliidcaliy@gmail.com>
> TPCM(Trusted Platform Control Module) is a Chinese standard and has similar function
> to tpm, but tpcm adds the function of active monitoring and control to the system.
> It can realize active startup measurement when the system starts,as well as dynamic
> measurement and monitoring when the program is running, further enhance the security
> of the system.
Hi, Sorry for unresponsiveness.
The standard you are introducing seems less common, i assume it is a preprietary standard. If it is a preprietary unfortunately, it may not be accepted. If you don't mind if i ask you:
* Can't TPM become enough for us.
* You are working on UEFI, it should be present on official UEFI documentation hosted on https://uefi.org, otherwise on BIOS it must be publicly documented online.
* Do all or most computer support that standard, if it is chip like TPM, is it present on computers made by notable vendors.
And could you please break your patches into smaller, it will make review easier, send each source file seperately. I will suggest you to send an RFC that includes a detailed technical
information. mostly those question i asked you, and most importantly please supply sources and links to the official specification.
Best regards,
khaalid
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [RFC PATCH v2 0/2] efi/tpcm: Add Trusted Platform Control
2025-05-15 19:26 ` Fwd " khaalid cali
@ 2025-06-27 7:42 ` chench246
2025-06-27 7:42 ` [PATCH v2 1/2] efi/tpcm: Add UEFI interface for TPCM module chench246
2025-06-27 7:42 ` [PATCH v2 2/2] efi/tpcm: Add complete support of " chench246
0 siblings, 2 replies; 9+ messages in thread
From: chench246 @ 2025-06-27 7:42 UTC (permalink / raw)
To: grub-devel; +Cc: khaliidcaliy, chench246
Hi, Khaalid
This series adds basic support for the Trusted Platform Control Module
(TPCM) to the EFI build of GRUB. TPCM is an open specification
(GB/T 40650-2021) that extends TPM with active runtime measurement,
enabling continuous attestation on devices that must comply with the
"Level-3 Enhanced Security" guideline in china. Reference link:
https://std.samr.gov.cn/gb/search/gbDetailed?id=CE1E6A1DD5DA58F6E0539
7BE0A0A68DF
If tpcm related protocol is not implemented in UEFI, then tpcm module
directly returns NONE, keep compatible with non-measurement-support
UEFI. TPCM is still developing, and we will actively push tpcm function
into UEFI specification in the near future.
Some BIOS manufacturers such as Insyde, Byo, etc. have added support
for tpcm, and some OEM manufacturers such as Lenovo, Inspur, H3C, etc.
have enabled tpcm on related products.
### Key capabilities introduced:
* Probe the EFI TPCM protocol (GUID F89AB5CD-2829-422F-A5F3-0328E06C
FCBB)
* Provide `grub_tpcm_verify_init`, `grub_tpcm_verify_write`,
`grub_tpcm_verify_string` commands
### Changes since v1
* Split monolithic patch into 2 logical pieces
Thanks for the review and split suggestion.
Feedback welcome!
Best regards
chench246 (2):
efi/tpcm: Add UEFI interface for TPCM module
efi/tpcm: Add complete support of TPCM module
grub-core/Makefile.core.def | 7 ++
grub-core/commands/efi/tpcm.c | 163 ++++++++++++++++++++++++++++++++++
grub-core/commands/tpcm.c | 99 +++++++++++++++++++++
include/grub/efi/tpcm.h | 60 +++++++++++++
include/grub/err.h | 3 +-
5 files changed, 331 insertions(+), 1 deletion(-)
create mode 100755 grub-core/commands/efi/tpcm.c
create mode 100755 grub-core/commands/tpcm.c
create mode 100644 include/grub/efi/tpcm.h
--
2.17.1
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/2] efi/tpcm: Add UEFI interface for TPCM module
2025-06-27 7:42 ` [RFC PATCH v2 0/2] efi/tpcm: Add Trusted Platform Control chench246
@ 2025-06-27 7:42 ` chench246
2025-06-27 14:21 ` Sudhakar Kuppusamy
2025-06-27 7:42 ` [PATCH v2 2/2] efi/tpcm: Add complete support of " chench246
1 sibling, 1 reply; 9+ messages in thread
From: chench246 @ 2025-06-27 7:42 UTC (permalink / raw)
To: grub-devel; +Cc: khaliidcaliy, chench246
TPCM(Trusted Platform Control Module) is a Chinese standard, and
the interface implementation complies with UEFI specification. If
tpcm related protocol is not implemented in UEFI, then tpcm module
directly returns NONE.
Signed-off-by: hao chen <chench246@gmail.com>
---
grub-core/commands/efi/tpcm.c | 163 ++++++++++++++++++++++++++++++++++
include/grub/efi/tpcm.h | 60 +++++++++++++
include/grub/err.h | 3 +-
3 files changed, 225 insertions(+), 1 deletion(-)
create mode 100755 grub-core/commands/efi/tpcm.c
create mode 100644 include/grub/efi/tpcm.h
diff --git a/grub-core/commands/efi/tpcm.c b/grub-core/commands/efi/tpcm.c
new file mode 100755
index 000000000..bc97e800c
--- /dev/null
+++ b/grub-core/commands/efi/tpcm.c
@@ -0,0 +1,163 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2018 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * EFI TPCM support code.
+ */
+
+#include <grub/err.h>
+#include <grub/efi/tpcm.h>
+
+
+static grub_uint32_t g_measured_id = STAGE_START;
+
+/*
+ get_tpcm_stage:
+ TPCM does not make a distinction with the type of
+ measured target, so we use g_measured_id directly
+ for the stage.
+ */
+static grub_uint32_t get_tpcm_stage(void)
+{
+ grub_uint32_t stage = STAGE_INVALID;
+
+ stage = g_measured_id;
+
+ if (stage < STAGE_START || stage > STAGE_END)
+ stage = STAGE_INVALID;
+
+ return stage;
+}
+
+/*
+ update_measured_id:
+ update g_measured_id +1 every time measured, and g_measured_id
+ will never be decreased.
+ */
+static void update_measured_id(void)
+{
+ g_measured_id++;
+}
+
+/*
+ measure_memory:
+ measure the memery region--(addr, size) through the TPCM protocol.
+ if TPCM protocol is not exist in BIOS, it will return SUCC to keep
+ compatible with non-measurement-support bios; if TPCM protocol is
+ exist but not enabled, it will also return SUCC.
+ */
+static grub_err_t measure_memory(enum grub_file_type type __attribute__((unused)),
+ char *desc,
+ grub_addr_t addr,
+ grub_size_t size)
+{
+ grub_efi_handle_t *handles = 0;
+ grub_efi_uintn_t num_handles;
+ grub_efi_handle_t grub_c2p_handle = 0;
+ grub_err_t test_c2p_err = GRUB_ERR_BAD_OS;
+ grub_guid_t c2p_guid = C2PGUID;
+ grub_uint32_t measure_result = 0;
+ grub_uint32_t control_result = 0;
+ grub_efi_boolean_t verify_enable = 0;
+ grub_size_t desc_len = 0;
+
+ handles = grub_efi_locate_handle(GRUB_EFI_BY_PROTOCOL, &c2p_guid, NULL, &num_handles);
+ if (handles && (num_handles > 0))
+ {
+ struct c2p_protocol *c2p;
+
+ grub_c2p_handle = handles[0];
+ grub_dprintf ("tpcm", "measue memory addr 0x%lx size 0x%lx \n", addr, size);
+ c2p = grub_efi_open_protocol(grub_c2p_handle, &c2p_guid,
+ GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
+ if (c2p)
+ {
+ verify_enable = c2p->verify_is_enabled (c2p);
+ if (verify_enable)
+ {
+ struct addr_range range;
+ grub_efi_status_t status = 0;
+ grub_uint32_t stage = STAGE_INVALID;
+
+ range.start = addr;
+ range.length = size;
+
+ stage = get_tpcm_stage();
+ if (stage != STAGE_INVALID)
+ {
+ desc_len = grub_strlen(desc) + 1;
+ status = c2p->verify_raw (c2p, stage, (grub_uint64_t)desc, desc_len, 1, &range, &measure_result, &control_result);
+ if ((!status) && ((control_result & MEASURE_ACTION_MASK) == 0) )
+ {
+ grub_dprintf ("tpcm", "verify_raw success. stage[%d]desc:[%s]\n", stage, desc);
+ test_c2p_err = GRUB_ERR_NONE;
+ }
+ else
+ {
+ grub_dprintf ("tpcm", "verify_raw error\n");
+ while(1)
+ {
+ grub_error (GRUB_ERR_TPCM_VERIFY, "tpcm verify error. stage[%d]desc[%s]\n", stage, desc);
+ asm volatile ("hlt");
+ }
+ }
+ }
+ else {
+ grub_dprintf ("tpcm", "invalid stage\n");
+ }
+
+ update_measured_id();
+
+ }
+ else {
+ grub_dprintf ("tpcm", "image verify not enabled\n");
+ test_c2p_err = GRUB_ERR_NONE;
+ }
+ }
+ else
+ grub_dprintf ("tpcm", "open c2p protocol failed\n");
+ }
+ else
+ {
+ /* keep compatible with non-measurement-support bios. */
+ grub_dprintf ("tpcm", "not found C2P protocol\n");
+ test_c2p_err = GRUB_ERR_NONE;
+ }
+
+ return test_c2p_err;
+}
+
+/*
+ grub_tpcm_measure_memory:
+ */
+grub_err_t grub_tpcm_measure_memory(void *context, grub_addr_t buf, grub_size_t size)
+{
+ char *p_context = (char *)context;
+ char *p, *p_desc;
+ char tmp[TPCM_MAX_BUF_SIZE] = {'0'};
+ enum grub_file_type type;
+
+ if (!p_context)
+ return GRUB_ERR_BUG;
+
+ p = grub_strchr(p_context, '|');
+ p_desc = p + 1;
+ grub_memcpy(tmp, p_context, (p-p_context));
+ type = grub_strtoul(tmp, 0, 10);
+
+ return measure_memory(type, p_desc, buf, size);
+}
+
diff --git a/include/grub/efi/tpcm.h b/include/grub/efi/tpcm.h
new file mode 100644
index 000000000..a4e0c765a
--- /dev/null
+++ b/include/grub/efi/tpcm.h
@@ -0,0 +1,60 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2018 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GRUB_EFI_TPCM_HEADER
+#define GRUB_EFI_TPCM_HEADER 1
+
+#include <grub/file.h>
+#include <grub/efi/api.h>
+#include <grub/efi/efi.h>
+
+#define C2PGUID {0xf89ab5cd, 0x2829, 0x422f, {0xa5, 0xf3, 0x03, 0x28, 0xe0, 0x6c, 0xfc, 0xbb}}
+#define MEASURE_RESULT_MASK (0xff00)
+#define MEASURE_RESULT_SHIFT (16)
+#define MEASURE_ACTION_MASK (0x1)
+#define TPCM_MAX_BUF_SIZE 128
+
+/*
+ stage layout:
+ 2000~2999: +1 every time
+*/
+
+#define STAGE_START 2000
+#define STAGE_END 2999
+#define STAGE_INVALID 3000
+
+struct addr_range {
+ grub_uint64_t start;
+ grub_uint64_t length;
+};
+struct c2p_protocol {
+ grub_efi_status_t (__grub_efi_api *verify_raw) (struct c2p_protocol *this,
+ grub_uint32_t measure_stage,
+ grub_uint64_t image_info,
+ grub_uint32_t image_info_size,
+ grub_uint32_t num_addr_range,
+ struct addr_range ranges[],
+ grub_uint32_t *measure_result,
+ grub_uint32_t *control_result);
+ grub_efi_boolean_t (__grub_efi_api *verify_is_enabled)(struct c2p_protocol *this);
+};
+typedef struct c2p_protocol c2p_protocol_t;
+
+grub_err_t grub_tpcm_measure_memory(void *context, grub_addr_t buf, grub_size_t size);
+
+#endif
diff --git a/include/grub/err.h b/include/grub/err.h
index 202fa8a7a..4d2756097 100644
--- a/include/grub/err.h
+++ b/include/grub/err.h
@@ -75,7 +75,8 @@ typedef enum
GRUB_ERR_BAD_SIGNATURE,
GRUB_ERR_BAD_FIRMWARE,
GRUB_ERR_STILL_REFERENCED,
- GRUB_ERR_RECURSION_DEPTH
+ GRUB_ERR_RECURSION_DEPTH,
+ GRUB_ERR_TPCM_VERIFY
}
grub_err_t;
--
2.17.1
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/2] efi/tpcm: Add complete support of TPCM module
2025-06-27 7:42 ` [RFC PATCH v2 0/2] efi/tpcm: Add Trusted Platform Control chench246
2025-06-27 7:42 ` [PATCH v2 1/2] efi/tpcm: Add UEFI interface for TPCM module chench246
@ 2025-06-27 7:42 ` chench246
2025-06-27 14:39 ` Sudhakar Kuppusamy
1 sibling, 1 reply; 9+ messages in thread
From: chench246 @ 2025-06-27 7:42 UTC (permalink / raw)
To: grub-devel; +Cc: khaliidcaliy, chench246
TPCM(Trusted Platform Control Module) is a Chinese standard and has similar function
to tpm, but tpcm adds the function of active monitoring and control to the system.
It can realize active startup measurement when the system starts,as well as dynamic
measurement and monitoring when the program is running, further enhance the security
of the system.
Signed-off-by: hao chen <chench246@gmail.com>
---
grub-core/Makefile.core.def | 7 +++
grub-core/commands/tpcm.c | 99 +++++++++++++++++++++++++++++++++++++
2 files changed, 106 insertions(+)
create mode 100755 grub-core/commands/tpcm.c
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index 24e8c8437..fc31dbca4 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -2600,6 +2600,13 @@ module = {
cppflags = '-I$(srcdir)/lib/tss2 -I$(srcdir)/lib/libtasn1-grub';
};
+module = {
+ name = tpcm;
+ common = commands/tpcm.c;
+ efi = commands/efi/tpcm.c;
+ enable = x86_64_efi;
+};
+
module = {
name = tr;
common = commands/tr.c;
diff --git a/grub-core/commands/tpcm.c b/grub-core/commands/tpcm.c
new file mode 100755
index 000000000..1c8bd77ce
--- /dev/null
+++ b/grub-core/commands/tpcm.c
@@ -0,0 +1,99 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2018 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Core TPCM support code.
+ */
+
+#include <grub/err.h>
+#include <grub/verify.h>
+#include <grub/dl.h>
+#include <grub/efi/tpcm.h>
+
+GRUB_MOD_LICENSE ("GPLv3+");
+
+static char context_buf[TPCM_MAX_BUF_SIZE];
+
+static grub_err_t grub_tpcm_verify_init(grub_file_t io,
+ enum grub_file_type type,
+ void **context,
+ enum grub_verify_flags *flags)
+{
+ grub_memset(context_buf, 0, TPCM_MAX_BUF_SIZE);
+ grub_snprintf(context_buf, TPCM_MAX_BUF_SIZE, "%d|%s", (type & GRUB_FILE_TYPE_MASK), io->name);
+ *context = context_buf;
+ *flags |= GRUB_VERIFY_FLAGS_SINGLE_CHUNK;
+
+ return GRUB_ERR_NONE;
+}
+
+static grub_err_t grub_tpcm_verify_write(void *context, void *buf , grub_size_t size )
+{
+ return grub_tpcm_measure_memory(context, (grub_addr_t)buf, size);
+}
+
+static grub_err_t grub_tpcm_verify_string (char *str, enum grub_verify_string_type type)
+{
+ const char *prefix = NULL;
+ char *description, *context;
+ grub_err_t status;
+
+ switch (type)
+ {
+ case GRUB_VERIFY_KERNEL_CMDLINE:
+ prefix = "kernel_cmdline: ";
+ break;
+ case GRUB_VERIFY_MODULE_CMDLINE:
+ prefix = "module_cmdline: ";
+ break;
+ case GRUB_VERIFY_COMMAND:
+ prefix = "grub_cmd: ";
+ break;
+ }
+
+ context = grub_zalloc(grub_strlen (str) + grub_strlen (prefix) + 1 + 4); /* 4 for type */
+ if (!context)
+ return grub_errno;
+
+ grub_snprintf(context, 4, "%d|", (type & GRUB_FILE_TYPE_MASK));
+ description = context + grub_strlen(context);
+ grub_memcpy(description, prefix, grub_strlen (prefix));
+ grub_memcpy(description + grub_strlen (prefix), str, grub_strlen (str) + 1);
+
+ status = grub_tpcm_measure_memory(context, (grub_addr_t)str, grub_strlen(str));
+
+ grub_free(context);
+
+ return status;
+}
+
+struct grub_file_verifier grub_tpcm_verifier = {
+ .name = "tpcm",
+ .init = grub_tpcm_verify_init,
+ .write = grub_tpcm_verify_write,
+ .verify_string = grub_tpcm_verify_string,
+};
+
+GRUB_MOD_INIT (tpcm)
+{
+ grub_verifier_register(&grub_tpcm_verifier);
+}
+
+GRUB_MOD_FINI (tpcm)
+{
+ grub_verifier_unregister(&grub_tpcm_verifier);
+}
+
--
2.17.1
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/2] efi/tpcm: Add UEFI interface for TPCM module
2025-06-27 7:42 ` [PATCH v2 1/2] efi/tpcm: Add UEFI interface for TPCM module chench246
@ 2025-06-27 14:21 ` Sudhakar Kuppusamy
0 siblings, 0 replies; 9+ messages in thread
From: Sudhakar Kuppusamy @ 2025-06-27 14:21 UTC (permalink / raw)
To: The development of GNU GRUB; +Cc: khaliidcaliy, chench246
> On 27 Jun 2025, at 1:12 PM, chench246 <chench246@gmail.com> wrote:
>
> TPCM(Trusted Platform Control Module) is a Chinese standard, and
> the interface implementation complies with UEFI specification. If
> tpcm related protocol is not implemented in UEFI, then tpcm module
> directly returns NONE.
>
> Signed-off-by: hao chen <chench246@gmail.com>
> ---
> grub-core/commands/efi/tpcm.c | 163 ++++++++++++++++++++++++++++++++++
> include/grub/efi/tpcm.h | 60 +++++++++++++
> include/grub/err.h | 3 +-
> 3 files changed, 225 insertions(+), 1 deletion(-)
> create mode 100755 grub-core/commands/efi/tpcm.c
> create mode 100644 include/grub/efi/tpcm.h
>
> diff --git a/grub-core/commands/efi/tpcm.c b/grub-core/commands/efi/tpcm.c
> new file mode 100755
> index 000000000..bc97e800c
> --- /dev/null
> +++ b/grub-core/commands/efi/tpcm.c
> @@ -0,0 +1,163 @@
> +/*
> + * GRUB -- GRand Unified Bootloader
> + * Copyright (C) 2018 Free Software Foundation, Inc.
> + *
> + * GRUB is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation, either version 3 of the License, or
> + * (at your option) any later version.
> + *
> + * GRUB is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
> + *
> + * EFI TPCM support code.
> + */
> +
> +#include <grub/err.h>
> +#include <grub/efi/tpcm.h>
> +
> +
> +static grub_uint32_t g_measured_id = STAGE_START;
> +
> +/*
> + get_tpcm_stage:
> + TPCM does not make a distinction with the type of
> + measured target, so we use g_measured_id directly
> + for the stage.
> + */
Hi hao chen,
For Multi line comments, follow like below. please correct it all the patches.
/*
* get_tpcm_stage:
* TPCM does not make a distinction with the type of measured target,
*. so we use g_measured_id directly for the stage.
*/
> +static grub_uint32_t get_tpcm_stage(void)
Use the space after function name and new line after return type like below. Please correct it all the patches.
static
grub_uint32_t get_tpcm_stage (void)
> +{
> + grub_uint32_t stage = STAGE_INVALID;
> +
> + stage = g_measured_id;
> +
> + if (stage < STAGE_START || stage > STAGE_END)
> + stage = STAGE_INVALID;
Correct the indentation here like
if (stage < STAGE_START || stage > STAGE_END)
stage = STAGE_INVALID;
> +
> + return stage;
> +}
> +
> +/*
> + update_measured_id:
> + update g_measured_id +1 every time measured, and g_measured_id
> + will never be decreased.
> + */
Same follow the multiline comments here
/*
* update_measured_id:
* update g_measured_id +1 every time measured, and g_measured_id
* will never be decreased.
*/
> +static void update_measured_id(void)
Use space after function name and newline after return type
static void
update_measured_id (void)
> +{
> + g_measured_id++;
> +}
> +
> +/*
> + measure_memory:
> + measure the memery region--(addr, size) through the TPCM protocol.
> + if TPCM protocol is not exist in BIOS, it will return SUCC to keep
> + compatible with non-measurement-support bios; if TPCM protocol is
> + exist but not enabled, it will also return SUCC.
> + */
Same follow the multiline comments here
> +static grub_err_t measure_memory(enum grub_file_type type __attribute__((unused)),
> + char *desc,
> + grub_addr_t addr,
> + grub_size_t size)
Use space after function name and newline after return type when defining, and correct the indentation issue. Like below
static grub_err_t
measure_memory (enum grub_file_type type __attribute__((unused)),
char *desc, grub_addr_t addr, grub_size_t size)
> +{
> + grub_efi_handle_t *handles = 0;
My suggestion for pointers, initialise with NULL and don’t use 0.
grub_efi_handle_t *handles = NULL;
> + grub_efi_uintn_t num_handles;
> + grub_efi_handle_t grub_c2p_handle = 0;
> + grub_err_t test_c2p_err = GRUB_ERR_BAD_OS;
> + grub_guid_t c2p_guid = C2PGUID;
> + grub_uint32_t measure_result = 0;
> + grub_uint32_t control_result = 0;
> + grub_efi_boolean_t verify_enable = 0;
For boolean, initialize with true/false
grub_efi_boolean_t verify_enable = false;
> + grub_size_t desc_len = 0;
> +
> + handles = grub_efi_locate_handle(GRUB_EFI_BY_PROTOCOL, &c2p_guid, NULL, &num_handles);
> + if (handles && (num_handles > 0))
For pointers, check like handles != NULL. Please follow every where.
> + {
> + struct c2p_protocol *c2p;
> +
> + grub_c2p_handle = handles[0];
> + grub_dprintf ("tpcm", "measue memory addr 0x%lx size 0x%lx \n", addr, size);
> + c2p = grub_efi_open_protocol(grub_c2p_handle, &c2p_guid,
> + GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
Use space after function name when calling and correct the indentation
c2p = grub_efi_open_protocol (grub_c2p_handle, &c2p_guid, GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
> + if (c2p)
If (c2p != NULL)
> + {
> + verify_enable = c2p->verify_is_enabled (c2p);
> + if (verify_enable)
For boolean, use true or false check
if (verify_enable == true)
> + {
> + struct addr_range range;
> + grub_efi_status_t status = 0;
> + grub_uint32_t stage = STAGE_INVALID;
> +
> + range.start = addr;
> + range.length = size;
> +
> + stage = get_tpcm_stage();
Use space after function name
stage = get_tpcm_stage ();
> + if (stage != STAGE_INVALID)
> + {
> + desc_len = grub_strlen(desc) + 1;
same space issue here
desc_len = grub_strlen (desc) + 1;
> + status = c2p->verify_raw (c2p, stage, (grub_uint64_t)desc, desc_len, 1, &range, &measure_result, &control_result);
> + if ((!status) && ((control_result & MEASURE_ACTION_MASK) == 0) )
> + {
> + grub_dprintf ("tpcm", "verify_raw success. stage[%d]desc:[%s]\n", stage, desc);
> + test_c2p_err = GRUB_ERR_NONE;
> + }
> + else
> + {
> + grub_dprintf ("tpcm", "verify_raw error\n");
> + while(1)
> + {
> + grub_error (GRUB_ERR_TPCM_VERIFY, "tpcm verify error. stage[%d]desc[%s]\n", stage, desc);
> + asm volatile ("hlt");
> + }
> + }
> + }
> + else {
> + grub_dprintf ("tpcm", "invalid stage\n");
> + }
Don’t need braces for single statement
else
grub_dprintf ("tpcm", "invalid stage\n");
> +
> + update_measured_id();
same space issue here
update_measured_id ();
>
> +
> + }
> + else {
> + grub_dprintf ("tpcm", "image verify not enabled\n");
> + test_c2p_err = GRUB_ERR_NONE;
> + }
Use braces like below
else
{
grub_dprintf ("tpcm", "image verify not enabled\n”);
test_c2p_err = GRUB_ERR_NONE;
}
> + }
> + else
> + grub_dprintf ("tpcm", "open c2p protocol failed\n");
> + }
> + else
> + {
> + /* keep compatible with non-measurement-support bios. */
> + grub_dprintf ("tpcm", "not found C2P protocol\n");
> + test_c2p_err = GRUB_ERR_NONE;
> + }
> +
> + return test_c2p_err;
> +}
> +
> +/*
> + grub_tpcm_measure_memory:
> + */
Use single line comments /* grub_tpcm_measure_memory */
> +grub_err_t grub_tpcm_measure_memory(void *context, grub_addr_t buf, grub_size_t size)
same space and new line issue here
grub_err_t
grub_tpcm_measure_memory (void *context, grub_addr_t buf, grub_size_t size)
> +{
> + char *p_context = (char *)context;
Use space like below
char *p_context = (char *) context;
> + char *p, *p_desc;
> + char tmp[TPCM_MAX_BUF_SIZE] = {'0'};
> + enum grub_file_type type;
> +
> + if (!p_context)
Use p_context == NULL
>
> + return GRUB_ERR_BUG;
> +
> + p = grub_strchr(p_context, '|');
same space issue here
p = grub_strchr (p_context, '|');
> + p_desc = p + 1;
> + grub_memcpy(tmp, p_context, (p-p_context));
same space issue here
grub_memcpy (tmp, p_context, (p - p_context));
> + type = grub_strtoul(tmp, 0, 10);
same space issue here
type = grub_strtoul (tmp, 0, 10);
> +
> + return measure_memory(type, p_desc, buf, size);
same space issue here
return measure_memory (type, p_desc, buf, size);
> +}
> +
> diff --git a/include/grub/efi/tpcm.h b/include/grub/efi/tpcm.h
> new file mode 100644
> index 000000000..a4e0c765a
> --- /dev/null
> +++ b/include/grub/efi/tpcm.h
> @@ -0,0 +1,60 @@
> +/*
> + * GRUB -- GRand Unified Bootloader
> + * Copyright (C) 2018 Free Software Foundation, Inc.
> + *
> + * GRUB is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation, either version 3 of the License, or
> + * (at your option) any later version.
> + *
> + * GRUB is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#ifndef GRUB_EFI_TPCM_HEADER
> +#define GRUB_EFI_TPCM_HEADER 1
> +
> +#include <grub/file.h>
> +#include <grub/efi/api.h>
> +#include <grub/efi/efi.h>
> +
> +#define C2PGUID {0xf89ab5cd, 0x2829, 0x422f, {0xa5, 0xf3, 0x03, 0x28, 0xe0, 0x6c, 0xfc, 0xbb}}
> +#define MEASURE_RESULT_MASK (0xff00)
> +#define MEASURE_RESULT_SHIFT (16)
> +#define MEASURE_ACTION_MASK (0x1)
> +#define TPCM_MAX_BUF_SIZE 128
My suggestion to align it like below
#define C2PGUID {0xf89ab5cd, 0x2829, 0x422f, {0xa5, 0xf3, 0x03, 0x28, 0xe0, 0x6c, 0xfc, 0xbb}}
#define MEASURE_RESULT_MASK (0xff00)
#define MEASURE_RESULT_SHIFT (16)
#define MEASURE_ACTION_MASK (0x1)
#define TPCM_MAX_BUF_SIZE 128
> +
> +/*
> + stage layout:
> + 2000~2999: +1 every time
> +*/
>
Follow the multiline comments
> +#define STAGE_START 2000
> +#define STAGE_END 2999
> +#define STAGE_INVALID 3000
My suggestion to align it like below
#define STAGE_START 2000
#define STAGE_END 2999
#define STAGE_INVALID 3000
> +
> +struct addr_range {
> + grub_uint64_t start;
> + grub_uint64_t length;
> +};
> +struct c2p_protocol {
> + grub_efi_status_t (__grub_efi_api *verify_raw) (struct c2p_protocol *this,
> + grub_uint32_t measure_stage,
> + grub_uint64_t image_info,
> + grub_uint32_t image_info_size,
> + grub_uint32_t num_addr_range,
> + struct addr_range ranges[],
> + grub_uint32_t *measure_result,
> + grub_uint32_t *control_result);
> + grub_efi_boolean_t (__grub_efi_api *verify_is_enabled)(struct c2p_protocol *this);
> +};
> +typedef struct c2p_protocol c2p_protocol_t;
> +
> +grub_err_t grub_tpcm_measure_memory(void *context, grub_addr_t buf, grub_size_t size);
Use the space after the function name and newline after return type when declaring or define it.
grub_err_t
grub_tpcm_measure_memory (void *context, grub_addr_t buf, grub_size_t size);
> +
> +#endif
> diff --git a/include/grub/err.h b/include/grub/err.h
> index 202fa8a7a..4d2756097 100644
> --- a/include/grub/err.h
> +++ b/include/grub/err.h
> @@ -75,7 +75,8 @@ typedef enum
> GRUB_ERR_BAD_SIGNATURE,
> GRUB_ERR_BAD_FIRMWARE,
> GRUB_ERR_STILL_REFERENCED,
> - GRUB_ERR_RECURSION_DEPTH
> + GRUB_ERR_RECURSION_DEPTH,
> + GRUB_ERR_TPCM_VERIFY
Correct the indentation here
> }
> grub_err_t;
>
> --
> 2.17.1
>
Thanks,
Sudhakar
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 2/2] efi/tpcm: Add complete support of TPCM module
2025-06-27 7:42 ` [PATCH v2 2/2] efi/tpcm: Add complete support of " chench246
@ 2025-06-27 14:39 ` Sudhakar Kuppusamy
0 siblings, 0 replies; 9+ messages in thread
From: Sudhakar Kuppusamy @ 2025-06-27 14:39 UTC (permalink / raw)
To: The development of GNU GRUB; +Cc: khaliidcaliy, chench246
> On 27 Jun 2025, at 1:12 PM, chench246 <chench246@gmail.com> wrote:
>
> TPCM(Trusted Platform Control Module) is a Chinese standard and has similar function
> to tpm, but tpcm adds the function of active monitoring and control to the system.
> It can realize active startup measurement when the system starts,as well as dynamic
> measurement and monitoring when the program is running, further enhance the security
> of the system.
>
> Signed-off-by: hao chen <chench246@gmail.com>
> ---
> grub-core/Makefile.core.def | 7 +++
> grub-core/commands/tpcm.c | 99 +++++++++++++++++++++++++++++++++++++
> 2 files changed, 106 insertions(+)
> create mode 100755 grub-core/commands/tpcm.c
>
> diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
> index 24e8c8437..fc31dbca4 100644
> --- a/grub-core/Makefile.core.def
> +++ b/grub-core/Makefile.core.def
> @@ -2600,6 +2600,13 @@ module = {
> cppflags = '-I$(srcdir)/lib/tss2 -I$(srcdir)/lib/libtasn1-grub';
> };
>
> +module = {
> + name = tpcm;
> + common = commands/tpcm.c;
> + efi = commands/efi/tpcm.c;
> + enable = x86_64_efi;
> +};
> +
> module = {
> name = tr;
> common = commands/tr.c;
> diff --git a/grub-core/commands/tpcm.c b/grub-core/commands/tpcm.c
> new file mode 100755
> index 000000000..1c8bd77ce
> --- /dev/null
> +++ b/grub-core/commands/tpcm.c
> @@ -0,0 +1,99 @@
> +/*
> + * GRUB -- GRand Unified Bootloader
> + * Copyright (C) 2018 Free Software Foundation, Inc.
> + *
> + * GRUB is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation, either version 3 of the License, or
> + * (at your option) any later version.
> + *
> + * GRUB is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Core TPCM support code.
> + */
> +
> +#include <grub/err.h>
> +#include <grub/verify.h>
> +#include <grub/dl.h>
> +#include <grub/efi/tpcm.h>
> +
> +GRUB_MOD_LICENSE ("GPLv3+");
> +
> +static char context_buf[TPCM_MAX_BUF_SIZE];
> +
> +static grub_err_t grub_tpcm_verify_init(grub_file_t io,
> + enum grub_file_type type,
> + void **context,
> + enum grub_verify_flags *flags)
Hi hao chen,
Please use the single space after function name and newline after return type when declare and defining function. Correct it every where.
static grub_err_t
grub_tpcm_verify_init (grub_file_t io, enum grub_file_type type, void **context,
enum grub_verify_flags *flags)
> +{
> + grub_memset(context_buf, 0, TPCM_MAX_BUF_SIZE);
Use single space after function name when calling the function
grub_memset (context_buf, 0, TPCM_MAX_BUF_SIZE);
> + grub_snprintf(context_buf, TPCM_MAX_BUF_SIZE, "%d|%s", (type & GRUB_FILE_TYPE_MASK), io->name);
Use space before ()
> + *context = context_buf;
> + *flags |= GRUB_VERIFY_FLAGS_SINGLE_CHUNK;
> +
> + return GRUB_ERR_NONE;
> +}
> +
> +static grub_err_t grub_tpcm_verify_write(void *context, void *buf , grub_size_t size )
Use it like
static grub_err_t
grub_tpcm_verify_write (void *context, void *buf , grub_size_t size )
> +{
> + return grub_tpcm_measure_memory(context, (grub_addr_t)buf, size);
> +}
> +
> +static grub_err_t grub_tpcm_verify_string (char *str, enum grub_verify_string_type type)
Use it like
static grub_err_t
grub_tpcm_verify_string (char *str, enum grub_verify_string_type type)
> +{
> + const char *prefix = NULL;
> + char *description, *context;
> + grub_err_t status;
> +
> + switch (type)
> + {
> + case GRUB_VERIFY_KERNEL_CMDLINE:
> + prefix = "kernel_cmdline: ";
> + break;
> + case GRUB_VERIFY_MODULE_CMDLINE:
> + prefix = "module_cmdline: ";
> + break;
> + case GRUB_VERIFY_COMMAND:
> + prefix = "grub_cmd: ";
> + break;
> + }
> +
> + context = grub_zalloc(grub_strlen (str) + grub_strlen (prefix) + 1 + 4); /* 4 for type */
Use space before () like
context = grub_zalloc (grub_strlen (str) + grub_strlen (prefix) + 1 + 4); /* 4 for type */
> + if (!context)
Use context != NULL
> + return grub_errno;
> +
> + grub_snprintf(context, 4, "%d|", (type & GRUB_FILE_TYPE_MASK));
> + description = context + grub_strlen(context);
> + grub_memcpy(description, prefix, grub_strlen (prefix));
> + grub_memcpy(description + grub_strlen (prefix), str, grub_strlen (str) + 1);
Use space before () for all the above functions
> +
> + status = grub_tpcm_measure_memory(context, (grub_addr_t)str, grub_strlen(str));
Use space before () like
status = grub_tpcm_measure_memory (context, (grub_addr_t) str, grub_strlen (str));
> +
> + grub_free(context);
> +
> + return status;
> +}
> +
> +struct grub_file_verifier grub_tpcm_verifier = {
> + .name = "tpcm",
> + .init = grub_tpcm_verify_init,
> + .write = grub_tpcm_verify_write,
> + .verify_string = grub_tpcm_verify_string,
> +};
> +
> +GRUB_MOD_INIT (tpcm)
> +{
> + grub_verifier_register(&grub_tpcm_verifier);
Use space before () like
grub_verifier_register (&grub_tpcm_verifier);
> +}
> +
> +GRUB_MOD_FINI (tpcm)
> +{
> + grub_verifier_unregister(&grub_tpcm_verifier);
Use space before () like
grub_verifier_unregister (&grub_tpcm_verifier);
> +}
> +
> --
> 2.17.1
>
Thanks,
Sudhakar
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFC PATCH v2 0/2] efi/tpcm: Add Trusted Platform Control
@ 2025-06-28 8:09 Khalid Ali
0 siblings, 0 replies; 9+ messages in thread
From: Khalid Ali @ 2025-06-28 8:09 UTC (permalink / raw)
To: grub-devel
> +/*
> + * GRUB -- GRand Unified Bootloader
> + * Copyright (C) 2018 Free Software Foundation, Inc.
> + *
> + * GRUB is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation, either version 3 of the License, or
> + * (at your option) any later version.
> + *
> + * GRUB is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
> + *
> + * EFI TPCM support code.
> + */
Please fix here, the copyright should be the year you submitted the patch (i.e this year 2025).
Other than that standard and patch seems solid.
Regards
Khaalid
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-06-28 8:11 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-31 11:34 [PATCH] efi/tpcm: Add TPCM module support chench246
2025-05-14 12:12 ` Fwd: " hao chen
2025-05-15 19:26 ` Fwd " khaalid cali
2025-06-27 7:42 ` [RFC PATCH v2 0/2] efi/tpcm: Add Trusted Platform Control chench246
2025-06-27 7:42 ` [PATCH v2 1/2] efi/tpcm: Add UEFI interface for TPCM module chench246
2025-06-27 14:21 ` Sudhakar Kuppusamy
2025-06-27 7:42 ` [PATCH v2 2/2] efi/tpcm: Add complete support of " chench246
2025-06-27 14:39 ` Sudhakar Kuppusamy
-- strict thread matches above, loose matches on Subject: below --
2025-06-28 8:09 [RFC PATCH v2 0/2] efi/tpcm: Add Trusted Platform Control Khalid Ali
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).