[PATCH 4/6] uefi: uefidump: Add support for dumping MemoryOverwriteRequestControl.
Colin King
colin.king at canonical.com
Mon Sep 3 15:52:43 UTC 2012
From: Colin Ian King <colin.king at canonical.com>
The MemoryOverwriteRequestControl variable is defined in section 5.0
of the TCG Platform Reset Attack Mitigation Specification and it is
being used on various platforms. Add it to uefidump.
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/uefi/uefidump/uefidump.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
index 96d294c..8f4c788 100644
--- a/src/uefi/uefidump/uefidump.c
+++ b/src/uefi/uefidump/uefidump.c
@@ -573,6 +573,34 @@ static void uefidump_info_setup_mode(fwts_framework *fw, fwts_uefi_var *var)
}
}
+/*
+ * See TCG Platform Reset Attack Mitigation Specification, Revision 1.0,
+ * section 5.
+ */
+static void uefidump_info_morc(fwts_framework *fw, fwts_uefi_var *var)
+{
+ if (var->datalen != 1) {
+ /* Should be 1 byte, of not, dump it out as a hex dump */
+ uefidump_var_hexdump(fw, var);
+ } else {
+ char *mode;
+ uint8_t value = (uint8_t)var->data[0];
+
+ switch (value & 1) {
+ case 0:
+ mode = " (Firmware should not clear memory on reboot)";
+ break;
+ case 1:
+ mode = " (Firmware should clear memory on reboot)";
+ break;
+ default:
+ mode = "";
+ break;
+ }
+ fwts_log_info_verbatum(fw, " Value: 0x%2.2x%s.", value, mode);
+ }
+}
+
static uefidump_info uefidump_info_table[] = {
{ "PlatformLangCodes", uefidump_info_platform_langcodes },
{ "PlatformLang", uefidump_info_platform_lang },
@@ -594,6 +622,7 @@ static uefidump_info uefidump_info_table[] = {
{ "dump-type0-", uefidump_info_dump_type0 },
{ "SecureBoot", uefidump_info_secure_boot },
{ "SetupMode", uefidump_info_setup_mode },
+ { "MemoryOverwriteRequestControl", uefidump_info_morc },
{ NULL, NULL }
};
--
1.7.10.4
More information about the fwts-devel
mailing list