From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 B295880467 for ; Mon, 20 Mar 2017 19:14:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490062455; x=1521598455; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=12I7nhClCOwC/gmzng8P3P+lfkNLdRw3TTyJ8b5yu68=; b=Ae0czBY+4m8qbqpP96mw0qrTvJDyJOBnlmnCy4kivQfPOZnlVbw2+t2L pUwX8l5IC7+U0twv8zEG3AkgpysgzA==; Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Mar 2017 19:14:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,197,1486454400"; d="scan'208";a="62941690" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 20 Mar 2017 19:14:14 -0700 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 20 Mar 2017 19:14:14 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 20 Mar 2017 19:14:09 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0248.002; Tue, 21 Mar 2017 10:14:02 +0800 From: "Gao, Liming" To: Ard Biesheuvel , "edk2-devel@lists.01.org" , "Yao, Jiewen" CC: "Tian, Feng" , "Zeng, Star" Thread-Topic: [edk2] [PATCH] MdeModulePkg/DxeCore: ignore PdbPointer if ImageAddress == 0 Thread-Index: AQHSobrrRqC7GoAmdkShft9FXJTIaqGejcOg Date: Tue, 21 Mar 2017 02:14:01 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D6F2EC9@shsmsx102.ccr.corp.intel.com> References: <1490042703-19896-1-git-send-email-ard.biesheuvel@linaro.org> In-Reply-To: <1490042703-19896-1-git-send-email-ard.biesheuvel@linaro.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg/DxeCore: ignore PdbPointer if ImageAddress == 0 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Mar 2017 02:14:15 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ard: On this case, UnprotectUefiImage() should be skipped, because the image i= s not loaded.=20 Thanks Liming >-----Original Message----- >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard >Biesheuvel >Sent: Tuesday, March 21, 2017 4:45 AM >To: edk2-devel@lists.01.org; Yao, Jiewen >Cc: Tian, Feng ; Zeng, Star ; Ar= d >Biesheuvel >Subject: [edk2] [PATCH] MdeModulePkg/DxeCore: ignore PdbPointer if >ImageAddress =3D=3D 0 > >The memory protection code may be invoked to unprotect a driver when >DxeCore has not completed loading yet, in which case ImageAddress may >still be zero. So ignore the PdbPointer in this case, to prevent >PeCoffLoaderGetPdbPointer() from ASSERT()ing on a NULL value. > >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: Ard Biesheuvel >--- > MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > >diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c >b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c >index 7689c794a8ad..6ecbb311a8c3 100644 >--- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c >+++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c >@@ -462,9 +462,12 @@ ProtectUefiImageCommon ( > > ImageAddress =3D LoadedImage->ImageBase; > >- PdbPointer =3D PeCoffLoaderGetPdbPointer ((VOID*) (UINTN) >ImageAddress); >- if (PdbPointer !=3D NULL) { >- DEBUG ((DEBUG_VERBOSE, " Image - %a\n", PdbPointer)); >+ PdbPointer =3D NULL; >+ if (ImageAddress !=3D 0) { >+ PdbPointer =3D PeCoffLoaderGetPdbPointer ((VOID*) (UINTN) >ImageAddress); >+ if (PdbPointer !=3D NULL) { >+ DEBUG ((DEBUG_VERBOSE, " Image - %a\n", PdbPointer)); >+ } > } > > // >-- >2.7.4 > >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel