aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_var_common.c
diff options
context:
space:
mode:
authorMasahisa Kojima <masahisa.kojima@linaro.org>2023-02-02 22:53:35 +0900
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-02-10 13:05:39 +0100
commit454a9442fbce761db7655381fdfaded8f09c8cf3 (patch)
treef006b7900a553c3bf6907bfaad34fbe8f3a962f5 /lib/efi_loader/efi_var_common.c
parent1f0583beeb32b0eab4d87ea9c0bef247432aa0c6 (diff)
efi_loader: update attribute check for QueryVariableInfo()
Current U-Boot supports two EFI variable service, U-Boot own implementation and op-tee based StMM variable service. With ACS Security Interface Extension(SIE) v22.10_SIE_REL1.1.0, there are several failure items of QueryVariableInfo(). Current attribute check for QueryVariableInfo() was implemented based on the Self Certification Test (SCT) II Case Specification, June 2017, chapter 4.1.4 QueryVariableInfo(). This test case specification is outdated and don't align at all with the SCT test case code, and UEFI specification v2.10 does not clearly define the priority of the attribute check. For U-Boot standard case that EFI variables are stored in a file in the ESP, this commit modifies the attribute check to get align to the EDK2 implementation. For latter case(op-tee based StMM variable service), parameter check should be delegated to StMM. Now all ACS SIE QueryVariableInfo() test cases passed both EFI variable storage implementations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib/efi_loader/efi_var_common.c')
-rw-r--r--lib/efi_loader/efi_var_common.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/efi_loader/efi_var_common.c b/lib/efi_loader/efi_var_common.c
index eb83702781..ad50bffd2b 100644
--- a/lib/efi_loader/efi_var_common.c
+++ b/lib/efi_loader/efi_var_common.c
@@ -165,17 +165,9 @@ efi_status_t EFIAPI efi_query_variable_info(
if (!maximum_variable_storage_size ||
!remaining_variable_storage_size ||
- !maximum_variable_size ||
- !(attributes & EFI_VARIABLE_BOOTSERVICE_ACCESS))
+ !maximum_variable_size)
return EFI_EXIT(EFI_INVALID_PARAMETER);
- if ((attributes & ~(u32)EFI_VARIABLE_MASK) ||
- (attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) ||
- (attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) ||
- (!IS_ENABLED(CONFIG_EFI_SECURE_BOOT) &&
- (attributes & EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)))
- return EFI_EXIT(EFI_UNSUPPORTED);
-
ret = efi_query_variable_info_int(attributes,
maximum_variable_storage_size,
remaining_variable_storage_size,