From 6b8a967eb046c139ef9052820bd6b47d05bd6f61 Mon Sep 17 00:00:00 2001 From: Gowtham Suresh Kumar Date: Tue, 21 Dec 2021 18:53:23 +0000 Subject: [PATCH] arm-bsp/secure-partitions: corstone1000: Change UID of variable index in SMM This patch fixes the os_indications setVariable() failure. The variable index UID in SMM gateway which was 1 is changed in this patch. TFM has a special usage for variable with UID 1, which makes it write once only. This is not required for SMM variable index. Change-Id: I50d60b87d3ef44ffd50e71ec4f20d31fdacf7acd Signed-off-by: Gowtham Suresh Kumar --- ...-Change-UID-of-variable-index-in-SMM.patch | 34 +++++++++++++++++++ .../trusted-services/ts-corstone1000.inc | 1 + 2 files changed, 35 insertions(+) create mode 100644 meta-arm-bsp/recipes-security/trusted-services/secure-partitions/0029-Change-UID-of-variable-index-in-SMM.patch diff --git a/meta-arm-bsp/recipes-security/trusted-services/secure-partitions/0029-Change-UID-of-variable-index-in-SMM.patch b/meta-arm-bsp/recipes-security/trusted-services/secure-partitions/0029-Change-UID-of-variable-index-in-SMM.patch new file mode 100644 index 00000000..fe31f8f2 --- /dev/null +++ b/meta-arm-bsp/recipes-security/trusted-services/secure-partitions/0029-Change-UID-of-variable-index-in-SMM.patch @@ -0,0 +1,34 @@ +Upstream-Status: Pending [Not submitted to upstream yet] +Signed-off-by: Gowtham Suresh Kumar + +From 451eac3ed36231380b8e3dd0ad76c1a3c010a375 Mon Sep 17 00:00:00 2001 +From: Gowtham Suresh Kumar +Date: Mon, 20 Dec 2021 19:54:39 +0000 +Subject: [PATCH 1/3] Change UID of variable index in SMM + +This patch fixes the os_indications setVariable() failure. The variable +index UID in SMM gateway which was 1 is changed in this patch. TFM has a +special usage for variable with UID 1, which makes it write once only. +This is not required for SMM variable index. + +%% original patch: 0029-Change-UID-of-variable-index-in-SMM.patch +--- + components/service/smm_variable/backend/uefi_variable_store.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/service/smm_variable/backend/uefi_variable_store.c b/components/service/smm_variable/backend/uefi_variable_store.c +index 6a90f46..1bb869a 100644 +--- a/components/service/smm_variable/backend/uefi_variable_store.c ++++ b/components/service/smm_variable/backend/uefi_variable_store.c +@@ -67,7 +67,7 @@ static efi_status_t check_name_terminator( + size_t name_size); + + /* Private UID for storing the variable index */ +-#define VARIABLE_INDEX_STORAGE_UID (1) ++#define VARIABLE_INDEX_STORAGE_UID (0x787) + + /* Default maximum variable size - + * may be overridden using uefi_variable_store_set_storage_limits() +-- +2.17.1 + diff --git a/meta-arm-bsp/recipes-security/trusted-services/ts-corstone1000.inc b/meta-arm-bsp/recipes-security/trusted-services/ts-corstone1000.inc index 96934303..55f5a273 100644 --- a/meta-arm-bsp/recipes-security/trusted-services/ts-corstone1000.inc +++ b/meta-arm-bsp/recipes-security/trusted-services/ts-corstone1000.inc @@ -39,6 +39,7 @@ SRC_URI:append = " \ file://0026-Add-logs-to-functions-in-SMM-gateway-SP.patch \ file://0027-Configure-storage-size.patch \ file://0028-Revert-Add-uefi-variable-append-write-support.patch \ + file://0029-Change-UID-of-variable-index-in-SMM.patch \ " SRC_URI_MBED = "git://github.com/ARMmbed/mbed-crypto.git;protocol=https;branch=development;name=mbed;destsuffix=git/mbedcrypto"