public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Abhimanyu Singh" <Abhi.Singh@arm.com>
To: devel@edk2.groups.io
Cc: Abhi Singh <Abhi.Singh@arm.com>,
	G Edhaya Chandran <Edhaya.Chandran@arm.com>,
	Barton Gao <gaojie@byosoft.com.cn>,
	Carolyn Gjertsen <Carolyn.Gjertsen@amd.com>,
	Stuart Yoder <Stuart.Yoder@arm.com>,
	Abhi Singh <abhi.singh@arm.com>
Subject: [edk2-devel] [PATCH v3 7/7] uefi-sct/SctPkg: TCG MOR & MORLOCK tests
Date: Wed, 14 Feb 2024 21:30:56 -0600	[thread overview]
Message-ID: <20240215033056.331060-8-Abhi.Singh@arm.com> (raw)
In-Reply-To: <20240215033056.331060-1-Abhi.Singh@arm.com>

SCT spec: https://bugzilla.tianocore.org/show_bug.cgi?id=4374

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4419

-relax acceptable EFI return codes to fit the edk2 implementation
 as well as the updates made to TCG Platform Reset Attack Spec.
  -changes made to test assertions 11, 31, and 45.
  -now accept either EFI_INVALID_PARAMETER or EFI_ACCESS_DENIED.

Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Barton Gao <gaojie@byosoft.com.cn>
Cc: Carolyn Gjertsen <Carolyn.Gjertsen@amd.com>
Cc: Stuart Yoder <Stuart.Yoder@arm.com>

Signed-off-by: Abhi Singh <abhi.singh@arm.com>
---
 uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestFunction.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestFunction.c
index 6406730c64ce..cbf3de3144ca 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestFunction.c
@@ -819,7 +819,7 @@ MORLOCK_SET_VARIABLE:
                   DataSize,                                    // DataSize
                   NULL                                         // Data
                   );
-  if (Status == EFI_INVALID_PARAMETER) {
+  if (Status == EFI_WRITE_PROTECTED || EFI_INVALID_PARAMETER) {
     Result = EFI_TEST_ASSERTION_PASSED;
   } else {
     Result = EFI_TEST_ASSERTION_FAILED;
@@ -829,7 +829,7 @@ MORLOCK_SET_VARIABLE:
                   StandardLib,
                   Result,
                   gTCGMemoryOverwriteRequestTestFunctionAssertionGuid011,
-                  L"MemoryOverwriteRequestControlLock - SetVariable() with Data parameter as NULL returns EFI_WRITE_PROTECTED",
+                  L"MemoryOverwriteRequestControlLock - SetVariable() with Data parameter as NULL returns either EFI_WRITE_PROTECTED or EFI_INVALID_PARAMETER",
                   L"%a:%d:Status - %r",
                   __FILE__,
                   (UINTN)__LINE__,
@@ -1624,7 +1624,7 @@ MORLOCK_LOCKED_STATE:
                   DataSize,                             // DataSize
                   &MemoryOverwriteRequestControlData    // Data
                   );
-  if (Status == EFI_ACCESS_DENIED) {
+  if (Status == EFI_ACCESS_DENIED || EFI_INVALID_PARAMETER) {
     Result = EFI_TEST_ASSERTION_PASSED;
   } else {
     Result = EFI_TEST_ASSERTION_FAILED;
@@ -1634,7 +1634,7 @@ MORLOCK_LOCKED_STATE:
                   StandardLib,
                   Result,
                   gTCGMemoryOverwriteRequestTestFunctionAssertionGuid031,
-                  L"MemoryOverwriteRequestControl - When MORLOCK is locked-without-key, an attempt to delete the MOR variable must return EFI_ACCESS_DENIED",
+                  L"MemoryOverwriteRequestControl - When MORLOCK is locked-without-key, an attempt to delete the MOR variable must return either EFI_ACCESS_DENIED or EFI_INVALID_PARAMETER",
                   L"%a:%d:Status - %r",
                   __FILE__,
                   (UINTN)__LINE__,
@@ -2148,7 +2148,7 @@ MORLOCK_LOCKED_KEY_STATE:
                   DataSize,                             // DataSize
                   &MemoryOverwriteRequestControlData    // Data
                   );
-  if (Status == EFI_ACCESS_DENIED) {
+  if (Status == EFI_ACCESS_DENIED || EFI_INVALID_PARAMETER) {
     Result = EFI_TEST_ASSERTION_PASSED;
   } else {
     Result = EFI_TEST_ASSERTION_FAILED;
@@ -2158,7 +2158,7 @@ MORLOCK_LOCKED_KEY_STATE:
                   StandardLib,
                   Result,
                   gTCGMemoryOverwriteRequestTestFunctionAssertionGuid045,
-                  L"MemoryOverwriteRequestControl - When MORLOCK is locked-with-key, an attempt to delete the MOR variable must return EFI_ACCESS_DENIED",
+                  L"MemoryOverwriteRequestControl - When MORLOCK is locked-with-key, an attempt to delete the MOR variable must return either EFI_ACCESS_DENIED or EFI_INVALID_PARAMETER",
                   L"%a:%d:Status - %r",
                   __FILE__,
                   (UINTN)__LINE__,
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115485): https://edk2.groups.io/g/devel/message/115485
Mute This Topic: https://groups.io/mt/104367136/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  parent reply	other threads:[~2024-02-15  3:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15  3:30 [edk2-devel] [PATCH v3 0/7] EDK2-TEST TCG MOR Tests Abhimanyu Singh
2024-02-15  3:30 ` [edk2-devel] [PATCH v3 1/7] uefi-sct/SctPkg: TCG Platform Reset Check Test Abhimanyu Singh
2024-02-15  3:30 ` [edk2-devel] [PATCH v3 2/7] uefi-sct/SctPkg: TCG MOR SetVariable Test Abhimanyu Singh
2024-02-15  3:30 ` [edk2-devel] [PATCH v3 3/7] uefi-sct/SctPkg: TCG MORLOCK " Abhimanyu Singh
2024-02-15  3:30 ` [edk2-devel] [PATCH v3 4/7] uefi-sct/SctPkg: TCG MORLOCK Unlocked State Test Abhimanyu Singh
2024-02-15  3:30 ` [edk2-devel] [PATCH v3 5/7] uefi-sct/SctPkg: TCG MORLOCK Locked No Key " Abhimanyu Singh
2024-02-15  3:30 ` [edk2-devel] [PATCH v3 6/7] uefi-sct/SctPkg: TCG MORLOCK Locked with " Abhimanyu Singh
2024-02-15  3:30 ` Abhimanyu Singh [this message]
2024-02-15 16:46 ` [edk2-devel] [PATCH v3 0/7] EDK2-TEST TCG MOR Tests Stuart Yoder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240215033056.331060-8-Abhi.Singh@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox