OvmfPkg/PlatformInitLib: do not ASSERT on an invalid NvVarStore

The varstore lives in writable pflash, so it is external input and an
interrupted write or a crafted image can damage it. That needs an error
path, not an ASSERT: a DEBUG build ends in CpuDeadLoop() with no output
at all, while a RELEASE build already carries on without the emulated
store.

Log the error and return. Both callers ignore the return value, so the
boot continues as it does in a RELEASE build.

Signed-off-by: Denis V. Lunev <den@openvz.org>
This commit is contained in:
Denis V. Lunev 2026-08-11 13:40:05 +02:00
parent 5102939369
commit e822c82b12

View file

@ -1003,7 +1003,7 @@ PlatformInitEmuVariableNvStore (
ASSERT (Size < EmuVariableNvStoreSize);
if (!PlatformValidateNvVarStore (Base, PcdGet32 (PcdCfvRawDataSize))) {
ASSERT (FALSE);
DEBUG ((DEBUG_ERROR, "Invalid FlashNvStorage, EmuVariableNvStore not initialized.\n"));
return EFI_INVALID_PARAMETER;
}