Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame^] | 1 | From 2aa665ad2cb13bc79b645db41686449a47593aab Mon Sep 17 00:00:00 2001 |
| 2 | From: Emekcan <emekcan.aras@arm.com> |
| 3 | Date: Thu, 3 Nov 2022 17:43:40 +0000 |
| 4 | Subject: [PATCH] smm_gateway: GetNextVariableName Fix |
| 5 | |
| 6 | GetNextVariableName() should return EFI_BUFFER_TOO_SMALL |
| 7 | when NameSize is smaller than the actual NameSize. It |
| 8 | currently returns EFI_BUFFER_OUT_OF_RESOURCES due to setting |
| 9 | max_name_len incorrectly. This fixes max_name_len error by |
| 10 | replacing it with actual NameSize request by u-boot. |
| 11 | |
| 12 | Upstream-Status: Pending |
| 13 | Signed-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 | |
| 18 | diff --git a/components/service/smm_variable/provider/smm_variable_provider.c b/components/service/smm_variable/provider/smm_variable_provider.c |
| 19 | index 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 | -- |
| 32 | 2.17.1 |
| 33 | |