Fix no return value of u_malloc_ocall in sgx_ustdc of Rust SGX SDK

This commit is contained in:
He Sun 2020-09-01 14:33:29 +08:00 committed by Tate, Hongliang Tian
parent 617f75904f
commit 03ab3b0338

@ -1,7 +1,7 @@
From ba4147e76c7cfe17f843b7b28bf535d04bc5db77 Mon Sep 17 00:00:00 2001 From ebd4f84dd2561d5ef381312ef9934a6076e62915 Mon Sep 17 00:00:00 2001
From: "Tate, Hongliang Tian" <tate.thl@antfin.com> From: "Tate, Hongliang Tian" <tate.thl@antfin.com>
Date: Wed, 3 Jun 2020 08:11:35 +0000 Date: Wed, 3 Jun 2020 08:11:35 +0000
Subject: [PATCH 1/3] Add support for integrity-only SGX files Subject: [PATCH 1/4] Add support for integrity-only SGX files
--- ---
samplecode/unit-test/enclave/src/lib.rs | 2 + samplecode/unit-test/enclave/src/lib.rs | 2 +
@ -374,10 +374,10 @@ index 3c2db3a4..f96cd9e8 100644
2.17.1 2.17.1
From 982897c432dd98c6d63691ddb238acd29db4233f Mon Sep 17 00:00:00 2001 From b126b99cd8cf12ac4971915d408d48a557bc5399 Mon Sep 17 00:00:00 2001
From: "Tate, Hongliang Tian" <tate.thl@antfin.com> From: "Tate, Hongliang Tian" <tate.thl@antfin.com>
Date: Wed, 3 Jun 2020 08:35:53 +0000 Date: Wed, 3 Jun 2020 08:35:53 +0000
Subject: [PATCH 2/3] Add data structures for #PF and #GP exceptions Subject: [PATCH 2/4] Add data structures for #PF and #GP exceptions
--- ---
sgx_types/src/types.rs | 11 +++++++++++ sgx_types/src/types.rs | 11 +++++++++++
@ -421,10 +421,10 @@ index 4f191364..651d088e 100644
2.17.1 2.17.1
From 43b32d82c09a796fd52b954dc0217ac9ce01c559 Mon Sep 17 00:00:00 2001 From 3b224780e7f948753ef27e67677a5fc6a2a49961 Mon Sep 17 00:00:00 2001
From: "Tate, Hongliang Tian" <tate.thl@antfin.com> From: "Tate, Hongliang Tian" <tate.thl@antfin.com>
Date: Wed, 3 Jun 2020 08:37:47 +0000 Date: Wed, 3 Jun 2020 08:37:47 +0000
Subject: [PATCH 3/3] Add a new exception type: simulated Subject: [PATCH 3/4] Add a new exception type: simulated
--- ---
sgx_types/src/types.rs | 1 + sgx_types/src/types.rs | 1 +
@ -445,3 +445,28 @@ index 651d088e..ef43d7d6 100644
-- --
2.17.1 2.17.1
From 53707096d65d2c2439246274328484094be28c05 Mon Sep 17 00:00:00 2001
From: volcano <volcano_dr@163.com>
Date: Mon, 31 Aug 2020 11:12:44 +0800
Subject: [PATCH 4/4] fix no return value of u_malloc_ocall
---
sgx_ustdc/mem.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sgx_ustdc/mem.c b/sgx_ustdc/mem.c
index 3dceb037..5e4aea84 100644
--- a/sgx_ustdc/mem.c
+++ b/sgx_ustdc/mem.c
@@ -26,6 +26,7 @@ void *u_malloc_ocall(int *error, size_t size)
if (error) {
*error = ret == NULL ? errno : 0;
}
+ return ret;
}
void u_free_ocall(void *p)
--
2.17.1