]> git.dujemihanovic.xyz Git - u-boot.git/commit
efi_loader: fix append write behavior to non-existent variable
authorMasahisa Kojima <kojima.masahisa@socionext.com>
Tue, 2 Apr 2024 09:09:50 +0000 (18:09 +0900)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 8 Apr 2024 11:01:13 +0000 (13:01 +0200)
commit584a2ada6e5e7752ad1af2fd54fa8d424a4da8d6
tree95a0e59a136fc576e5f15e5f8564a1cacb30c9df
parent73d533b2441e862f5d946883356f9a69f09d1422
efi_loader: fix append write behavior to non-existent variable

Current "variables" efi_selftest result is inconsistent
between the U-Boot file storage and the tee-based StandaloneMM
RPMB secure storage.

U-Boot file storage implementation does not accept SetVariale
call to non-existent variable with EFI_VARIABLE_APPEND_WRITE,
it return EFI_NOT_FOUND.
However it is accepted and new variable is created in EDK II
StandaloneMM implementation if valid data and size are specified.
If data size is 0, EFI_SUCCESS is returned.

Since UEFI specification does not clearly describe the behavior
of the append write to non-existent variable, let's update
the U-Boot file storage implementation to get aligned with
the EDK II reference implementation.

Signed-off-by: Masahisa Kojima <kojima.masahisa@socionext.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
lib/efi_loader/efi_variable.c
lib/efi_selftest/efi_selftest_variables.c