public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael Kubacki" <mikuback@linux.microsoft.com>
To: devel@edk2.groups.io, Abhi.Singh@arm.com
Subject: Re: [edk2-devel] [PATCH v1 1/1] MdeModulePkg/Variable: TcgMorLockSmm Key Mismatch changes lock state
Date: Thu, 8 Jun 2023 16:57:40 -0400	[thread overview]
Message-ID: <dc4ab0c8-99ad-b08e-94b1-416cf8edd2f1@linux.microsoft.com> (raw)
In-Reply-To: <20230412212505.538013-1-Abhi.Singh@arm.com>

Acked-by: Michael Kubacki <michael.kubacki@microsoft.com>

Inline code comment below.

On 4/12/2023 5:25 PM, Abhimanyu Singh wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4410
> 
> Inside TcgMorLockSmm.c, the SetVariableCheckHandlerMorLock() function
> contains a scenario to prevent a possible dictionary attack on the MorLock
> Key in accordance with the TCG Platform Reset Mitigation Spec v1.10.
> 
> The mechanism to prevent this attack must also change the MorLock Variable
> Value to 0x01 to indicate Locked Without Key.
> 
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Signed-off-by: Abhi Singh <Abhi.Singh@arm.com>
> ---
>   MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c
> index da1105ff073e..a76db18ef877 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c
> @@ -312,6 +312,10 @@ SetVariableCheckHandlerMorLock (
>         mMorLockState    = MorLockStateLocked;
> 
>         mMorLockKeyEmpty = TRUE;
> 
>         ZeroMem (mMorLockKey, sizeof (mMorLockKey));
> 
> +      //
> 
> +      // Update value to reflect locked without key
> 
> +      //
> 
> +      SetMorLockVariable (MOR_LOCK_DATA_LOCKED_WITHOUT_KEY);

I know the TCG Reset Attack Mitigation Specification requires 
EFI_ACCESS_DENIED to be returned from this function in this case but 
SetMorLockVariable() returns a status code.

I suggest capturing that followed by an ASSERT_EFI_ERROR (Status) to at 
least help raise visibility of unexpected errors in builds with asserts 
enabled.

> 
>         return EFI_ACCESS_DENIED;
> 
>       }
> 
>     }
> 

  parent reply	other threads:[~2023-06-08 20:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12 21:25 [PATCH v1 1/1] MdeModulePkg/Variable: TcgMorLockSmm Key Mismatch changes lock state Abhimanyu Singh
2023-04-13 16:33 ` [edk2-devel] " Abhimanyu Singh
2023-06-08 20:54 ` Abhimanyu Singh
2023-06-08 20:57 ` Michael Kubacki [this message]
2023-06-25  1:33   ` 回复: " gaoliming
2023-06-27  0:09     ` Michael Kubacki
2023-07-09 23:13     ` [edk2-devel] " Abhimanyu Singh
2023-07-10  1:28       ` 回复: " gaoliming

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=dc4ab0c8-99ad-b08e-94b1-416cf8edd2f1@linux.microsoft.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