From: "Min Xu" <min.m.xu@intel.com>
To: devel@edk2.groups.io
Cc: Min M Xu <min.m.xu@intel.com>,
Erdem Aktas <erdemaktas@google.com>,
James Bottomley <jejb@linux.ibm.com>,
Jiewen Yao <jiewen.yao@intel.com>,
Tom Lendacky <thomas.lendacky@amd.com>,
Gerd Hoffmann <kraxel@redhat.com>
Subject: [PATCH V3 5/7] OvmfPkg/NvVarsFileLib: Shortcut ConnectNvVarsToFileSystem in secure-boot
Date: Wed, 29 Jun 2022 16:57:01 +0800 [thread overview]
Message-ID: <a116e6ad98d742ef31fa3f1b63ba5333836365d0.1656479990.git.min.m.xu@intel.com> (raw)
In-Reply-To: <cover.1656479990.git.min.m.xu@intel.com>
From: Min M Xu <min.m.xu@intel.com>
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 <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
---
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
next prev parent reply other threads:[~2022-06-29 8:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-29 8:56 [PATCH V3 0/7] Enable secure-boot when lauch OVMF with -bios parameter Min Xu
2022-06-29 8:56 ` [PATCH V3 1/7] OvmfPkg/PeilessStartupLib: Delete TdxValidateCfv Min Xu
2022-06-29 8:56 ` [PATCH V3 2/7] OvmfPkg/PlatformInitLib: Add functions for EmuVariableNvStore Min Xu
2022-06-29 8:56 ` [PATCH V3 3/7] OvmfPkg/PlatformPei: Update ReserveEmuVariableNvStore Min Xu
2022-06-29 8:57 ` [PATCH V3 4/7] OvmfPkg: Reserve and init EmuVariableNvStore in Pei-less Startup Min Xu
2022-06-29 8:57 ` Min Xu [this message]
2022-06-29 8:57 ` [PATCH V3 6/7] OvmfPkg/TdxDxe: Set PcdEmuVariableNvStoreReserved Min Xu
2022-06-29 8:57 ` [PATCH V3 7/7] OvmfPkg: Add build-flag SECURE_BOOT_FEATURE_ENABLED Min Xu
2022-06-30 13:28 ` [PATCH V3 0/7] Enable secure-boot when lauch OVMF with -bios parameter Gerd Hoffmann
2022-06-30 22:56 ` Min Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a116e6ad98d742ef31fa3f1b63ba5333836365d0.1656479990.git.min.m.xu@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox