mirror of https://github.com/acidanthera/audk.git
Remove the RT attribute for HDDP variable and validate the variable content before using it.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15545 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
ed2867debc
commit
f3fc9d8dc9
|
@ -2524,12 +2524,29 @@ BdsExpandPartitionPartialDevicePathToFull (
|
|||
// If exist, search the front path which point to partition node in the variable instants.
|
||||
// If fail to find or HD_BOOT_DEVICE_PATH_VARIABLE_NAME not exist, reconnect all and search in all system
|
||||
//
|
||||
CachedDevicePath = BdsLibGetVariableAndSize (
|
||||
GetVariable2 (
|
||||
HD_BOOT_DEVICE_PATH_VARIABLE_NAME,
|
||||
&gHdBootDevicePathVariablGuid,
|
||||
(VOID **) &CachedDevicePath,
|
||||
&CachedDevicePathSize
|
||||
);
|
||||
|
||||
//
|
||||
// Delete the invalid HD_BOOT_DEVICE_PATH_VARIABLE_NAME variable.
|
||||
//
|
||||
if ((CachedDevicePath != NULL) && !IsDevicePathValid (CachedDevicePath, CachedDevicePathSize)) {
|
||||
FreePool (CachedDevicePath);
|
||||
CachedDevicePath = NULL;
|
||||
Status = gRT->SetVariable (
|
||||
HD_BOOT_DEVICE_PATH_VARIABLE_NAME,
|
||||
&gHdBootDevicePathVariablGuid,
|
||||
0,
|
||||
0,
|
||||
NULL
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
if (CachedDevicePath != NULL) {
|
||||
TempNewDevicePath = CachedDevicePath;
|
||||
DeviceExist = FALSE;
|
||||
|
@ -2591,7 +2608,7 @@ BdsExpandPartitionPartialDevicePathToFull (
|
|||
Status = gRT->SetVariable (
|
||||
HD_BOOT_DEVICE_PATH_VARIABLE_NAME,
|
||||
&gHdBootDevicePathVariablGuid,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||
GetDevicePathSize (CachedDevicePath),
|
||||
CachedDevicePath
|
||||
);
|
||||
|
@ -2690,7 +2707,7 @@ BdsExpandPartitionPartialDevicePathToFull (
|
|||
Status = gRT->SetVariable (
|
||||
HD_BOOT_DEVICE_PATH_VARIABLE_NAME,
|
||||
&gHdBootDevicePathVariablGuid,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||
GetDevicePathSize (CachedDevicePath),
|
||||
CachedDevicePath
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue