blob: ed4e6e27a3a42b74d2aee6bc748c58da6ff8d0cf [file] [log] [blame]
Patrick Williams7784c422022-11-17 07:29:11 -06001From 2aa665ad2cb13bc79b645db41686449a47593aab Mon Sep 17 00:00:00 2001
2From: Emekcan <emekcan.aras@arm.com>
3Date: Thu, 3 Nov 2022 17:43:40 +0000
4Subject: [PATCH] smm_gateway: GetNextVariableName Fix
5
6GetNextVariableName() should return EFI_BUFFER_TOO_SMALL
7when NameSize is smaller than the actual NameSize. It
8currently returns EFI_BUFFER_OUT_OF_RESOURCES due to setting
9max_name_len incorrectly. This fixes max_name_len error by
10replacing it with actual NameSize request by u-boot.
11
12Upstream-Status: Pending
13Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
14---
15 .../service/smm_variable/provider/smm_variable_provider.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/components/service/smm_variable/provider/smm_variable_provider.c b/components/service/smm_variable/provider/smm_variable_provider.c
19index a9679b7e..6a4b6fa7 100644
20--- a/components/service/smm_variable/provider/smm_variable_provider.c
21+++ b/components/service/smm_variable/provider/smm_variable_provider.c
22@@ -197,7 +197,7 @@ static rpc_status_t get_next_variable_name_handler(void *context, struct call_re
23 efi_status = uefi_variable_store_get_next_variable_name(
24 &this_instance->variable_store,
25 (SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME*)resp_buf->data,
26- max_name_len,
27+ ((SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME*)resp_buf->data)->NameSize,
28 &resp_buf->data_len);
29 }
30 else {
31--
322.17.1
33