Skip to content

Commit eec927f

Browse files
committed
Upgrade to sgx 1.1.2
1 parent 1da8e71 commit eec927f

File tree

8 files changed

+170
-22
lines changed

8 files changed

+170
-22
lines changed

.drone.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ name: gbdt-sgx-xargo-1604-sw
383383

384384
steps:
385385
- name: sim-compile
386-
image: baiduxlab/sgx-rust:1604-1.1.1
386+
image: baiduxlab/sgx-rust:1604-1.1.2
387387
pull: always
388388
environment:
389389
SGX_MODE: SW
@@ -394,7 +394,7 @@ steps:
394394
- cd sgx && make -C gbdt-sgx-test
395395

396396
- name: sim-test
397-
image: baiduxlab/sgx-rust:1604-1.1.1
397+
image: baiduxlab/sgx-rust:1604-1.1.2
398398
pull: always
399399
commands:
400400
- . /opt/sgxsdk/environment
@@ -410,7 +410,7 @@ name: gbdt-sgx-xargo-1604-hw
410410

411411
steps:
412412
- name: hw-compile
413-
image: baiduxlab/sgx-rust:1604-1.1.1
413+
image: baiduxlab/sgx-rust:1604-1.1.2
414414
pull: always
415415
environment:
416416
SGX_MODE: HW
@@ -421,7 +421,7 @@ steps:
421421
- cd sgx && make -C gbdt-sgx-test
422422

423423
- name: hw-test
424-
image: baiduxlab/sgx-rust:1604-1.1.1
424+
image: baiduxlab/sgx-rust:1604-1.1.2
425425
pull: always
426426
privileged: true
427427
volumes:
@@ -453,7 +453,7 @@ name: gbdt-sgx-xargo-1804-sw
453453

454454
steps:
455455
- name: sim-compile
456-
image: baiduxlab/sgx-rust:1804-1.1.1
456+
image: baiduxlab/sgx-rust:1804-1.1.2
457457
pull: always
458458
environment:
459459
SGX_MODE: SW
@@ -464,7 +464,7 @@ steps:
464464
- cd sgx && make -C gbdt-sgx-test
465465

466466
- name: sim-test
467-
image: baiduxlab/sgx-rust:1804-1.1.1
467+
image: baiduxlab/sgx-rust:1804-1.1.2
468468
pull: always
469469
commands:
470470
- . /opt/sgxsdk/environment
@@ -480,7 +480,7 @@ name: gbdt-sgx-xargo-1804-hw
480480

481481
steps:
482482
- name: hw-compile
483-
image: baiduxlab/sgx-rust:1804-1.1.1
483+
image: baiduxlab/sgx-rust:1804-1.1.2
484484
pull: always
485485
environment:
486486
SGX_MODE: HW
@@ -491,7 +491,7 @@ steps:
491491
- cd sgx && make -C gbdt-sgx-test
492492

493493
- name: hw-test
494-
image: baiduxlab/sgx-rust:1804-1.1.1
494+
image: baiduxlab/sgx-rust:1804-1.1.2
495495
pull: always
496496
privileged: true
497497
volumes:
@@ -523,7 +523,7 @@ name: gbdt-sgx-1604-sw
523523

524524
steps:
525525
- name: sim-compile
526-
image: baiduxlab/sgx-rust:1604-1.1.1
526+
image: baiduxlab/sgx-rust:1604-1.1.2
527527
pull: always
528528
environment:
529529
SGX_MODE: SW
@@ -534,7 +534,7 @@ steps:
534534
- make -C sgx/gbdt-sgx-test
535535

536536
- name: sim-test
537-
image: baiduxlab/sgx-rust:1604-1.1.1
537+
image: baiduxlab/sgx-rust:1604-1.1.2
538538
pull: always
539539
commands:
540540
- . /opt/sgxsdk/environment
@@ -550,7 +550,7 @@ name: gbdt-sgx-1604-hw
550550

551551
steps:
552552
- name: hw-compile
553-
image: baiduxlab/sgx-rust:1604-1.1.1
553+
image: baiduxlab/sgx-rust:1604-1.1.2
554554
pull: always
555555
environment:
556556
SGX_MODE: HW
@@ -561,7 +561,7 @@ steps:
561561
- make -C sgx/gbdt-sgx-test
562562

563563
- name: hw-test
564-
image: baiduxlab/sgx-rust:1604-1.1.1
564+
image: baiduxlab/sgx-rust:1604-1.1.2
565565
pull: always
566566
privileged: true
567567
volumes:
@@ -593,7 +593,7 @@ name: gbdt-sgx-1804-sw
593593

594594
steps:
595595
- name: sim-compile
596-
image: baiduxlab/sgx-rust:1804-1.1.1
596+
image: baiduxlab/sgx-rust:1804-1.1.2
597597
pull: always
598598
environment:
599599
SGX_MODE: SW
@@ -604,7 +604,7 @@ steps:
604604
- make -C sgx/gbdt-sgx-test
605605

606606
- name: sim-test
607-
image: baiduxlab/sgx-rust:1804-1.1.1
607+
image: baiduxlab/sgx-rust:1804-1.1.2
608608
pull: always
609609
commands:
610610
- . /opt/sgxsdk/environment
@@ -620,7 +620,7 @@ name: gbdt-sgx-1804-hw
620620

621621
steps:
622622
- name: hw-compile
623-
image: baiduxlab/sgx-rust:1804-1.1.1
623+
image: baiduxlab/sgx-rust:1804-1.1.2
624624
pull: always
625625
environment:
626626
SGX_MODE: HW
@@ -631,7 +631,7 @@ steps:
631631
- make -C sgx/gbdt-sgx-test
632632

633633
- name: hw-test
634-
image: baiduxlab/sgx-rust:1804-1.1.1
634+
image: baiduxlab/sgx-rust:1804-1.1.2
635635
pull: always
636636
privileged: true
637637
volumes:

sgx/gbdt-sgx-test/common/inc/signal.h

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
2+
This file is part of the GNU C Library.
3+
4+
The GNU C Library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
9+
The GNU C Library is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public
15+
License along with the GNU C Library; if not, see
16+
<http://www.gnu.org/licenses/>. */
17+
18+
#ifndef _SIGNAL_H
19+
#define _SIGNAL_H
20+
21+
#define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
22+
typedef struct
23+
{
24+
unsigned long int __val[_SIGSET_NWORDS];
25+
} __sigset_t;
26+
27+
typedef __sigset_t sigset_t;
28+
29+
struct sigaction
30+
{
31+
/* Signal handler. */
32+
#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
33+
union
34+
{
35+
/* Used if SA_SIGINFO is not set. */
36+
void (*sa_handler) (int);
37+
/* Used if SA_SIGINFO is set. */
38+
void (*sa_sigaction) (int, siginfo_t *, void *);
39+
}
40+
__sigaction_handler;
41+
#define sa_handler __sigaction_handler.sa_handler
42+
#define sa_sigaction __sigaction_handler.sa_sigaction
43+
#else
44+
void (*sa_handler) (int);
45+
#endif
46+
47+
/* Additional set of signals to be blocked. */
48+
__sigset_t sa_mask;
49+
50+
/* Special flags. */
51+
int sa_flags;
52+
53+
/* Restore handler. */
54+
void (*sa_restorer) (void);
55+
};
56+
57+
#define __SI_MAX_SIZE 128
58+
#define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
59+
60+
typedef struct
61+
{
62+
int si_signo; /* Signal number. */
63+
64+
int si_errno; /* If non-zero, an errno value associated with
65+
this signal, as defined in <errno.h>. */
66+
int si_code; /* Signal code. */
67+
68+
int __pad0;
69+
int _pad[__SI_PAD_SIZE];
70+
} siginfo_t;
71+
72+
#endif

sgx/gbdt-sgx-test/edl/sgx_process.edl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
enclave {
19+
20+
trusted {
21+
/* define ECALLs here. */
22+
23+
};
24+
25+
untrusted {
26+
int u_getpid_ocall();
27+
};
28+
};

sgx/gbdt-sgx-test/edl/sgx_signal.edl

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
enclave {
19+
include "signal.h"
20+
21+
trusted {
22+
/* define ECALLs here. */
23+
public int t_signal_handler_ecall([in]const siginfo_t *info);
24+
};
25+
26+
untrusted {
27+
int u_sigaction_ocall([out]int *error,
28+
int signum,
29+
[in] const struct sigaction *act,
30+
[out] struct sigaction *oldact,
31+
uint64_t enclave_id);
32+
33+
int u_sigprocmask_ocall([out]int *error,
34+
int signum,
35+
[in] const sigset_t *set,
36+
[out] sigset_t *oldset);
37+
38+
int u_raise_ocall(int signum) allow(t_signal_handler_ecall);
39+
40+
void u_signal_clear_ocall(uint64_t enclave_id);
41+
};
42+
};
43+

sgx/gbdt-sgx-test/edl/sgx_thread.edl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ enclave {
1919
include "time.h"
2020

2121
from "intel/sgx_pthread.edl" import *;
22+
from "sgx_sys.edl" import *;
2223

2324
trusted {
2425
/* define ECALLs here. */

sgx/gbdt-sgx-test/enclave/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ default = []
1414
gbdt_sgx = { path = "../../gbdt-sgx", default-features = false, features = ["mesalock_sgx", "input", "enable_training"] }
1515

1616
[target.'cfg(not(target_env = "sgx"))'.dependencies]
17-
sgx_types = { rev = "v1.1.1", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
18-
sgx_tstd = { rev = "v1.1.1", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
19-
sgx_tunittest = { rev = "v1.1.1", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
17+
sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
18+
sgx_tstd = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
19+
sgx_tunittest = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git" }

sgx/gbdt-sgx-test/enclave/Xargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ stage = 4
6363

6464
[dependencies.std]
6565
git = "https://github.com/apache/teaclave-sgx-sdk.git"
66+
features = ["untrusted_fs", "backtrace", "net"]
6667
stage = 5
67-
features = ["backtrace"]
6868

6969
[dependencies.sgx_no_tstd]
7070
git = "https://github.com/apache/teaclave-sgx-sdk.git"
@@ -89,3 +89,7 @@ stage = 7
8989
[dependencies.sgx_cov]
9090
git = "https://github.com/apache/teaclave-sgx-sdk.git"
9191
stage = 7
92+
93+
[dependencies.sgx_signal]
94+
git = "https://github.com/apache/teaclave-sgx-sdk.git"
95+
stage = 7

sgx/gbdt-sgx/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ crate-type = ["rlib", "staticlib"]
2626
serde = { git = "https://github.com/mesalock-linux/serde-sgx" }
2727
serde_derive = { git = "https://github.com/mesalock-linux/serde-sgx" }
2828
serde_json = { git = "https://github.com/mesalock-linux/serde-json-sgx" }
29-
rand = { version = "0.7", optional = true, git = "https://github.com/mesalock-linux/rand-sgx", tag = "v0.6.5_sgx1.1.1" }
29+
rand = { version = "0.7", optional = true, git = "https://github.com/mesalock-linux/rand-sgx", tag = "v0.7.3_sgx1.1.2" }
3030
regex = { version = "1", git = "https://github.com/mesalock-linux/regex-sgx", optional = true }
3131
time = { version = "0.1", optional = true }
32-
sgx_tstd = { rev = "v1.1.1", git = "https://github.com/apache/teaclave-sgx-sdk", optional = true }
32+
sgx_tstd = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk", optional = true }
3333
cfg-if = "0.1"
3434

3535
[dev-dependencies]

0 commit comments

Comments
 (0)