From: "Ni, Ruiyu" <ruiyu.ni@intel.com>
To: "Dong, Eric" <eric.dong@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [Patch] UefiCpuPkg/PiSmmCpuDxeSmm: Add check to void use null pointer.
Date: Mon, 9 Oct 2017 03:29:39 +0000 [thread overview]
Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BA8A596@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1507519098-14284-1-git-send-email-eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Thanks/Ray
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Eric
> Dong
> Sent: Monday, October 9, 2017 11:18 AM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>
> Subject: [edk2] [Patch] UefiCpuPkg/PiSmmCpuDxeSmm: Add check to void use
> null pointer.
>
> Current code logic not check the pointer before use it. This may has potential
> issue, this patch add code to check it.
>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Dong <eric.dong@intel.com>
> ---
> UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> index ef72b9b..2c1dc82 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> @@ -226,12 +226,17 @@ SetProcessorRegister (
> CPU_REGISTER_TABLE *RegisterTable;
>
> InitApicId = GetInitialApicId ();
> + RegisterTable = NULL;
> for (Index = 0; Index < RegisterTableCount; Index++) {
> if (RegisterTables[Index].InitialApicId == InitApicId) {
> RegisterTable = &RegisterTables[Index];
> break;
> }
> }
> + ASSERT (RegisterTable != NULL);
> + if (RegisterTable == NULL) {
> + return;
> + }
>
> //
> // Traverse Register Table of this logical processor
> --
> 2.7.0.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
next prev parent reply other threads:[~2017-10-09 3:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-09 3:18 [Patch] UefiCpuPkg/PiSmmCpuDxeSmm: Add check to void use null pointer Eric Dong
2017-10-09 3:29 ` Ni, Ruiyu [this message]
2017-10-09 3:39 ` Wu, Hao A
2017-10-09 4:59 ` Dong, Eric
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=734D49CCEBEEF84792F5B80ED585239D5BA8A596@SHSMSX104.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