public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "Wang, Jian J" <jian.j.wang@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Zeng, Star" <star.zeng@intel.com>, "Dong, Eric" <eric.dong@intel.com>
Subject: Re: [PATCH] MdeModulePkg/Core: Fix incorrect memory map generated in a rare case
Date: Tue, 19 Dec 2017 03:50:38 +0000	[thread overview]
Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AA4C632@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <20171218083946.19292-1-jian.j.wang@intel.com>

Reviewed-by: Jiewen.yao@intel.com

> -----Original Message-----
> From: Wang, Jian J
> Sent: Monday, December 18, 2017 4:40 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Dong, Eric <eric.dong@intel.com>; Yao,
> Jiewen <jiewen.yao@intel.com>
> Subject: [PATCH] MdeModulePkg/Core: Fix incorrect memory map generated in
> a rare case
> 
> The root cause is that mImagePropertiesPrivateData.CodeSegmentCountMax
> was
> not updated with correct value due to the fact that SortImageRecord() called
> before might change the content of current ImageRecord. This will in turn
> cause incorrect memory map entries generated in SplitTable().
> 
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
> ---
>  MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c        | 4 ++--
>  MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
> b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
> index 75d9b14c1f..a84507df95 100644
> --- a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
> +++ b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
> @@ -1229,12 +1229,12 @@ InsertImageRecord (
>    InsertTailList (&mImagePropertiesPrivateData.ImageRecordList,
> &ImageRecord->Link);
>    mImagePropertiesPrivateData.ImageRecordCount++;
> 
> -  SortImageRecord ();
> -
>    if (mImagePropertiesPrivateData.CodeSegmentCountMax <
> ImageRecord->CodeSegmentCount) {
>      mImagePropertiesPrivateData.CodeSegmentCountMax =
> ImageRecord->CodeSegmentCount;
>    }
> 
> +  SortImageRecord ();
> +
>  Finish:
>    return ;
>  }
> diff --git a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
> b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
> index e3c505ef18..36ccf65fa3 100644
> --- a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
> +++ b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
> @@ -1214,12 +1214,12 @@ SmmInsertImageRecord (
>    InsertTailList (&mImagePropertiesPrivateData.ImageRecordList,
> &ImageRecord->Link);
>    mImagePropertiesPrivateData.ImageRecordCount++;
> 
> -  SortImageRecord ();
> -
>    if (mImagePropertiesPrivateData.CodeSegmentCountMax <
> ImageRecord->CodeSegmentCount) {
>      mImagePropertiesPrivateData.CodeSegmentCountMax =
> ImageRecord->CodeSegmentCount;
>    }
> 
> +  SortImageRecord ();
> +
>  Finish:
>    return ;
>  }
> --
> 2.15.1.windows.2



      reply	other threads:[~2017-12-19  3:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18  8:39 [PATCH] MdeModulePkg/Core: Fix incorrect memory map generated in a rare case Jian J Wang
2017-12-19  3:50 ` Yao, Jiewen [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=74D8A39837DF1E4DA445A8C0B3885C503AA4C632@shsmsx102.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