From nobody Mon Feb 9 23:39:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+99221+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+99221+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1674914367; cv=none; d=zohomail.com; s=zohoarc; b=LsC+cMTuDJ2jrjIyZgo2eum1evkce/rjbmSW8EHkmiawDedcixgVZ4UHNvRwP+eMo6bNqmBm9AWATlnUhBTOX8tKYnB58sZpOoNWbPsnNhkfYVNNJCP6AHpt9EY69DDs7vv1roQvL5+fhGyaKk3FPGYhXDv3FvhRgeQrf9djifs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674914367; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=qVaNIiXWaEy8ehxBI7KzYf8fw650A/DOt3GW/zkCD/I=; b=K9TDFDFrygsiWMqABwFGDu8gtAyrvLqDQlkINysluKljqHG65UcKkMnCvq+WpvBtAyhgnD4IFgTgOQaOe3pvl3YzaVFV0fRwPphUgAsxudv+rGVLiPrHkYvMRfAcpe4IFDmGjZnANDmZ6RNv/F+3t7Oei18kvSYPkGL/PGmR7as= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+99221+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1674914367033952.4854077511264; Sat, 28 Jan 2023 05:59:27 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id IpD4YY1788612xV30zirAFcN; Sat, 28 Jan 2023 05:59:26 -0800 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web10.13668.1674914336767550554 for ; Sat, 28 Jan 2023 05:59:25 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10604"; a="389670839" X-IronPort-AV: E=Sophos;i="5.97,254,1669104000"; d="scan'208";a="389670839" X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2023 05:59:25 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10604"; a="787512719" X-IronPort-AV: E=Sophos;i="5.97,254,1669104000"; d="scan'208";a="787512719" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.31.196]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2023 05:59:22 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Erdem Aktas , James Bottomley , Jiewen Yao , Gerd Hoffmann , Tom Lendacky , Michael Roth Subject: [edk2-devel] [PATCH V5 11/13] OvmfPkg/OvmfPkgX64: Measure TdHob and Configuration FV in SecMain Date: Sat, 28 Jan 2023 21:58:40 +0800 Message-Id: <20230128135842.980-12-min.m.xu@intel.com> In-Reply-To: <20230128135842.980-1-min.m.xu@intel.com> References: <20230128135842.980-1-min.m.xu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,min.m.xu@intel.com X-Gm-Message-State: dOaAGSfeelnOnqM3THgNJAvOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1674914366; bh=P+abHFUyzJ4QIgjydKp3q7UJ9OCYjT2bisQVWnNjlEw=; h=Cc:Date:From:Reply-To:Subject:To; b=mozS8Bsoe8xdFPOC7wq8RjoGZRpEcFW8K8KEjciuhyqDVOHbsTfioEPKu6c5KqF9ONx lv9kqQsPOQ8nLO25lL17a+yaWNGqh5VdAW4jnriOOOMKXKSF2rTHGVZJxM6BZ5OmD90eJ faQOaqU+h3H9hW2smZ8Infgj5cJEXtwEEnk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1674914369027100002 Content-Type: text/plain; charset="utf-8" From: Min M Xu BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4243 TdHob and Configuration FV (Cfv) are external inputs from VMM. From the security perspective, they should be measured before they're consumed. This patch measures TdHob and Cfv and stores the measurement values in WorkArea. Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Tom Lendacky Cc: Michael Roth Signed-off-by: Min Xu Acked-by: Gerd Hoffmann --- OvmfPkg/Sec/SecMain.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c index a27dc9406b70..4bb3b641701e 100644 --- a/OvmfPkg/Sec/SecMain.c +++ b/OvmfPkg/Sec/SecMain.c @@ -760,6 +760,19 @@ SecCoreStartupWithStack ( =20 #if defined (TDX_GUEST_SUPPORTED) if (CcProbe () =3D=3D CcGuestTypeIntelTdx) { + // + // From the security perspective all the external input should be meas= ured before + // it is consumed. TdHob and Configuration FV (Cfv) image are passed f= rom VMM + // and should be measured here. + // + if (EFI_ERROR (TdxHelperMeasureTdHob ())) { + CpuDeadLoop (); + } + + if (EFI_ERROR (TdxHelperMeasureCfvImage ())) { + CpuDeadLoop (); + } + // // For Td guests, the memory map info is in TdHobLib. It should be pro= cessed // first so that the memory is accepted. Otherwise access to the unacc= epted --=20 2.29.2.windows.2 -=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 (#99221): https://edk2.groups.io/g/devel/message/99221 Mute This Topic: https://groups.io/mt/96587225/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-