public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Stuart Yoder" <stuart.yoder@arm.com>
To: devel@edk2.groups.io, Abhi.Singh@arm.com
Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>,
	Barton Gao <gaojie@byosoft.com.cn>,
	Carolyn Gjertsen <Carolyn.Gjertsen@amd.com>
Subject: Re: [edk2-devel] [PATCH v2 6/6] uefi-sct/SctPkg: TCG MORLOCK Locked with Key State Test
Date: Thu, 21 Sep 2023 14:03:46 -0500	[thread overview]
Message-ID: <21b940cc-3d0e-ee7c-c718-1b977e699cbc@arm.com> (raw)
In-Reply-To: <20230921163748.275971-7-Abhi.Singh@arm.com>

See inline comments...


On 9/21/23 11:37 AM, Abhimanyu Singh via groups.io wrote:
> SCT spec: https://bugzilla.tianocore.org/show_bug.cgi?id=4374
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4419
> 
> -Implement MemoryOverwriteRequestControlLock Locked with
>   Key State test cases
>   -Add remaining Assertions 33 - 49 from SCT spec
>   -Add Test Case to MemoryOverwriteRequestFunctionTest
> 
> Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
> Cc: Barton Gao <gaojie@byosoft.com.cn>
> Cc: Carolyn Gjertsen <Carolyn.Gjertsen@amd.com>
> Signed-off-by: Abhi Singh <Abhi.Singh@arm.com>
> Change-Id: Ifade96b0c6ec9e7f9bfb0eba8ceeb92380271e8b
> ---

[cut]

> +  StandardLib->RecordAssertion (
> +                  StandardLib,
> +                  Result,
> +                  gTCGMemoryOverwriteRequestTestFunctionAssertionGuid044,
> +                  L"MemoryOverwriteRequestControl - SetVariable() returns EFI_ACCESS_DENIED when Lock is Set with no key",
> +                  L"%a:%d:Status - %r",
> +                  __FILE__,
> +                  (UINTN)__LINE__,
> +                  Status
> +                  );
> +
> +  DataSize = sizeof(MemoryOverwriteRequestControlData);
> +  Attributes = TCG_MOR_VARIABLE_ATTRIBUTES;
> +
> +  Status = gtRT->GetVariable (
> +                  L"MemoryOverwriteRequestControl",     // VariableName
> +                  &gEfiMemoryOverwriteControlDataGuid,  // VendorGuid
> +                  &Attributes,                          // Attributes
> +                  &DataSize,                            // DataSize
> +                  &MemoryOverwriteRequestControlData    // Data
> +                  );
> +
> +  // verifying that the variable has not been modified with SetVar
> +  if (MemoryOverwriteRequestControlDataCached == MemoryOverwriteRequestControlData) {
> +    Result = EFI_TEST_ASSERTION_PASSED;
> +  } else {
> +    Result = EFI_TEST_ASSERTION_FAILED;
> +  }
> +
> +  StandardLib->RecordAssertion (
> +                  StandardLib,
> +                  Result,
> +                  gTCGMemoryOverwriteRequestTestFunctionAssertionGuid045,
> +                  L"MemoryOverwriteRequestControl - SetVariable() value remains unchanged when Lock is Set with no key",
> +                  L"%a:%d:Status - %r",
> +                  __FILE__,
> +                  (UINTN)__LINE__,
> +                  Status
> +                  );
> +
> +  //
> +  // When Locked with an 8 byte Key, SetVariable() with 8 byte key != key used to set
> +  // the lock, in this case 0x11111111, must return EFI_ACCESS_DENIED and lock must
> +  // be updated Locked without key (Data value = 0x01) to prevent dictonary attack
> +  // The invalid key to be used to attempt unlock is = 0x22222222
> +  //
> +  DataSize = MOR_LOCK_WITH_KEY_SIZE;
> +  Attributes = TCG_MOR_VARIABLE_ATTRIBUTES;
> +  MemoryOverwriteControlLockKeyValue = MOR_LOCK_INVALID_TEST_KEY; //INVALID KEY != 0x11111111

Nit- space after comment char.

Thanks,
Stuart


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



  reply	other threads:[~2023-09-21 19:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21 16:37 [edk2-devel] [PATCH v2 0/6] RESEND: TCG MemoryOverwriteRequest Tests Abhimanyu Singh
2023-09-21 16:37 ` [edk2-devel] [PATCH v2 1/6] uefi-sct/SctPkg: TCG Platform Reset Check Test Abhimanyu Singh
2023-09-21 16:37 ` [edk2-devel] [PATCH v2 2/6] uefi-sct/SctPkg: TCG MOR SetVariable Test Abhimanyu Singh
2023-09-21 19:03   ` Stuart Yoder
2023-09-21 16:37 ` [edk2-devel] [PATCH v2 3/6] uefi-sct/SctPkg: TCG MORLOCK " Abhimanyu Singh
2023-09-21 19:03   ` Stuart Yoder
2023-09-21 16:37 ` [edk2-devel] [PATCH v2 4/6] uefi-sct/SctPkg: TCG MORLOCK Unlocked State Test Abhimanyu Singh
2023-09-21 19:03   ` Stuart Yoder
2023-09-21 16:37 ` [edk2-devel] [PATCH v2 5/6] uefi-sct/SctPkg: TCG MORLOCK Locked No Key " Abhimanyu Singh
2023-09-21 19:03   ` Stuart Yoder
2023-09-21 16:37 ` [edk2-devel] [PATCH v2 6/6] uefi-sct/SctPkg: TCG MORLOCK Locked with " Abhimanyu Singh
2023-09-21 19:03   ` Stuart Yoder [this message]
2023-09-21 19:03 ` [edk2-devel] [PATCH v2 0/6] RESEND: TCG MemoryOverwriteRequest Tests Stuart Yoder
  -- strict thread matches above, loose matches on Subject: below --
2023-08-23  2:09 [edk2-devel] [PATCH v2 0/6] " Abhimanyu Singh
2023-08-23  2:09 ` [edk2-devel] [PATCH v2 6/6] uefi-sct/SctPkg: TCG MORLOCK Locked with Key State Test Abhimanyu Singh

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=21b940cc-3d0e-ee7c-c718-1b977e699cbc@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