From patchwork Fri Jun 23 05:03:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 779788 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3wv5vY2w2kz9s81; Fri, 23 Jun 2017 15:03:53 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1dOGl6-00040D-7L; Fri, 23 Jun 2017 05:03:52 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1dOGl1-0003uy-71 for fwts-devel@lists.ubuntu.com; Fri, 23 Jun 2017 05:03:47 +0000 Received: from 1.general.alexhung.us.vpn ([10.172.65.254] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1dOGl0-0003Yd-Ho; Fri, 23 Jun 2017 05:03:46 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/2] fwts-test: add wsmt test Date: Thu, 22 Jun 2017 22:03:40 -0700 Message-Id: <1498194220-24377-2-git-send-email-alex.hung@canonical.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498194220-24377-1-git-send-email-alex.hung@canonical.com> References: <1498194220-24377-1-git-send-email-alex.hung@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com Signed-off-by: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- Makefile.am | 2 ++ fwts-test/wsmt-0001/acpidump-0001.log | 29 +++++++++++++++++++++++++++++ fwts-test/wsmt-0001/acpidump-0002.log | 30 ++++++++++++++++++++++++++++++ fwts-test/wsmt-0001/test-0001.sh | 23 +++++++++++++++++++++++ fwts-test/wsmt-0001/test-0002.sh | 23 +++++++++++++++++++++++ fwts-test/wsmt-0001/wsmt-0001.log | 13 +++++++++++++ fwts-test/wsmt-0001/wsmt-0002.log | 14 ++++++++++++++ 7 files changed, 134 insertions(+) create mode 100644 fwts-test/wsmt-0001/acpidump-0001.log create mode 100644 fwts-test/wsmt-0001/acpidump-0002.log create mode 100755 fwts-test/wsmt-0001/test-0001.sh create mode 100755 fwts-test/wsmt-0001/test-0002.sh create mode 100644 fwts-test/wsmt-0001/wsmt-0001.log create mode 100644 fwts-test/wsmt-0001/wsmt-0002.log diff --git a/Makefile.am b/Makefile.am index 65c9198..2729e39 100644 --- a/Makefile.am +++ b/Makefile.am @@ -155,6 +155,8 @@ TESTS = fwts-test/acpidump-0001/test-0001.sh \ fwts-test/wmi-0001/test-0001.sh \ fwts-test/wpbt-0001/test-0001.sh \ fwts-test/wpbt-0001/test-0002.sh \ + fwts-test/wsmt-0001/test-0001.sh \ + fwts-test/wsmt-0001/test-0002.sh \ fwts-test/wmi-0001/test-0002.sh \ fwts-test/wmi-0001/test-0003.sh \ fwts-test/xenv-0001/test-0001.sh \ diff --git a/fwts-test/wsmt-0001/acpidump-0001.log b/fwts-test/wsmt-0001/acpidump-0001.log new file mode 100644 index 0000000..a658e37 --- /dev/null +++ b/fwts-test/wsmt-0001/acpidump-0001.log @@ -0,0 +1,29 @@ +FACS @ 0x00000000 + 0000: 46 41 43 53 40 00 00 00 00 00 00 00 00 00 00 00 FACS@........... + 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0020: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + +FACP @ 0x00000000 + 0000: 46 41 43 50 f4 00 00 00 03 f9 41 4d 44 20 20 20 FACP......AMD + 0010: 47 55 41 4d 20 20 20 20 00 00 04 06 41 4d 44 20 GUAM ....AMD + 0020: 40 42 0f 00 c0 2f e9 af 92 47 e8 af 00 02 09 00 @B.../...G...... + 0030: b0 00 00 00 f0 f1 00 00 00 80 00 00 00 00 00 00 ................ + 0040: 04 80 00 00 00 00 00 00 00 82 00 00 08 80 00 00 ................ + 0050: 20 80 00 00 00 00 00 00 04 02 01 04 08 00 00 00 ............... + 0060: 65 00 e9 03 00 00 00 00 01 00 0d 00 32 00 00 00 e...........2... + 0070: a5 c1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0080: 00 00 00 00 c0 2f e9 af 00 00 00 00 92 47 e8 af ...../.......G.. + 0090: 00 00 00 00 01 20 00 00 00 80 00 00 00 00 00 00 ..... .......... + 00a0: 00 00 00 00 00 00 00 00 00 00 00 00 01 10 00 00 ................ + 00b0: 04 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00c0: 00 00 00 00 01 08 00 00 00 82 00 00 00 00 00 00 ................ + 00d0: 01 20 00 00 08 80 00 00 00 00 00 00 01 40 00 00 . ...........@.. + 00e0: 20 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ............... + 00f0: 00 00 00 00 .... + +WSMT @ 0x0000000000000000 + 0000: 57 53 4d 54 28 00 00 00 00 ea 49 4e 54 45 4c 20 WSMT(.....INTEL + 0010: 54 45 4d 50 4c 41 54 45 00 00 00 00 49 4e 54 4c TEMPLATE....INTL + 0020: 31 05 17 20 07 00 00 00 1.. .... diff --git a/fwts-test/wsmt-0001/acpidump-0002.log b/fwts-test/wsmt-0001/acpidump-0002.log new file mode 100644 index 0000000..45b4bce --- /dev/null +++ b/fwts-test/wsmt-0001/acpidump-0002.log @@ -0,0 +1,30 @@ +FACS @ 0x00000000 + 0000: 46 41 43 53 40 00 00 00 00 00 00 00 00 00 00 00 FACS@........... + 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0020: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + +FACP @ 0x00000000 + 0000: 46 41 43 50 f4 00 00 00 03 f9 41 4d 44 20 20 20 FACP......AMD + 0010: 47 55 41 4d 20 20 20 20 00 00 04 06 41 4d 44 20 GUAM ....AMD + 0020: 40 42 0f 00 c0 2f e9 af 92 47 e8 af 00 02 09 00 @B.../...G...... + 0030: b0 00 00 00 f0 f1 00 00 00 80 00 00 00 00 00 00 ................ + 0040: 04 80 00 00 00 00 00 00 00 82 00 00 08 80 00 00 ................ + 0050: 20 80 00 00 00 00 00 00 04 02 01 04 08 00 00 00 ............... + 0060: 65 00 e9 03 00 00 00 00 01 00 0d 00 32 00 00 00 e...........2... + 0070: a5 c1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0080: 00 00 00 00 c0 2f e9 af 00 00 00 00 92 47 e8 af ...../.......G.. + 0090: 00 00 00 00 01 20 00 00 00 80 00 00 00 00 00 00 ..... .......... + 00a0: 00 00 00 00 00 00 00 00 00 00 00 00 01 10 00 00 ................ + 00b0: 04 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00c0: 00 00 00 00 01 08 00 00 00 82 00 00 00 00 00 00 ................ + 00d0: 01 20 00 00 08 80 00 00 00 00 00 00 01 40 00 00 . ...........@.. + 00e0: 20 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ............... + 00f0: 00 00 00 00 .... + +WSMT @ 0x0000000000000000 + 0000: 57 53 4d 54 28 00 00 00 00 e8 49 4e 54 45 4c 20 WSMT(.....INTEL + 0010: 54 45 4d 50 4c 41 54 45 00 00 00 00 49 4e 54 4c TEMPLATE....INTL + 0020: 31 05 17 20 09 00 00 00 1.. .... + diff --git a/fwts-test/wsmt-0001/test-0001.sh b/fwts-test/wsmt-0001/test-0001.sh new file mode 100755 index 0000000..4175ff5 --- /dev/null +++ b/fwts-test/wsmt-0001/test-0001.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +TEST="Test apcitables against WSMT" +NAME=test-0001.sh +TMPLOG=$TMP/wsmt.log.$$ + +$FWTS --show-tests | grep wsmt > /dev/null +if [ $? -eq 1 ]; then + echo SKIP: $TEST, $NAME + exit 77 +fi + +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/wsmt-0001/acpidump-0001.log wsmt - | cut -c7- | grep "^wsmt" > $TMPLOG +diff $TMPLOG $FWTSTESTDIR/wsmt-0001/wsmt-0001.log >> $FAILURE_LOG +ret=$? +if [ $ret -eq 0 ]; then + echo PASSED: $TEST, $NAME +else + echo FAILED: $TEST, $NAME +fi + +rm $TMPLOG +exit $ret diff --git a/fwts-test/wsmt-0001/test-0002.sh b/fwts-test/wsmt-0001/test-0002.sh new file mode 100755 index 0000000..0faaf93 --- /dev/null +++ b/fwts-test/wsmt-0001/test-0002.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +TEST="Test apcitables against invalid WSMT" +NAME=test-0001.sh +TMPLOG=$TMP/wsmt.log.$$ + +$FWTS --show-tests | grep wsmt > /dev/null +if [ $? -eq 1 ]; then + echo SKIP: $TEST, $NAME + exit 77 +fi + +$FWTS --log-format="%line %owner " -w 80 --dumpfile=$FWTSTESTDIR/wsmt-0001/acpidump-0002.log wsmt - | cut -c7- | grep "^wsmt" > $TMPLOG +diff $TMPLOG $FWTSTESTDIR/wsmt-0001/wsmt-0002.log >> $FAILURE_LOG +ret=$? +if [ $ret -eq 0 ]; then + echo PASSED: $TEST, $NAME +else + echo FAILED: $TEST, $NAME +fi + +rm $TMPLOG +exit $ret diff --git a/fwts-test/wsmt-0001/wsmt-0001.log b/fwts-test/wsmt-0001/wsmt-0001.log new file mode 100644 index 0000000..d6bdbb2 --- /dev/null +++ b/fwts-test/wsmt-0001/wsmt-0001.log @@ -0,0 +1,13 @@ +wsmt wsmt: WSMT Windows SMM Security Mitigations Table test. +wsmt ---------------------------------------------------------- +wsmt Test 1 of 1: WSMT Windows SMM Security Mitigations Table +wsmt test. +wsmt WSMT Windows SMM Security Mitigations Table: +wsmt Protection Flags: 0x00000007 +wsmt +wsmt PASSED: Test 1, No issues found in WSMT table. +wsmt +wsmt ========================================================== +wsmt 1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0 +wsmt info only. +wsmt ========================================================== diff --git a/fwts-test/wsmt-0001/wsmt-0002.log b/fwts-test/wsmt-0001/wsmt-0002.log new file mode 100644 index 0000000..b862a8f --- /dev/null +++ b/fwts-test/wsmt-0001/wsmt-0002.log @@ -0,0 +1,14 @@ +wsmt wsmt: WSMT Windows SMM Security Mitigations Table test. +wsmt ---------------------------------------------------------- +wsmt Test 1 of 1: WSMT Windows SMM Security Mitigations Table +wsmt test. +wsmt WSMT Windows SMM Security Mitigations Table: +wsmt Protection Flags: 0x00000009 +wsmt FAILED [MEDIUM] WSMTFlagsReserved: Test 1, WSMT Protection +wsmt Flags reserved bits [3:31] must be zero, instead got 0x9 +wsmt +wsmt +wsmt ========================================================== +wsmt 0 passed, 1 failed, 0 warning, 0 aborted, 0 skipped, 0 +wsmt info only. +wsmt ==========================================================