From patchwork Mon Sep 3 15:52:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 181377 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 722412C0093 for ; Tue, 4 Sep 2012 01:52:50 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1T8YwD-0003Ku-9h; Mon, 03 Sep 2012 15:51:45 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1T8YwB-0003KH-Nl for fwts-devel@lists.ubuntu.com; Mon, 03 Sep 2012 15:51:43 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginmedia.com ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1T8YxD-0006TC-K9 for fwts-devel@lists.ubuntu.com; Mon, 03 Sep 2012 15:52:47 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 4/6] uefi: uefidump: Add support for dumping MemoryOverwriteRequestControl. Date: Mon, 3 Sep 2012 16:52:43 +0100 Message-Id: <1346687565-32320-5-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1346687565-32320-1-git-send-email-colin.king@canonical.com> References: <1346687565-32320-1-git-send-email-colin.king@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King 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 Acked-by: Ivan Hu Acked-by: Keng-Yu Lin --- 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 } };