Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 1 | From 7db27eeaba0fd5ddb1e49977bb7e342a1980aa3d Mon Sep 17 00:00:00 2001 |
| 2 | From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com> |
| 3 | Date: Sun, 12 Dec 2021 17:51:17 +0000 |
| 4 | Subject: [PATCH 19/27] Return proper error code when rx buffer is larger |
| 5 | |
| 6 | ffa_mm_communicate should return EFI_BUFFER_TOO_SMALL when |
| 7 | the buffer received from the secure world is larger than the |
| 8 | comm buffer as this value is forwarded by mm_communicate. |
| 9 | |
| 10 | Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com> |
| 11 | Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> |
| 12 | --- |
| 13 | lib/efi_loader/efi_variable_tee.c | 2 +- |
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 15 | |
| 16 | diff --git a/lib/efi_loader/efi_variable_tee.c b/lib/efi_loader/efi_variable_tee.c |
| 17 | index b6be2b54a030..38655a9dbb7c 100644 |
| 18 | --- a/lib/efi_loader/efi_variable_tee.c |
| 19 | +++ b/lib/efi_loader/efi_variable_tee.c |
| 20 | @@ -358,7 +358,7 @@ static efi_status_t __efi_runtime ffa_mm_communicate(void *comm_buf, ulong comm_ |
| 21 | |
| 22 | if (rx_data_size > comm_buf_size) { |
| 23 | unmap_sysmem(virt_shared_buf); |
| 24 | - return EFI_OUT_OF_RESOURCES; |
| 25 | + return EFI_BUFFER_TOO_SMALL; |
| 26 | } |
| 27 | |
| 28 | efi_memcpy_runtime(comm_buf, virt_shared_buf, rx_data_size); |
| 29 | -- |
| 30 | 2.30.2 |
| 31 | |