blob: 21a89a4001af2c36c0fb6dedef0fd9a255c8071f [file] [log] [blame]
Brad Bishopbec4ebc2022-08-03 09:55:16 -04001From 7db27eeaba0fd5ddb1e49977bb7e342a1980aa3d Mon Sep 17 00:00:00 2001
2From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
3Date: Sun, 12 Dec 2021 17:51:17 +0000
4Subject: [PATCH 19/27] Return proper error code when rx buffer is larger
5
6ffa_mm_communicate should return EFI_BUFFER_TOO_SMALL when
7the buffer received from the secure world is larger than the
8comm buffer as this value is forwarded by mm_communicate.
9
10Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
11Signed-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
16diff --git a/lib/efi_loader/efi_variable_tee.c b/lib/efi_loader/efi_variable_tee.c
17index 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--
302.30.2
31