Skip to content

Commit 12223e5

Browse files
committed
Linux 2.3.1 Open Source Gold Release
Bug fixes Signed-off-by: Li, Xun <[email protected]>
1 parent c08051e commit 12223e5

File tree

18 files changed

+28
-179
lines changed

18 files changed

+28
-179
lines changed

README.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ To build the Intel(R) SGX PSW installer, enter the following command:
137137
```
138138
$ make deb_sgx_enclave_common_pkg
139139
```
140-
You can find the generated Intel(R) SGX PSW installer ``libsgx-enclave-common_${version}-${revision}_amd64.deb`` located under `linux/installer/deb/libsgx-enclave-common`, where `${version}` refers to the version number and the `${revision}` refers to the revision number of the package.
141-
**Note**: On Ubuntu 18.04, besides the Intel(R) SGX PSW installer, the above command generates another debug symbol package named ``libsgx-enclave-common-dbgsym_${version}-${revision}_amd64.ddeb`` for debug purpose. On Ubuntu 16.04, if you want to keep debug symbols in the Intel(R) SGX PSW installer, before building the Intel(R) SGX PSW, you need to export an environment variable to ensure the debug symbols not stripped:
140+
You can find the generated Intel(R) SGX PSW installer ``libsgx-enclave-common_${version}-${revision}_${arch}.deb`` located under `linux/installer/deb/libsgx-enclave-common`, where `${version}` refers to the version number and the `${arch}` refers to the platform.
141+
**Note**: On Ubuntu 18.04, besides the Intel(R) SGX PSW installer, the above command generates another debug symbol package named ``libsgx-enclave-common-dbgsym_${version}-${revision}_${arch}.ddeb`` for debug purpose. On Ubuntu 16.04, if you want to keep debug symbols in the Intel(R) SGX PSW installer, before building the Intel(R) SGX PSW, you need to export an environment variable to ensure the debug symbols not stripped:
142142
```
143-
$ export DEB_BUILD_OPTIONS="nostrip"
143+
$export DEB_BUILD_OPTIONS="nostrip"
144144
```
145145
**Note**: The above command builds the Intel(R) SGX PSW with default configuration firstly and then generates the target PSW Installer. To build the Intel(R) SGX PSW Installer without optimization and with full debug information kept in the tools and libraries, enter the following command:
146146
```
@@ -158,12 +158,6 @@ To build the Intel(R) SGX PSW installer, enter the following command:
158158
```
159159
$ make psw_install_pkg DEBUG=1
160160
```
161-
To build the Intel(R) SGX PSW development installer, enter the following command:
162-
- On Ubuntu 16.04 and Ubuntu 18.04:
163-
```
164-
$ make deb_sgx_enclave_common_dev_pkg
165-
```
166-
You can find the generated Intel(R) SGX PSW development installer ``libsgx-enclave-common-dev_${version}-${revision}_${arch}.deb`` located under `linux/installer/deb/libsgx-enclave-common-dev`.
167161

168162
Install the Intel(R) SGX SDK
169163
------------------------
@@ -298,12 +292,12 @@ To install the Intel(R) SGX PSW, invoke the installer with root privilege:
298292
- On Ubuntu 16.04 and Ubuntu 18.04:
299293
```
300294
$ cd linux/installer/deb/libsgx-enclave-common
301-
$ sudo dpkg -i ./libsgx-enclave-common_${version}-${revision}_amd64.deb
295+
$ sudo dpkg -i ./libsgx-enclave-common_${version}-${revision}_${arch}.deb
302296
```
303297
**NOTE**: To debug with sgx-gdb on Ubuntu 16.04, you need to ensure the Intel(R) SGX PSW is built under the condition that the environment variable ``DEB_BUILD_OPTIONS="nostrip"`` is set. On Ubuntu 18.04, you need to install the debug package by entering the following command:
304298
```
305299
$ cd linux/installer/deb/libsgx-enclave-common
306-
$ sudo dpkg -i ./libsgx-enclave-common-dbgsym_${version}-${revision}_amd64.ddeb
300+
$ sudo dpkg -i ./libsgx-enclave-common-dbgsym_${version}-${revision}_${arch}.ddeb
307301
```
308302
- On Red Hat Enterprise Linux 7.4 and CentOS 7.5:
309303
- On Fedora 27:

common/inc/internal/mini_snprintf.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
#include <stdarg.h>
5353
#include <limits.h>
5454

55-
#include "sl_util.h"
56-
5755
/*===========================================================================
5856
* Interface
5957
*===========================================================================*/

common/inc/internal/se_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*
3030
*/
31-
#define STRFILEVER "2.3.100.46354"
31+
#define STRFILEVER "2.3.101.46683"
3232
#define COPYRIGHT "Copyright (C) 2018 Intel Corporation"
3333

3434
#define URTS_VERSION "1.0.101.0"

common/inc/sgx_uswitchless.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
#include "sgx_error.h"
7373
#include "sgx_eid.h"
7474
#include "sgx_defs.h"
75+
#include "sgx_urts.h"
7576

7677
/*
7778
* A worker can be either trusted (executed inside enclave) or untrusted

download_prebuilt.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333

3434
top_dir=`dirname $0`
3535
out_dir=$top_dir
36-
optlib_name=optimized_libs_2.3.tar.gz
37-
ae_file_name=prebuilt_ae_2.3.tar.gz
38-
checksum_file=SHA256SUM_prebuilt_2.3.txt
39-
server_url_path=https://download.01.org/intel-sgx/linux-2.3/
36+
optlib_name=optimized_libs_2.3.1.tar.gz
37+
ae_file_name=prebuilt_ae_2.3.1.tar.gz
38+
checksum_file=SHA256SUM_prebuilt_2.3.1.txt
39+
server_url_path=https://download.01.org/intel-sgx/linux-2.3.1/
4040
server_optlib_url=$server_url_path/$optlib_name
4141
server_ae_url=$server_url_path/$ae_file_name
4242
server_checksum_url=$server_url_path/$checksum_file

linux/installer/bin/build-installpkg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ BUILD_DIR=${ROOT_DIR}/build/linux
5757
# Get the architecture of the build from generated binary
5858
get_arch()
5959
{
60-
local a=$(readelf -h $BUILD_DIR/sgx_sign | sed -n '2p' | awk '{print $6}')
60+
local a=$(readelf -h $BUILD_DIR/sgx_sign | sed -n '2p' | awk '/:/{print $6}')
6161
test $a = 02 && echo 'x86_64' || echo 'x86'
6262
}
6363

linux/installer/common/libsgx-enclave-common/createTarball.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ rm -fr ${INSTALL_PATH}
4747
# Get the architecture of the build from generated binary
4848
get_arch()
4949
{
50-
local a=$(readelf -h $(find ${BUILD_DIR} -name "*.so*" |head -n 1) | sed -n '2p' | awk '{print $6}')
50+
local a=$(readelf -h $(find ${BUILD_DIR} -name "*.so*" |head -n 1) | sed -n '2p' | awk '/:/{print $6}')
5151
test $a = 02 && echo 'x64' || echo 'x86'
5252
}
5353

linux/installer/common/psw/createTarball.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ rm -fr ${INSTALL_PATH}
4747
# Get the architecture of the build from generated binary
4848
get_arch()
4949
{
50-
local a=$(readelf -h $BUILD_DIR/sgx_sign | sed -n '2p' | awk '{print $6}')
50+
local a=$(readelf -h $BUILD_DIR/sgx_sign | sed -n '2p' | awk '/:/{print $6}')
5151
test $a = 02 && echo 'x64' || echo 'x86'
5252
}
5353

linux/installer/common/sdk/createTarball.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ rm -fr ${INSTALL_PATH}
4747
# Get the architecture of the build from generated binary
4848
get_arch()
4949
{
50-
local a=$(readelf -h $BUILD_DIR/sgx_sign | sed -n '2p' | awk '{print $6}')
50+
local a=$(readelf -h $BUILD_DIR/sgx_sign | sed -n '2p' | awk '/:/{print $6}')
5151
test $a = 02 && echo 'x64' || echo 'x86'
5252
}
5353

psw/ae/aesm_service/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ COMMON_SRC += ./source/qe/QEClass.cpp \
193193
./source/pse_op/pse_op_psda_ocall.cpp \
194194
./source/pse_op/pse_op_vmc_sqlite_ocall.cpp \
195195
upse.cpp \
196-
upse_iclsInit.cpp \
197196
helper.cpp \
198197
sigma_helper.cpp \
199198
interface_ocsp.cpp \

psw/ae/aesm_service/source/aesm/application/aesm_logic.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,6 @@ void AESMLogic::service_stop()
270270
}
271271
(void)aesm_free_thread(pse_thread);//release thread handle to free memory
272272

273-
ae_ret = aesm_wait_thread(CPSEClass::instance().icls_thread, &thread_ret, AESM_STOP_TIMEOUT);
274-
if (ae_ret != AE_SUCCESS || thread_ret != AE_SUCCESS)
275-
{
276-
AESM_DBG_INFO("aesm_wait_thread failed(icls_thread):(ae %d) (%d)", ae_ret, thread_ret);
277-
}
278-
(void)aesm_free_thread(CPSEClass::instance().icls_thread);//release thread handle to free memory
279273
//waiting for pending threads util timeout
280274
stop_all_long_lived_threads(0);//waiting for pending threads util timeout
281275
CPVEClass::instance().unload_enclave();

psw/ae/aesm_service/source/pse_op/PSEClass.cpp

Lines changed: 7 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,6 @@
6565
(ret) = AE_FAILURE; break; } \
6666
else if ((ret) != 0) { break; }
6767

68-
extern uint32_t upse_iclsInit();
69-
70-
static ae_error_t thread_to_init_icls(aesm_thread_arg_type_t arg)
71-
{
72-
UNUSED(arg);
73-
AESM_DBG_INFO("start to init_icls");
74-
// Just ignore the return value because the ME may still be working
75-
uint32_t status_provision = upse_iclsInit();
76-
if (status_provision != 0)
77-
{
78-
// Provisioning failed , maybe caused by missing of iCls client, etc.
79-
AESM_LOG_INFO_ADMIN("%s", g_admin_event_string_table[SGX_ADMIN_EVENT_PS_INIT_START]);
80-
// This is logged as a WARNING here, since the system may not require PS capability
81-
AESM_LOG_INFO_ADMIN("%s", g_admin_event_string_table[SGX_ADMIN_EVENT_PS_INIT_FAIL_DAL]);
82-
}
83-
return AE_SUCCESS;
84-
}
8568
ae_error_t CPSEClass::init_ps(void)
8669
{
8770
// Try to establish PSDA session during startup
@@ -111,49 +94,19 @@ ae_error_t CPSEClass::init_ps(void)
11194

11295
// Will fail if CSME is not provisioned
11396
ae_error_t ret = pPSDA->get_csme_gid(&PSDAService::instance().csme_gid);
114-
bool bCalledIcls = false;
11597
if (ret != AE_SUCCESS)
11698
{
117-
// As long as get_csme_gid fails, call iclsInit to trigger provisioning
118-
uint32_t status_provision = upse_iclsInit();
119-
bCalledIcls = true;
120-
if (status_provision != 0)
121-
{
122-
// Provisioning failed , maybe caused by missing of iCls client, etc.
123-
AESM_LOG_INFO_ADMIN("%s", g_admin_event_string_table[SGX_ADMIN_EVENT_PS_INIT_START]);
124-
// This is logged as a WARNING here, since the system may not require PS capability
125-
AESM_LOG_WARN_ADMIN("%s", g_admin_event_string_table[SGX_ADMIN_EVENT_PS_INIT_FAIL_DAL]);
126-
delete pPSDA;
127-
pPSDA = NULL;
128-
return AESM_PSE_PR_PSDA_PROVISION_ERROR;
129-
}
130-
else
131-
{
132-
// try to get CSME GID again
133-
ret = pPSDA->get_csme_gid(&PSDAService::instance().csme_gid);
134-
if (ret != AE_SUCCESS)
135-
{
136-
// Failed to get CSME GID
137-
AESM_LOG_INFO_ADMIN("%s", g_admin_event_string_table[SGX_ADMIN_EVENT_PS_INIT_START]);
138-
// This is logged as a WARNING here, since the system may not require PS capability
139-
AESM_LOG_WARN_ADMIN("%s", g_admin_event_string_table[SGX_ADMIN_EVENT_PS_INIT_FAIL_DAL]);
140-
delete pPSDA;
141-
pPSDA = NULL;
142-
return ret;
143-
}
144-
}
99+
// Failed to get CSME GID
100+
AESM_LOG_INFO_ADMIN("%s", g_admin_event_string_table[SGX_ADMIN_EVENT_PS_INIT_START]);
101+
// This is logged as a WARNING here, since the system may not require PS capability
102+
AESM_LOG_WARN_ADMIN("%s", g_admin_event_string_table[SGX_ADMIN_EVENT_PS_INIT_FAIL_DAL]);
103+
delete pPSDA;
104+
pPSDA = NULL;
105+
return ret;
145106
}
146107
delete pPSDA;
147108
pPSDA = NULL;
148109

149-
if (!bCalledIcls)
150-
{
151-
// call iclsInit in a separate thread to trigger re-key if iclsInit was not called
152-
ae_error_t ae_thread_ret = aesm_create_thread(thread_to_init_icls, 0, &icls_thread);
153-
if (AE_SUCCESS != ae_thread_ret) {
154-
AESM_DBG_WARN("Fail to create thread to init icls:( ae %d)", ae_thread_ret);
155-
}
156-
}
157110
// Set state to PROVISIONED
158111
m_status = PSE_STATUS_CSE_PROVISIONED;
159112

psw/ae/aesm_service/source/pse_op/PSEClass.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ class CPSEClass: public SingletonEnclave<CPSEClass>
6060
m_status = PSE_STATUS_INIT;
6161
m_ps_cap = PS_CAP_NOT_AVAILABLE;
6262
m_freq = se_get_tick_count_freq();
63-
icls_thread = NULL;
6463
};
6564
~CPSEClass(){
6665
};
@@ -71,7 +70,6 @@ class CPSEClass: public SingletonEnclave<CPSEClass>
7170
uint64_t m_ps_cap;
7271
uint64_t m_freq;
7372
public:
74-
aesm_thread_t icls_thread;
7573
ae_error_t init_ps(void);
7674

7775
ae_error_t create_session(

psw/ae/aesm_service/source/upse/u_long_term_pairing.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656

5757
#endif
5858
#define PSEPR_LOST_ENCLAVE_RETRY_COUNT 3
59-
extern uint32_t upse_iclsInit();
6059

6160

6261
// FLOW
@@ -106,12 +105,6 @@ ae_error_t create_sigma_long_term_pairing(bool* p_new_pairing)
106105

107106
if(status == AESM_PSDA_NOT_PROVISONED_ERROR)
108107
{
109-
// retry CSE Provision
110-
if (upse_iclsInit() == 0)
111-
{
112-
rcount--;
113-
continue;
114-
}
115108
break;
116109
}
117110

psw/ae/aesm_service/source/upse/upse_iclsInit.cpp

Lines changed: 0 additions & 79 deletions
This file was deleted.

sdk/simulation/urtssim/enclave_creator_sim.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,7 @@ int EnclaveCreatorSim::initialize(sgx_enclave_id_t enclave_id)
229229
assert(global_data_sim_ptr != NULL);
230230

231231
// Initialize the `seed' to `g_global_data_sim'.
232-
struct timespec ts;
233-
clock_gettime(CLOCK_REALTIME, &ts);
234-
global_data_sim_ptr->seed = (uint64_t)ts.tv_sec * 1000000000ULL + (uint64_t)ts.tv_nsec;
232+
global_data_sim_ptr->seed = (uint64_t)time(NULL);
235233

236234
global_data_sim_ptr->secs_ptr = ce->get_secs();
237235
sgx_cpu_svn_t temp_cpusvn = {{0}};

sdk/tseal/tSeal.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ extern "C" sgx_status_t sgx_unseal_data(const sgx_sealed_data_t *p_sealed_data,
202202
{
203203
return SGX_ERROR_INVALID_PARAMETER;
204204
}
205-
if (!sgx_is_within_enclave(p_decrypted_text_length, sizeof(*p_decrypted_text_length)))
205+
if (!sgx_is_within_enclave(p_decrypted_text_length, sizeof(p_decrypted_text_length)))
206206
{
207207
return SGX_ERROR_INVALID_PARAMETER;
208208
}
@@ -217,8 +217,8 @@ extern "C" sgx_status_t sgx_unseal_data(const sgx_sealed_data_t *p_sealed_data,
217217
}
218218

219219
if((p_additional_MACtext_length != NULL) &&
220-
(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length)) ||
221-
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length)))))
220+
(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length)) ||
221+
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length)))))
222222
{
223223
return SGX_ERROR_INVALID_PARAMETER;
224224
}

sdk/tseal/tSeal_aad.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ extern "C" sgx_status_t sgx_unmac_aadata(const sgx_sealed_data_t *p_sealed_data,
196196
{
197197
return SGX_ERROR_INVALID_PARAMETER;
198198
}
199-
if(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length)) ||
200-
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length))))
199+
if(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length)) ||
200+
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length))))
201201
{
202202
return SGX_ERROR_INVALID_PARAMETER;
203203
}

0 commit comments

Comments
 (0)