From nobody Mon Feb 9 05:19:00 2026 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+63093+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+63093+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1595407026; cv=none; d=zohomail.com; s=zohoarc; b=G5t5kEoWptp+F+Td9jFfUUi41n/P21qv9xZmDZGsEZfwTxGQ605+1RiacWCKJ1UeUVmTaFGGx5fjzYu6Y0disalUODaooMdivwoaqePf7xDH9d52F3QGxW/YwQy4PdACoGHWkeT/87g2tD4Y0M6KWWchAGYg4S6UL2gCJHTPJSg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595407026; 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=FoUJtNOotToA50H8hzDi1V1CYA5UuvpJPhM9QK+CFH4=; b=NQEPjWf6G46JxxcnDBv+RDUY6Hut0a7FrHj7BcRr77niEWQTFPWcmjNM0Ogc0X/8305G5z4+UEcl6SW7Fyo4fDtVYMHK7/PK3m1iFOrEjlesEzSILanOW7mMjwAHHHRXOVm6+mjZCoO/nKFJvisixFhCX2gluL1eb52MS66MEjM= 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+63093+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 1595407026533229.22701428285063; Wed, 22 Jul 2020 01:37:06 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Bo5nYY1788612xA3ajtm48Jm; Wed, 22 Jul 2020 01:37:06 -0700 X-Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web11.14454.1595407023959550656 for ; Wed, 22 Jul 2020 01:37:05 -0700 IronPort-SDR: G1F1sX0xR0s3ND2DvgIKNwvS0wprX1qieqo5y3CEyKwpojYdoweRr0XytP4LLBuZbvCnIIcO12 ey3ABfd+2JvA== X-IronPort-AV: E=McAfee;i="6000,8403,9689"; a="211835158" X-IronPort-AV: E=Sophos;i="5.75,381,1589266800"; d="scan'208";a="211835158" 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; 22 Jul 2020 01:37:04 -0700 IronPort-SDR: BWQcRRkJc1VhYzMEFImDGOJT0gVuwZ08s/S6MiyCgmL1O4WNkBbUvKb29Pp9SXyeixr+iymSGd qOtlpow9iBlg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,381,1589266800"; d="scan'208";a="462380146" X-Received: from guominji-mobl.ccr.corp.intel.com ([10.238.13.140]) by orsmga005.jf.intel.com with ESMTP; 22 Jul 2020 01:37:03 -0700 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Laszlo Ersek Subject: [edk2-devel] [PATCH v7 01/10] MdeModulePkg: Add new PCD to control the evacuate temporary memory feature (CVE-2019-11098) Date: Wed, 22 Jul 2020 16:36:48 +0800 Message-Id: <20200722083657.739-2-guomin.jiang@intel.com> In-Reply-To: <20200722083657.739-1-guomin.jiang@intel.com> References: <20200722083657.739-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: JRkRjeytZ2Q1fhGewgdw9Rjrx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1595407026; bh=SmkNSKfy5B+TQ0l4xYzetjqFZ5cysXyMSHwcbSp7CwM=; h=Cc:Date:From:Reply-To:Subject:To; b=Sv4Xxs40DNX+b8HybuOG7AICOU92huJnk4J5U5lofaHYcFY69WdiUayDSq/JJfZQNjY H5Ks8IsPp41bGQ1AFI3BjGrzjWud8ZCYvtM8rdXEXaDxdZLd8/lBXdLDnwC2LxBeYXqsU 4fmH6kwjXqf4pUM5Y26dDqrC950Rf+Dp2J8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1614 The security researcher found that we can get control after NEM disable. The reason is that the flash content reside in NEM at startup and the code will get the content from flash directly after disable NEM. To avoid this vulnerability, the feature will copy the PEIMs from temporary memory to permanent memory and only execute the code in permanent memory. The vulnerability is exist in physical platform and haven't report in virtual platform, so the virtual can disable the feature currently. Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Guomin Jiang Acked-by: Laszlo Ersek Reviewed-by: Jian J Wang --- MdeModulePkg/MdeModulePkg.dec | 8 ++++++++ MdeModulePkg/MdeModulePkg.uni | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 843e963ad34b..e88f22756d7f 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -1220,6 +1220,14 @@ [PcdsFixedAtBuild, PcdsPatchableInModule] # @Prompt Shadow Peim and PeiCore on boot gEfiMdeModulePkgTokenSpaceGuid.PcdShadowPeimOnBoot|TRUE|BOOLEAN|0x300010= 29 =20 + ## Enable the feature that evacuate temporary memory to permanent memory= or not + # Set FALSE as default, if the developer need this feature to avoid thi= s vulnerability, please + # enable it in dsc file. + # TRUE - Evacuate temporary memory, the actions include copy memory, co= nvert PPI pointers and so on. + # FALSE - Do nothing, for example, no copy memory, no convert PPI point= ers and so on. + # @Prompt Evacuate temporary memory to permanent memory + gEfiMdeModulePkgTokenSpaceGuid.PcdMigrateTemporaryRamFirmwareVolumes|FAL= SE|BOOLEAN|0x3000102A + ## The mask is used to control memory profile behavior.

# BIT0 - Enable UEFI memory profile.
# BIT1 - Enable SMRAM profile.
diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni index 2007e0596c4f..5235dee561ad 100644 --- a/MdeModulePkg/MdeModulePkg.uni +++ b/MdeModulePkg/MdeModulePkg.uni @@ -214,6 +214,12 @@ = "TRUE - Shadow PEIM on S3 boot path after memory is ready.\n" = "FALSE - Not shadow PEIM on S3 boot path after memory is ready= .
" =20 +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMigrateTemporaryRamFirmwareV= olumes_HELP #language en-US "Enable the feature that evacuate temporary mem= ory to permanent memory or not.

\n" + = "It will allocate page to save the temporary PE= IMs resided in NEM(or CAR) to the permanent memory and change all pointers = pointed to the NEM(or CAR) to permanent memory.

\n" + = "After then, there are no pointer pointed to NE= M(or CAR) and TOCTOU volnerability can be avoid.

\n" + +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMigrateTemporaryRamFirmwareV= olumes_PROMPT #language en-US "Enable the feature that evacuate temporary m= emory to permanent memory or not" + #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdAcpiDefaultOemId_PROMPT #la= nguage en-US "Default OEM ID for ACPI table creation" =20 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdAcpiDefaultOemId_HELP #lang= uage en-US "Default OEM ID for ACPI table creation, its length must be 0x6 = bytes to follow ACPI specification." --=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 (#63093): https://edk2.groups.io/g/devel/message/63093 Mute This Topic: https://groups.io/mt/75720846/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-