From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web10.4019.1594291873369437170 for ; Thu, 09 Jul 2020 03:51:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Kc750hEu; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594291872; 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=qT7jZxQaeTT6gvllF3pp4+f5068zCOFwMt7g5qapzXQ=; b=Kc750hEu1w3vpPQNUT8xuh1IHqEestK/7lzwScBHH8plEhYHsTUNkObxg9wy9x9LcD17iV qw8Y36rB2Jgbb+8EodvLxYmBc8XwGUl6YqtSrol0OgVWU1NQo2ueccEFHm7RhzaH3rOkgv ASQQdk0ACgRRA96C9YfMW8/WyBkWce8= 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-411-q1dzTpOkMpiT3FYIGTwR7g-1; Thu, 09 Jul 2020 06:51:02 -0400 X-MC-Unique: q1dzTpOkMpiT3FYIGTwR7g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B021989077C; Thu, 9 Jul 2020 10:51:00 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-104.ams2.redhat.com [10.36.114.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id 95FC978120; Thu, 9 Jul 2020 10:50:58 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v5 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: <20200709015645.336-1-guomin.jiang@intel.com> <20200709015645.336-3-guomin.jiang@intel.com> From: "Laszlo Ersek" Message-ID: Date: Thu, 9 Jul 2020 12:50:57 +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: <20200709015645.336-3-guomin.jiang@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com 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/09/20 03:56, 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. Add PcdMigrateTemporaryRamFirmwareVolumes to control if enable the > feature or not. when the PCD disable, 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 | 168 ++++++++ > MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 402 ++++++++++++++++++ > MdeModulePkg/Core/Pei/Image/Image.c | 115 +++++ > MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 82 ++++ > MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 24 ++ > MdeModulePkg/Core/Pei/Ppi/Ppi.c | 287 +++++++++++++ > 7 files changed, 1080 insertions(+) > Acked-by: Laszlo Ersek