From nobody Tue Nov 26 01:36:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61948+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61948+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1593666948; cv=none; d=zohomail.com; s=zohoarc; b=Hq3Hhey0fClD+5tRinMVsTxlV7Mmbb2K9kJFMBH3twX3MrHsfyzIBRUpkSjx6dL4aE3f6zf8CMOePNNRRzvTnPcXJRcxBeRKd/pskN06D/+6uIA5t3k8Q4vnaLAkpXSf520HZbqhgKBCqQfCeIW3avskGCRbqzTLSmZYDbsq6Yg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593666948; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=373nM3LcPkeCkzeyIOKimw+YYaUvoSbWjE4QE7Epzlw=; b=nofJ5eSBgGgYmFX/k1zbPXztCpXDbcLP7n4s8hr6ZfVjJ9cRdnIMp4bf7iFlqZh+R7mGvmZAL5npS+7aIFK5yj1oqiKGEnCClf0sVdkIDEmCW/EPc3FQ52mtIQgAedFWuXvs+rzyh0jQUPreFIbHwgeQsFOd3UqQ3r4AOPts3V0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61948+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1593666948806421.67241705187666; Wed, 1 Jul 2020 22:15:48 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id jHnoYY1788612xkDYGzfajVD; Wed, 01 Jul 2020 22:15:48 -0700 X-Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web10.360.1593666932487247443 for ; Wed, 01 Jul 2020 22:15:48 -0700 IronPort-SDR: DM5z7EP4pVzxLTyLBfKgwxgj/s6z0UWKsF6Xyc6qyMZown+U9wlJTQkalDaek3a0H5mW494SI/ kcE9UU54MISw== X-IronPort-AV: E=McAfee;i="6000,8403,9669"; a="208319080" X-IronPort-AV: E=Sophos;i="5.75,302,1589266800"; d="scan'208";a="208319080" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2020 22:15:47 -0700 IronPort-SDR: dXU6S+XJImh3lH2gcuuHgLQTvAX8gDZJpoMu/E81lAUXJSrA86XpkB6q5aGeL3yfIw1s87EV5J yg/Mw3ek9u8Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,302,1589266800"; d="scan'208";a="455385040" X-Received: from guominji-mobl.ccr.corp.intel.com ([10.238.4.95]) by orsmga005.jf.intel.com with ESMTP; 01 Jul 2020 22:15:45 -0700 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Dandan Bi , Liming Gao , Debkumar De , Harry Han , Catharine West Subject: [edk2-devel] [PATCH v2 7/9] MdeModulePkg/Core: Add switch to enable or disable TOCTOU feature (CVE-2019-11098) Date: Thu, 2 Jul 2020 13:15:23 +0800 Message-Id: <20200702051525.1102-8-guomin.jiang@intel.com> In-Reply-To: <20200702051525.1102-1-guomin.jiang@intel.com> References: <20200702051525.1102-1-guomin.jiang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,guomin.jiang@intel.com X-Gm-Message-State: ny6bN9dfc5X1pqLYsDqi7J77x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1593666948; bh=pDLZoq/Gy69T2Zyl+/LJM10naOusPXifvMNuoX1BVYw=; h=Cc:Date:From:Reply-To:Subject:To; b=fGw5ZqaBxQmdgrBLYAawV0O9GfTE9w8PmWpuNPpDBCBsRPHtJMmWGecoqOOSreMBL2z tzSAUBP04Ap0Eb2/uv3wG2QqXZrCnlZX1YvihcCGS+Pjh+zMpDXsqTxaUUGLl3Sp6/Cwq ea5ilG5lNcK3O559IrgYKLrQx2LoKBYg6Lg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1614 Add total switch to enable or disable TOCTOU feature, the vulnerability is critical, so the switch is on normally but if you can disable it according to your needs. Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Liming Gao Cc: Debkumar De Cc: Harry Han Cc: Catharine West Signed-off-by: Guomin Jiang --- MdeModulePkg/Core/Pei/PeiMain.inf | 1 + MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 5 +++-- MdeModulePkg/MdeModulePkg.dec | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiM= ain.inf index c80d16b4efa6..0cf357371a16 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.inf +++ b/MdeModulePkg/Core/Pei/PeiMain.inf @@ -111,6 +111,7 @@ [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdShadowPeimOnS3Boot = ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdShadowPeimOnBoot = ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack = ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdMigrateTemporaryRamFirmwareVolumes = ## CONSUMES =20 # [BootMode] # S3_RESUME ## SOMETIMES_CONSUMES diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c b/MdeModulePkg/Core/Pe= i/PeiMain/PeiMain.c index 802cd239e2eb..bc78c3f8ad59 100644 --- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c +++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c @@ -419,8 +419,9 @@ PeiCore ( } } else { if ( - (!(PrivateData.HobList.HandoffInformationTable->BootMode =3D=3D BOOT= _ON_S3_RESUME) && PcdGetBool (PcdShadowPeimOnBoot)) || - ((PrivateData.HobList.HandoffInformationTable->BootMode =3D=3D BOOT_= ON_S3_RESUME) && PcdGetBool (PcdShadowPeimOnS3Boot)) + ((!(PrivateData.HobList.HandoffInformationTable->BootMode =3D=3D BOO= T_ON_S3_RESUME) && PcdGetBool (PcdShadowPeimOnBoot)) || + ((PrivateData.HobList.HandoffInformationTable->BootMode =3D=3D BOOT_= ON_S3_RESUME) && PcdGetBool (PcdShadowPeimOnS3Boot))) && + PcdGetBool (PcdMigrateTemporaryRamFirmwareVolumes) ) { DEBUG ((DEBUG_VERBOSE, "PPI lists before temporary RAM evacuation:\n= ")); DumpPpiList (&PrivateData); diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 5e25cbe98ada..0a5a167f3e8b 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -1223,6 +1223,11 @@ [PcdsFixedAtBuild, PcdsPatchableInModule] # @Prompt Shadow Peim and PeiCore on boot gEfiMdeModulePkgTokenSpaceGuid.PcdShadowPeimOnBoot|TRUE|BOOLEAN|0x300010= 29 =20 + ## Indicate if to evacuate from temporary to permanent memory. + # TRUE - Evacuate from temporary memory + # FALSE - Keep the original behavior + gEfiMdeModulePkgTokenSpaceGuid.PcdMigrateTemporaryRamFirmwareVolumes|TRU= E|BOOLEAN|0x3000102A + ## The mask is used to control memory profile behavior.

# BIT0 - Enable UEFI memory profile.
# BIT1 - Enable SMRAM profile.
--=20 2.25.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#61948): https://edk2.groups.io/g/devel/message/61948 Mute This Topic: https://groups.io/mt/75252666/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-