mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
MdeModulePkg/Variable/RuntimeDxe: Do not clobber Attributes on error
FindVariableInSmm() copied Attributes from the SMM response back to the caller even when GetVariable returned an error (e.g. EFI_NOT_FOUND). In the EFI_NOT_FOUND case, the returned Attributes value is 0, which overwrote the caller-provided Attributes. This differs from the native VariableServiceGetVariable() path, which only updates Attributes on EFI_SUCCESS or EFI_BUFFER_TOO_SMALL. In the SMM path, clobbering Attributes on error can cause subsequent SetVariable calls to use incorrect attributes (e.g. losing TIME_BASED_AUTH), which breaks UEFI-SCT authenticated variable tests when using the SMM gateway backend. Only copy Attributes back to the caller on EFI_SUCCESS or EFI_BUFFER_TOO_SMALL, preserving the caller-provided value on errors. Signed-off-by: Gianluca Andreotti <gianluca.andreotti@arm.com>
This commit is contained in:
parent
ffaaf0f14c
commit
ec3cc61a8b
1 changed files with 4 additions and 3 deletions
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
InitCommunicateBuffer() is really function to check the variable data size.
|
||||
|
||||
Copyright (c) 2026, ARM Ltd. All rights reserved.<BR>
|
||||
Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) Microsoft Corporation.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
|
@ -760,10 +761,10 @@ FindVariableInSmm (
|
|||
// Only update DataSize when needed
|
||||
//
|
||||
*DataSize = SmmVariableHeader->DataSize;
|
||||
}
|
||||
|
||||
if (Attributes != NULL) {
|
||||
*Attributes = SmmVariableHeader->Attributes;
|
||||
if (Attributes != NULL) {
|
||||
*Attributes = SmmVariableHeader->Attributes;
|
||||
}
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue