From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web12.303.1662438976985344787 for ; Mon, 05 Sep 2022 21:36:27 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=FFxak5of; spf=permerror, err=too many SPF records (domain: intel.com, ip: 192.55.52.115, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662438987; x=1693974987; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QgL3MvwSFii/pjgLEVNK8M7bLh8I7NDPNaiq5LD2LtU=; b=FFxak5ofoweOa1rDbfGRww/0R/OciQBnKDgpenRDY0nceoa2oHp3Hr/H BKUSIG1QcR12VBFLhr21QplDcji/vmXm+lva7KT/Lsv05aknLZiy1OSiR vwDsLHBMJyBez9U8RCIvMGjCRmSX3wN2SMb/ssweJTZhtg9+pVyhP9ukt U18nS/qltASLZbTYrItj2poKZuGM+7a+1pPVatrMud/HJi5fcPs3HhsGc tW7AWynTWkhzTqq088WvrcJEdZei6Ko/jY/FcCaVAxf56vm0DxBeC4z3y yhX+TU0KdjTvghiGckMcBel/+SEqVa/XJEjSfTVPIag+bffRKLvq9IzDO g==; X-IronPort-AV: E=McAfee;i="6500,9779,10461"; a="296502117" X-IronPort-AV: E=Sophos;i="5.93,293,1654585200"; d="scan'208";a="296502117" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2022 21:36:26 -0700 X-IronPort-AV: E=Sophos;i="5.93,293,1654585200"; d="scan'208";a="675517336" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.238.4.118]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2022 21:36:25 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Gerd Hoffmann Subject: [PATCH V5 6/8] OvmfPkg/NvVarsFileLib: Shortcut ConnectNvVarsToFileSystem in secure-boot Date: Tue, 6 Sep 2022 12:35:58 +0800 Message-Id: X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Min M Xu OvmfPkg/Library/NvVarsFileLib allows loading variables into emulated varstore from a on-disk NvVars file. We can't allow that when secure boot is active. So check secure-boot feature and shortcut the ConnectNvVarsToFileSystem() function when sb is enabled. Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Suggested-by: Gerd Hoffmann Acked-by: Gerd Hoffmann Signed-off-by: Min Xu --- OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.c b/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.c index 21b71524ea48..72289da35819 100644 --- a/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.c +++ b/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.c @@ -28,6 +28,12 @@ ConnectNvVarsToFileSystem ( IN EFI_HANDLE FsHandle ) { + #ifdef SECURE_BOOT_FEATURE_ENABLED + + return EFI_UNSUPPORTED; + + #else + EFI_STATUS Status; // @@ -46,6 +52,7 @@ ConnectNvVarsToFileSystem ( } return Status; + #endif } /** -- 2.29.2.windows.2