mirror of https://github.com/acidanthera/audk.git
SecurityPkg/SecureBootConfigDxe: Fix invalid NV data issue.
Check the return value of HiiGetBrowserData() before calling HiiSetBrowserData(). HiiGetBrowserData() failed to retrieve NV data during action EFI_BROWSER_ACTION_RETRIEVE. If NV data is invalid, stop sending it to form browser. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Nickle Wang <nickle.wang@hpe.com> Signed-off-by: cinnamon shia <cinnamon.shia@hpe.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
This commit is contained in:
parent
112c6c2237
commit
488aab257f
|
@ -2,6 +2,7 @@
|
||||||
HII Config Access protocol implementation of SecureBoot configuration module.
|
HII Config Access protocol implementation of SecureBoot configuration module.
|
||||||
|
|
||||||
Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||||
|
(C) Copyright 2018 Hewlett Packard Enterprise Development LP<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -4319,6 +4320,7 @@ SecureBootCallback (
|
||||||
UINTN NameLength;
|
UINTN NameLength;
|
||||||
UINT16 *FilePostFix;
|
UINT16 *FilePostFix;
|
||||||
SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData;
|
SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData;
|
||||||
|
BOOLEAN GetBrowserDataResult;
|
||||||
|
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
SecureBootEnable = NULL;
|
SecureBootEnable = NULL;
|
||||||
|
@ -4343,7 +4345,7 @@ SecureBootCallback (
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
HiiGetBrowserData (&gSecureBootConfigFormSetGuid, mSecureBootStorageName, BufferSize, (UINT8 *) IfrNvData);
|
GetBrowserDataResult = HiiGetBrowserData (&gSecureBootConfigFormSetGuid, mSecureBootStorageName, BufferSize, (UINT8 *) IfrNvData);
|
||||||
|
|
||||||
if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
|
if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
|
||||||
if (QuestionId == KEY_SECURE_BOOT_MODE) {
|
if (QuestionId == KEY_SECURE_BOOT_MODE) {
|
||||||
|
@ -4889,7 +4891,7 @@ SecureBootCallback (
|
||||||
|
|
||||||
EXIT:
|
EXIT:
|
||||||
|
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status) && GetBrowserDataResult) {
|
||||||
BufferSize = sizeof (SECUREBOOT_CONFIGURATION);
|
BufferSize = sizeof (SECUREBOOT_CONFIGURATION);
|
||||||
HiiSetBrowserData (&gSecureBootConfigFormSetGuid, mSecureBootStorageName, BufferSize, (UINT8*) IfrNvData, NULL);
|
HiiSetBrowserData (&gSecureBootConfigFormSetGuid, mSecureBootStorageName, BufferSize, (UINT8*) IfrNvData, NULL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue