Skip to content

Commit ce032b0

Browse files
committed
Linux 2.1.2 Open Source Gold Release
Signed-off-by: Li, Xun <[email protected]>
1 parent 7ce7e24 commit ce032b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+741
-381
lines changed

SampleCode/SampleEnclave/App/Edger8rSyntax/Pointers.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,6 @@ void edger8r_pointer_attributes(void)
104104
for (int i = 0; i < 10; i++)
105105
assert(arr[i] == (9 - i));
106106

107-
memset(arr, 0x0, sizeof(arr));
108-
ret = ecall_pointer_sizefunc(global_eid, (char *)arr);
109-
if (ret != SGX_SUCCESS)
110-
abort();
111-
112-
for (int i = 0; i < 10; i++)
113-
assert(arr[i] == i);
114-
115107
return;
116108
}
117109

SampleCode/SampleEnclave/Enclave/Edger8rSyntax/Pointers.cpp

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <string.h>
3737

3838
#include "sgx_trts.h"
39+
#include "sgx_lfence.h"
3940
#include "../Enclave.h"
4041
#include "Enclave_t.h"
4142

@@ -70,7 +71,7 @@ size_t ecall_pointer_user_check(void *val, size_t sz)
7071
abort();
7172

7273
/*fence after sgx_is_outside_enclave check*/
73-
__builtin_ia32_lfence();
74+
sgx_lfence();
7475

7576
char tmp[100] = {0};
7677
size_t len = sz>100?100:sz;
@@ -198,23 +199,3 @@ void ecall_pointer_isptr_readonly(buffer_t buf, size_t len)
198199
strncpy((char*)buf, "0987654321", len);
199200
}
200201

201-
/* get_buffer_len:
202-
* get the length of input buffer 'buf'.
203-
*/
204-
size_t get_buffer_len(const char* buf)
205-
{
206-
(void)buf;
207-
return 10*sizeof(int);
208-
}
209-
210-
/* ecall_pointer_sizefunc:
211-
* call get_buffer_len to determin the length of 'buf'.
212-
*/
213-
void ecall_pointer_sizefunc(char *buf)
214-
{
215-
int *tmp = (int*)buf;
216-
for (int i = 0; i < 10; i++) {
217-
assert(tmp[i] == 0);
218-
tmp[i] = i;
219-
}
220-
}

SampleCode/SampleEnclave/Enclave/Edger8rSyntax/Pointers.edl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enclave {
3838
* Following keywords/attributes are supported for pointers in Edger8r:
3939
* in, out, user_check,
4040
* string, wstring,
41-
* const, size, count, sizefunc, isptr, readonly
41+
* const, size, count, isptr, readonly
4242
*/
4343

4444
trusted {
@@ -122,16 +122,6 @@ enclave {
122122

123123
public void ecall_pointer_isptr_readonly([in, isptr, readonly, size=len] buffer_t buf, size_t len);
124124

125-
/*
126-
* [sizefunc]:
127-
* call a function to decide the size/length of the parameter;
128-
* Note:
129-
* User need to define and implement `get_buf_len' as:
130-
* size_t get_buf_len(const char* buf);
131-
*/
132-
133-
public void ecall_pointer_sizefunc([sizefunc = get_buffer_len, in, out] char *buf);
134-
135125
};
136126

137127
/*

common/inc/internal/se_atomic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
#include <stdint.h>
3636

37+
3738
inline uint32_t se_atomic_inc(volatile uint32_t *mem)
3839
{
3940
return __sync_add_and_fetch(mem, 1);

common/inc/internal/se_version.h

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

common/inc/sgx_lfence.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright (C) 2011-2018 Intel Corporation. All rights reserved.
3+
*
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions
6+
* are met:
7+
*
8+
* * Redistributions of source code must retain the above copyright
9+
* notice, this list of conditions and the following disclaimer.
10+
* * Redistributions in binary form must reproduce the above copyright
11+
* notice, this list of conditions and the following disclaimer in
12+
* the documentation and/or other materials provided with the
13+
* distribution.
14+
* * Neither the name of Intel Corporation nor the names of its
15+
* contributors may be used to endorse or promote products derived
16+
* from this software without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*
30+
*/
31+
32+
#ifndef _SGX_LFENCE_H_
33+
#define _SGX_LFENCE_H_
34+
35+
#define sgx_lfence __builtin_ia32_lfence
36+
37+
#ifdef __cplusplus
38+
extern "C" {
39+
#endif
40+
41+
extern void __builtin_ia32_lfence(void);
42+
43+
#ifdef __cplusplus
44+
}
45+
#endif
46+
47+
#endif /* !_SGX_LFENCE_H_ */
48+

common/inc/sgx_trts.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ int SGXAPI sgx_is_within_enclave(const void *addr, size_t size);
6363
int SGXAPI sgx_is_outside_enclave(const void *addr, size_t size);
6464

6565

66+
/* sgx_is_enclave_crashed()
67+
* Return Value:
68+
* 1 - the enclave state is crashed.
69+
* 0 - the enclave state is not crashed.
70+
*/
71+
int SGXAPI sgx_is_enclave_crashed(void);
72+
73+
6674
/* sgx_read_rand()
6775
* Parameters:
6876
* rand - the buffer to receive the random number
@@ -74,13 +82,6 @@ int SGXAPI sgx_is_outside_enclave(const void *addr, size_t size);
7482
*/
7583
sgx_status_t SGXAPI sgx_read_rand(unsigned char *rand, size_t length_in_bytes);
7684

77-
/* sgx_is_enclave_crashed()
78-
* Return Value:
79-
* 1 - The global enclave state is crashed.
80-
* 0 - The global enclave state is not crashed.
81-
*/
82-
int SGXAPI sgx_is_enclave_crashed(void);
83-
8485
#ifdef __cplusplus
8586
}
8687
#endif

download_prebuilt.sh

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

3434
top_dir=`dirname $0`
3535
out_dir=$top_dir
36-
optlib_name=optimized_libs-2.1.1.tar
37-
ae_file_name=prebuilt-ae-2.1.1.tar
38-
server_url_path=https://download.01.org/intel-sgx/linux-2.1.1/
36+
optlib_name=optimized_libs-2.1.2.tar
37+
ae_file_name=prebuilt-ae-2.1.2.tar
38+
server_url_path=https://download.01.org/intel-sgx/linux-2.1.2/
3939
server_optlib_url=$server_url_path/$optlib_name
4040
server_ae_url=$server_url_path/$ae_file_name
4141
optlib_sha256=239cae39f87934d56c4eb919a4702c6ac82c19957b9a8d56c02b10eb4e27f573
42-
ae_sha256=f95589a69a8a8767815fe3bccf32bac5c9709022f9f32ae1a726b1da7955200b
42+
ae_sha256=55ebe53b724d66f045c4c05020610d0fc7771d5dc58aaff270ccaee82b5d0d65
4343
rm -rf $out_dir/$optlib_name
4444
wget $server_optlib_url -P $out_dir
4545
if [ $? -ne 0 ]; then

linux/installer/common/sdk/BOMs/sdk_base.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ DeliveryName InstallName FileCheckSum FileFeature FileOwner
77
<deliverydir>/common/inc/sgx_dh.h <installdir>/package/include/./sgx_dh.h 0 main STP
88
<deliverydir>/common/inc/sgx_ecp_types.h <installdir>/package/include/./sgx_ecp_types.h 0 main STP
99
<deliverydir>/common/inc/sgx_edger8r.h <installdir>/package/include/./sgx_edger8r.h 0 main STP
10+
<deliverydir>/common/inc/sgx_lfence.h <installdir>/package/include/./sgx_lfence.h 0 main STP
1011
<deliverydir>/common/inc/sgx_eid.h <installdir>/package/include/./sgx_eid.h 0 main STP
1112
<deliverydir>/common/inc/sgx_error.h <installdir>/package/include/./sgx_error.h 0 main STP
1213
<deliverydir>/common/inc/sgx.h <installdir>/package/include/./sgx.h 0 main STP

psw/ae/aesm_service/source/aesm_wrapper/src/AESMQueueManager.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ void AESMQueueManager::enqueue(RequestData* requestData)
7979
AESM_LOG_ERROR("Malformed request received (May be forged for attack)");
8080
}
8181

82+
}else {
83+
delete requestData;
84+
AESM_LOG_ERROR("Malformed request received (May be forged for attack)");
8285
}
8386
}
8487

0 commit comments

Comments
 (0)