OvmfPkg/NvVarsFileLib: Shortcut ConnectNvVarsToFileSystem in secure-boot

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>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Min M Xu 2022-06-29 10:33:09 +08:00 committed by mergify[bot]
parent ee91d9ef24
commit 70165fa6e2
1 changed files with 7 additions and 0 deletions

View File

@ -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
}
/**