From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com []) by mx.groups.io with SMTP id smtpd.web12.10277.1593501867582751430 for ; Tue, 30 Jun 2020 00:24:35 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: guomin.jiang@intel.com) IronPort-SDR: hy4W7/Ktci4P5ky43Ya4/h+q8zwkCakMpw5S2sI4X9tPceGvt6k8Bsjn/LjTiRSNSy502yTO9o ungAN2yG3NrA== X-IronPort-AV: E=McAfee;i="6000,8403,9666"; a="126292087" X-IronPort-AV: E=Sophos;i="5.75,296,1589266800"; d="scan'208";a="126292087" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2020 00:24:35 -0700 IronPort-SDR: ShPcw32+O/4GuVL4tmJ7Y2y8N/sgf2WtcoWZv4l/OyWVX4m1pqj85GlnLHy4LOX7EFrSSEANzB Pzyvo26UYcmg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,296,1589266800"; d="scan'208";a="320854002" Received: from guominji-mobl.ccr.corp.intel.com ([10.238.4.95]) by FMSMGA003.fm.intel.com with ESMTP; 30 Jun 2020 00:24:33 -0700 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Dandan Bi , Liming Gao Subject: [PATCH 4/6] MdeModulePkg/DxeIplPeim: Register for shadow on S3 shadowed boot (CVE-2019-11098) Date: Tue, 30 Jun 2020 15:24:20 +0800 Message-Id: <20200630072422.753-5-guomin.jiang@intel.com> X-Mailer: git-send-email 2.25.1.windows.1 In-Reply-To: <20200630072422.753-1-guomin.jiang@intel.com> References: <20200630072422.753-1-guomin.jiang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Jian J Wang REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1614 Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Liming Gao Signed-off-by: Jian J Wang --- MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 3 +++ MdeModulePkg/Core/DxeIplPeim/DxeLoad.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf index 3f1702854660..4ab54594ed66 100644 --- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf +++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf @@ -121,6 +121,9 @@ [Pcd.IA32,Pcd.X64,Pcd.ARM,Pcd.AARCH64] gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy ## SOMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdImageProtectionPolicy ## SOMETIMES_CONSUMES +[Pcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdShadowPeimOnS3Boot ## CONSUMES + [Depex] gEfiPeiLoadFilePpiGuid AND gEfiPeiMasterBootModePpiGuid diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c index d48028cea0dd..9e1831c69819 100644 --- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c +++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c @@ -77,7 +77,7 @@ PeimInitializeDxeIpl ( BootMode = GetBootModeHob (); - if (BootMode != BOOT_ON_S3_RESUME) { + if (BootMode != BOOT_ON_S3_RESUME || PcdGetBool (PcdShadowPeimOnS3Boot)) { Status = PeiServicesRegisterForShadow (FileHandle); if (Status == EFI_SUCCESS) { // -- 2.25.1.windows.1