blob: c7ac38f77c6655eed51c6aaa066bc39f154f147c [file] [log] [blame]
Brad Bishopbec4ebc2022-08-03 09:55:16 -04001From b81214dea7056c3877aa9eb775557dc4702660ec Mon Sep 17 00:00:00 2001
2From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
3Date: Sun, 12 Dec 2021 17:58:08 +0000
4Subject: [PATCH 21/27] Update comm_buf when EFI_BUFFER_TOO_SMALL
5
6When the received buffer is larger than the comm buffer,
7the contents of the shared buffer which can fit in the
8comm buffer should be read before returning.
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 | 1 +
14 1 file changed, 1 insertion(+)
15
16diff --git a/lib/efi_loader/efi_variable_tee.c b/lib/efi_loader/efi_variable_tee.c
17index 38655a9dbb7c..67743d1f8fce 100644
18--- a/lib/efi_loader/efi_variable_tee.c
19+++ b/lib/efi_loader/efi_variable_tee.c
20@@ -357,6 +357,7 @@ static efi_status_t __efi_runtime ffa_mm_communicate(void *comm_buf, ulong comm_
21 sizeof(size_t);
22
23 if (rx_data_size > comm_buf_size) {
24+ efi_memcpy_runtime(comm_buf, virt_shared_buf, comm_buf_size);
25 unmap_sysmem(virt_shared_buf);
26 return EFI_BUFFER_TOO_SMALL;
27 }
28--
292.30.2
30