From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 652CE21E256BE for ; Wed, 24 Jan 2018 19:23:07 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jan 2018 19:28:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,409,1511856000"; d="scan'208";a="198609859" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga006.fm.intel.com with ESMTP; 24 Jan 2018 19:28:35 -0800 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 24 Jan 2018 19:28:35 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 24 Jan 2018 19:28:35 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.189]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Thu, 25 Jan 2018 11:28:33 +0800 From: "Yao, Jiewen" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [edk2] [PATCH] MdeModulePkg PiSmmCore: Set ForwardLink to NULL in RemoveOldEntry() Thread-Index: AQHTlYvLLFKDKNPqEU+4SAeMJbeZxKOD7f8Q Date: Thu, 25 Jan 2018 03:28:32 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AA8B19B@shsmsx102.ccr.corp.intel.com> References: <1516850556-7064-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1516850556-7064-1-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjc1MmIwMGMtMjA5Mi00NjA2LWI1ZWItNDE3YmY5MTcyNTE5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJ4SmNBOFFheXA1amI5UXZGY0pmdzhaSWRhcjdiNGxmWWVGVzBKb0kxY0I5dkFrZzJKZTJNaktVZG1KSnRjMkEzIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg PiSmmCore: Set ForwardLink to NULL in RemoveOldEntry() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jan 2018 03:23:07 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: jiewen.yao@intel.com > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of St= ar > Zeng > Sent: Thursday, January 25, 2018 11:23 AM > To: edk2-devel@lists.01.org > Cc: Yao, Jiewen ; Zeng, Star > Subject: [edk2] [PATCH] MdeModulePkg PiSmmCore: Set ForwardLink to NULL i= n > RemoveOldEntry() >=20 > "Entry->Link.ForwardLink =3D NULL;" is present in RemoveMemoryMapEntry() > for DxeCore, that is correct. > "Entry->Link.ForwardLink =3D NULL;" is absent in RemoveOldEntry() > for PiSmmCore, that is incorrect. >=20 > Without this fix, when FromStack in Entry is TRUE, > the "InsertTailList (&mMapStack[mMapDepth].Link, &Entry->Link);" in > following calling to CoreFreeMemoryMapStack() will fail as the entry > at mMapStack[mMapDepth] actually has been removed from the list. >=20 > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > MdeModulePkg/Core/PiSmmCore/Page.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Core/PiSmmCore/Page.c > b/MdeModulePkg/Core/PiSmmCore/Page.c > index 8909d46a00a2..3699af742458 100644 > --- a/MdeModulePkg/Core/PiSmmCore/Page.c > +++ b/MdeModulePkg/Core/PiSmmCore/Page.c > @@ -1,7 +1,7 @@ > /** @file > SMM Memory page management functions. >=20 > - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
> + Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
> This program and the accompanying materials are licensed and made > available > under the terms and conditions of the BSD License which accompanies th= is > distribution. The full text of the license may be found at > @@ -246,6 +246,8 @@ RemoveOldEntry ( > ) > { > RemoveEntryList (&Entry->Link); > + Entry->Link.ForwardLink =3D NULL; > + > if (!Entry->FromStack) { > InsertTailList (&mFreeMemoryMapEntryList, &Entry->Link); > } > -- > 2.7.0.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel