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=jian.j.wang@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 51445223DB101 for ; Thu, 15 Mar 2018 00:01:21 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Mar 2018 00:07:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,308,1517904000"; d="scan'208";a="28063268" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga002.fm.intel.com with ESMTP; 15 Mar 2018 00:07:44 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 15 Mar 2018 00:07:43 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.235]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.166]) with mapi id 14.03.0319.002; Thu, 15 Mar 2018 15:07:41 +0800 From: "Wang, Jian J" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" , "Dong, Eric" , "Zeng, Star" Thread-Topic: [edk2] [PATCH] MdeModulePkg/PiSmmCore: fix #PF caused by freeing read-only memory Thread-Index: AQHTvCX5t9VfVtmplEycvepupVHxC6PQVuuAgACIPeA= Date: Thu, 15 Mar 2018 07:07:40 +0000 Message-ID: References: <20180315062202.7456-1-jian.j.wang@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDE1YzZhZTctYzM2OS00ZGZjLTgzNGItNDg5N2EwNmVhNmNhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiI0ZUxNbjM5YzI1WXc5M0tGbkxLK2JQd3gxNUI5RldTZ2hHOEY3TEtLajNUZG4zMzV0UVhkTUVJcmk5VWFvM3pMIn0= 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: fix #PF caused by freeing read-only memory 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, 15 Mar 2018 07:01:21 -0000 Content-Language: en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 RHhlQ29yZSB3aWxsIG9ubHkgYXBwbHkgRUZJX01FTU9SWV9STyB0byBpbWFnZSBDT0RFIG1lbW9y eSAoY29udHJvbGxlZCBieQ0KUGNkSW1hZ2VQcm90ZWN0aW9uUG9saWN5KS4gTm9ybWFsbHkgYWxs b2NhdGVkIHJ0X2NvZGUvYnNfY29kZSBtZW1vcnkgd29uJ3QgYmUNCm1hcmtlZCBhcyByZWFkLW9u bHkuIFNvIG15IGFuc3dlciBpcyBOTy4NCg0KUmVnYXJkcywNCkppYW4NCg0KDQo+IC0tLS0tT3Jp Z2luYWw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BdHRyaWJ1dGUtPkdldE1lbW9yeUF0 dHJpYnV0ZXMgKA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICBtU21tTWVtb3J5QXR0 cmlidXRlLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICBTdGFydCwNCj4gPiArICAg ICAgICAgICAgICAgICAgICAgICAgICAgRUZJX1BBR0VTX1RPX1NJWkUgKFBhZ2VzVG9GcmVlKSwN Cj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgJkF0dHJpYnV0ZXMNCj4gPiArICAgICAg ICAgICAgICAgICAgICAgICAgICAgKTsNCj4gPiArICAgIGlmICgoQXR0cmlidXRlcyAmIEVGSV9N RU1PUllfUk8pICE9IDApIHsNCj4gPiArICAgICAgbVNtbU1lbW9yeUF0dHJpYnV0ZS0+Q2xlYXJN ZW1vcnlBdHRyaWJ1dGVzICgNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU21t TWVtb3J5QXR0cmlidXRlLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0YXJ0 LA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVGSV9QQUdFU19UT19TSVpFIChQ YWdlc1RvRnJlZSksDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRUZJX01FTU9S WV9STw0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7DQo+ID4gKyAgICB9DQo+ ID4gKyAgfQ0KPiA+ICsNCj4gPiAgICAgLy8NCj4gPiAgICAgLy8gSGVhZCBHdWFyZCBtdXN0IGJl IG9uZSBwYWdlIGJlZm9yZSwgaWYgYW55Lg0KPiA+ICAgICAvLw0KPiA+DQo+IA0KPiANCj4gLS0N Cj4gVGhhbmtzLA0KPiBSYXkNCg==