1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-05-07 16:59:30 +00:00

arm-bsp/trusted-services: corstone1000: GetNextVariableName Fix

This patch is required to handle one of the corner cases of the
GetNextVariableName EFI service as specified in the UEFI spec.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Emekcan Aras
2023-06-22 14:08:31 +01:00
committed by Jon Mason
parent 8a014d8978
commit fa6e20d33b
2 changed files with 34 additions and 0 deletions
@@ -0,0 +1,33 @@
From 2aa665ad2cb13bc79b645db41686449a47593aab Mon Sep 17 00:00:00 2001
From: Emekcan <emekcan.aras@arm.com>
Date: Thu, 3 Nov 2022 17:43:40 +0000
Subject: [PATCH] smm_gateway: GetNextVariableName Fix
GetNextVariableName() should return EFI_BUFFER_TOO_SMALL
when NameSize is smaller than the actual NameSize. It
currently returns EFI_BUFFER_OUT_OF_RESOURCES due to setting
max_name_len incorrectly. This fixes max_name_len error by
replacing it with actual NameSize request by u-boot.
Upstream-Status: Pending
Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
---
.../service/smm_variable/provider/smm_variable_provider.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/service/smm_variable/provider/smm_variable_provider.c b/components/service/smm_variable/provider/smm_variable_provider.c
index a9679b7e..6a4b6fa7 100644
--- a/components/service/smm_variable/provider/smm_variable_provider.c
+++ b/components/service/smm_variable/provider/smm_variable_provider.c
@@ -197,7 +197,7 @@ static rpc_status_t get_next_variable_name_handler(void *context, struct call_re
efi_status = uefi_variable_store_get_next_variable_name(
&this_instance->variable_store,
(SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME*)resp_buf->data,
- max_name_len,
+ ((SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME*)resp_buf->data)->NameSize,
&resp_buf->data_len);
}
else {
--
2.17.1
@@ -5,6 +5,7 @@ SRC_URI:append:corstone1000 = " \
file://0001-Add-stub-capsule-update-service-components.patch;patchdir=../trusted-services \
file://0002-Fixes-in-AEAD-for-psa-arch-test-54-and-58.patch;patchdir=../trusted-services \
file://0003-FMP-Support-in-Corstone1000.patch;patchdir=../trusted-services \
file://0004-GetNextVariableName-Fix.patch;patchdir=../trusted-services \
"