From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web12.51652.1595841547555343383 for ; Mon, 27 Jul 2020 02:19:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QeMELeVq; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595841546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bcuH11Qdks0lrwtzfdjaRyoO9/cBqhrMBnr/EtUIuGw=; b=QeMELeVqDTV5HzLizL5LvWwcHpNY1CAE+qohoZ0nAsW4a5b3KqHT86IqAr35dwFAnTwLCm BQhEaOM97wOtn4Ujha7OtZzah6znoWtkB0O7wTsn0oEhNl9Ndmh7CZ0hpQdqJakCEIdSlE EoW5ZPRWDm9DUhYikDQtUqsOQCoSeIM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-295-WvBmBwe-OIqy37ti3XtiQw-1; Mon, 27 Jul 2020 05:19:02 -0400 X-MC-Unique: WvBmBwe-OIqy37ti3XtiQw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 246B9186A822; Mon, 27 Jul 2020 09:19:01 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-235.ams2.redhat.com [10.36.113.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id E77165F1EA; Mon, 27 Jul 2020 09:18:54 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v8 2/9] MdeModulePkg/PeiCore: Enable T-RAM evacuation in PeiCore (CVE-2019-11098) To: devel@edk2.groups.io, guomin.jiang@intel.com Cc: Michael Kubacki , Jian J Wang , Hao A Wu , Dandan Bi , Liming Gao , Debkumar De , Harry Han , Catharine West References: <20200724095446.598-1-guomin.jiang@intel.com> <20200724095446.598-3-guomin.jiang@intel.com> From: "Laszlo Ersek" Message-ID: <22425c6b-2134-eb74-0e41-965005e6c406@redhat.com> Date: Mon, 27 Jul 2020 11:18:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200724095446.598-3-guomin.jiang@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 07/24/20 11:54, Guomin Jiang wrote: > From: Michael Kubacki > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1614 > > Introduces new changes to PeiCore to move the contents of temporary > RAM visible to the PeiCore to permanent memory. This expands on > pre-existing shadowing support in the PeiCore to perform the following > additional actions: > > 1. Migrate pointers in PPIs installed in PeiCore to the permanent > memory copy of PeiCore. > > 2. Copy all installed firmware volumes to permanent memory. > > 3. Relocate and fix up the PEIMs within the firmware volumes. > > 4. Convert all PPIs into the migrated firmware volume to the corresponding > PPI address in the permanent memory location. > > This applies to PPIs and PEI notifications. > > 5. Convert all status code callbacks in the migrated firmware volume to > the corresponding address in the permanent memory location. > > 6. Update the FV HOB to the corresponding firmware volume in permanent > memory. > > 7. Use PcdMigrateTemporaryRamFirmwareVolumes to control if enable the > feature or not. when disable the PCD, the EvacuateTempRam() will > never be called. > > The function control flow as below: > PeiCore() > DumpPpiList() > EvacuateTempRam() > ConvertPeiCorePpiPointers() > ConvertPpiPointersFv() > MigratePeimsInFv() > MigratePeim() > PeiGetPe32Data() > LoadAndRelocatePeCoffImageInPlace() > MigrateSecModulesInFv() > ConvertPpiPointersFv() > ConvertStatusCodeCallbacks() > ConvertFvHob() > RemoveFvHobsInTemporaryMemory() > DumpPpiList() > > 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: Michael Kubacki > --- > MdeModulePkg/Core/Pei/PeiMain.inf | 2 + > MdeModulePkg/Core/Pei/PeiMain.h | 169 +++++++ > MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 417 +++++++++++++++++- > MdeModulePkg/Core/Pei/Image/Image.c | 130 +++++- > MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 82 ++++ > MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 22 +- > MdeModulePkg/Core/Pei/Ppi/Ppi.c | 286 ++++++++++++ > 7 files changed, 1099 insertions(+), 9 deletions(-) Acked-by: Laszlo Ersek