public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Long, Qin" <qin.long@intel.com>
To: "Zhang, Chao B" <chao.b.zhang@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Yao, Jiewen" <jiewen.yao@intel.com>
Subject: Re: [Patch] SecurityPkg: TcgSmm: Handle invalid parameter in MOR SMI handler
Date: Fri, 20 Jul 2018 06:40:04 +0000	[thread overview]
Message-ID: <BF2CCE9263284D428840004653A28B6E5414F154@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <20180719100005.9816-1-chao.b.zhang@intel.com>

Reviewed-by: Long Qin <qin.long@intel.com>


Best Regards & Thanks,
LONG, Qin

> -----Original Message-----
> From: Zhang, Chao B
> Sent: Thursday, July 19, 2018 6:00 PM
> To: edk2-devel@lists.01.org
> Cc: Long, Qin <qin.long@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>;
> Zhang, Chao B <chao.b.zhang@intel.com>
> Subject: [Patch] SecurityPkg: TcgSmm: Handle invalid parameter in MOR SMI
> handler
> 
> Add more logic to filter invalid function parameter in MOR Control SMI handler
> 
> Cc: Long Qin <qin.long@intel.com>
> Cc: Yao Jiewen <jiewen.yao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
> Signed-off-by: Zhang, Chao B <chao.b.zhang@intel.com>
> ---
>  SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 4 ++++
>  SecurityPkg/Tcg/TcgSmm/TcgSmm.c   | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
> b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
> index 21b1014a3b..4a1a293bfc 100644
> --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
> +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
> @@ -151,10 +151,14 @@ MemoryClearCallback (
> 
>      if (MOR_CLEAR_MEMORY_VALUE (MorControl) == 0x0) {
>        return EFI_SUCCESS;
>      }
>      MorControl &= ~MOR_CLEAR_MEMORY_BIT_MASK;
> +  } else {
> +    mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;
> +    DEBUG ((EFI_D_ERROR, "[TPM] MOR Parameter error! Parameter = %x\n",
> mTcgNvs->MemoryClear.Parameter));
> +    return EFI_SUCCESS;
>    }
> 
>    DataSize = sizeof (UINT8);
>    Status = mSmmVariable->SmmSetVariable (
>                             MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME,
> diff --git a/SecurityPkg/Tcg/TcgSmm/TcgSmm.c
> b/SecurityPkg/Tcg/TcgSmm/TcgSmm.c index 0b8a002a4d..d3ddae6886 100644
> --- a/SecurityPkg/Tcg/TcgSmm/TcgSmm.c
> +++ b/SecurityPkg/Tcg/TcgSmm/TcgSmm.c
> @@ -269,10 +269,14 @@ MemoryClearCallback (
> 
>      if (MOR_CLEAR_MEMORY_VALUE (MorControl) == 0x0) {
>        return EFI_SUCCESS;
>      }
>      MorControl &= ~MOR_CLEAR_MEMORY_BIT_MASK;
> +  } else {
> +    mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;
> +    DEBUG ((EFI_D_ERROR, "[TPM] MOR Parameter error! Parameter = %x\n",
> mTcgNvs->MemoryClear.Parameter));
> +    return EFI_SUCCESS;
>    }
> 
>    DataSize = sizeof (UINT8);
>    Status = mSmmVariable->SmmSetVariable (
>                             MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME,
> --
> 2.16.2.windows.1



      reply	other threads:[~2018-07-20  6:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-19 10:00 [Patch] SecurityPkg: TcgSmm: Handle invalid parameter in MOR SMI handler Zhang, Chao B
2018-07-20  6:40 ` Long, Qin [this message]

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=BF2CCE9263284D428840004653A28B6E5414F154@SHSMSX103.ccr.corp.intel.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