From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web12.32335.1656631779038420889 for ; Thu, 30 Jun 2022 16:29:51 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=J6EsgNV/; spf=pass (domain: intel.com, ip: 134.134.136.126, 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=1656631791; x=1688167791; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=g9bRpRFGgI0vFdcQ0fUG3itoVAMnPRSXGStRsQ06b9g=; b=J6EsgNV/qVF9f1rvAFL9UDcz0nH1R+rFKvkweJBfzGbP/nXhVBz6xqBA oZuQ+K9DozCaT7EVQRkeeOwMhkAVPYJjzxPj1DAMHjSW6XNXNIXgS27mS +Dpvc96fjQX3GumgEwWRkyvragVThwquOjNzvma2yDPuYPH+QfPk8Syvb LdwKY9MS+segCdz72/oSfh0eBHMcbL7gyYkNoLFGHLAh6L67797kvi1QV 5bq52R1KjNgHBKgmJXWsUz2EM+O6OzQxryCpjND7dKzl7si7zwbPoeJ/G sjODAhzqBWFZruu8airSG2W8tCKScsKTcd3zn60sw0Ns8/WlwrO7TChC7 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10394"; a="265528354" X-IronPort-AV: E=Sophos;i="5.92,235,1650956400"; d="scan'208";a="265528354" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 16:29:50 -0700 X-IronPort-AV: E=Sophos;i="5.92,235,1650956400"; d="scan'208";a="648098703" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.29.210]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 16:29:47 -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 V4 6/8] OvmfPkg/NvVarsFileLib: Shortcut ConnectNvVarsToFileSystem in secure-boot Date: Fri, 1 Jul 2022 07:29:15 +0800 Message-Id: <970dca46a90a9b6a00f084e8663f22ee712a7057.1656630360.git.min.m.xu@intel.com> 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 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