Skip to content

Commit ce022db

Browse files
authored
Merge pull request #74 from jovanbulck/ubuntu
Ubuntu
2 parents 0f22431 + f791efd commit ce022db

File tree

6 files changed

+34
-30
lines changed

6 files changed

+34
-30
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: ubuntu-20.04
11+
strategy:
12+
matrix:
13+
os:
14+
- ubuntu-20.04
15+
- ubuntu-22.04
16+
runs-on: ${{ matrix.os }}
1217

1318
steps:
1419
- name: Check out repository

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ To build and load the `/dev/sgx-step` driver, execute:
176176

177177
```bash
178178
$ cd kernel/
179-
$ ./install_SGX_driver.sh # tested on Ubuntu 18.04/20.04/22.04
179+
$ ./install_SGX_driver.sh # tested on Ubuntu 20.04/22.04
180180
$ make clean load
181181
```
182182

@@ -201,17 +201,17 @@ to bypass `devmem_is_allowed` checks, without having to recompile the kernel.
201201

202202
To enable easy registration of a custom Asynchronous Exit Pointer (AEP) stub,
203203
we modified the untrusted runtime of the official Intel SGX SDK. Proceed as
204-
follows to checkout [linux-sgx](https://github.com/01org/linux-sgx) v2.16 and
204+
follows to checkout [linux-sgx](https://github.com/01org/linux-sgx) v2.23 and
205205
apply our patches.
206206

207207
```bash
208208
$ cd sdk/intel-sdk/
209-
$ ./install_SGX_SDK.sh # tested on Ubuntu 18.04/20.04
209+
$ ./install_SGX_SDK.sh # tested on Ubuntu 20.04/22.04
210210
$ source /opt/intel/sgxsdk/environment # add to ~/.bashrc to preserve across terminal sessions
211211
$ sudo service aesmd status # stop/start aesmd service if needed
212212
```
213213

214-
The above install scripts are tested on Ubuntu 18.04 LTS.
214+
The above install scripts are tested on Ubuntu 22.04 LTS.
215215
For other GNU/Linux distributions, please follow the instructions in the
216216
[linux-sgx](https://github.com/01org/linux-sgx) project to build and install
217217
the Intel SGX SDK and PSW packages. You will also need to build and load an

libsgxstep/aep_trampoline.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,4 @@ sgx_step_aep_trampoline:
8282
.global sgx_step_aep_eresume
8383
sgx_step_aep_eresume:
8484
.byte 0x0f, 0x01, 0xd7 /* ENCLU */
85+
ud2

sdk/intel-sdk/0001-reconfigure-AEP-TCS-ebase.patch

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
commit 1a75eb4d0954b1f3eab76a211647de8a80031170
1+
commit f32cc9feb7ce7e94337a3f78b0d0085161f75c8b
22
Author: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
3-
Date: Wed Apr 13 13:55:33 2022 +0200
3+
Date: Thu Feb 8 20:49:32 2024 +0000
44

5-
SGX-Step SDK patches to reconfigure AEP/TCS.
5+
SGX-Step SDK patches to reconfigure AEP/TCS
66

77
diff --git a/common/inc/sgx_urts.h b/common/inc/sgx_urts.h
88
index 691efbc9..07240fa7 100644
@@ -21,7 +21,7 @@ index 691efbc9..07240fa7 100644
2121

2222
/* Convenient macro to be passed to sgx_create_enclave(). */
2323
diff --git a/psw/urts/linux/enter_enclave.S b/psw/urts/linux/enter_enclave.S
24-
index fc3828e1..6b6e8a26 100644
24+
index 4f09e2da..2f6b749e 100644
2525
--- a/psw/urts/linux/enter_enclave.S
2626
+++ b/psw/urts/linux/enter_enclave.S
2727
@@ -32,6 +32,29 @@
@@ -75,21 +75,21 @@ index fc3828e1..6b6e8a26 100644
7575

7676
.Leenter_inst:
7777
ENCLU
78-
@@ -158,15 +189,27 @@ EENTER_PROLOG
78+
@@ -158,18 +189,29 @@ EENTER_PROLOG
7979
.Loret:
8080
EENTER_EPILOG
8181

8282
-.Lasync_exit_pointer:
8383
+__default_async_exit_pointer:
8484
ENCLU
85+
ud2
8586
_CET_ENDBR
8687

8788
.size __morestack, .-__morestack
8889

89-
90-
-DECLARE_GLOBAL_FUNC get_aep
90+
-
91+
DECLARE_GLOBAL_FUNC get_aep
9192
- lea_pic .Lasync_exit_pointer, %xax
92-
+ DECLARE_GLOBAL_FUNC get_aep
9393
+ lea_pic g_aep_pointer, %xax
9494
+ mov (%xax), %xax
9595
+ ret
@@ -98,16 +98,18 @@ index fc3828e1..6b6e8a26 100644
9898
+ lea_pic g_aep_pointer, %xax
9999
+ mov naked_arg0, %xbx
100100
+ mov %xbx, (%xax)
101-
+ ret
102-
+
101+
ret
102+
103103
+DECLARE_GLOBAL_FUNC get_tcs
104104
+ lea_pic g_tcs, %xax
105105
+ mov (%xax), %xax
106-
ret
107-
106+
+ ret
107+
+
108108
DECLARE_GLOBAL_FUNC get_eenterp
109+
lea_pic .Leenter_inst, %xax
110+
ret
109111
diff --git a/psw/urts/linux/urts.cpp b/psw/urts/linux/urts.cpp
110-
index 17c82de4..b8dbffe4 100644
112+
index 22b37bf0..c9ac872e 100644
111113
--- a/psw/urts/linux/urts.cpp
112114
+++ b/psw/urts/linux/urts.cpp
113115
@@ -40,6 +40,26 @@
@@ -138,7 +140,7 @@ index 17c82de4..b8dbffe4 100644
138140
{
139141
//update last feature index if it fails here
140142
diff --git a/psw/urts/linux/urts.lds b/psw/urts/linux/urts.lds
141-
index 44897f21..c504e3b9 100644
143+
index 02b98ed6..a70d55ee 100644
142144
--- a/psw/urts/linux/urts.lds
143145
+++ b/psw/urts/linux/urts.lds
144146
@@ -1,5 +1,8 @@

sdk/intel-sdk/install_SGX_SDK.sh

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,16 @@ OS_ID=$(lsb_release -si | tr '[:upper:]' '[:lower:]')
3535
OS_REL=$(lsb_release -sr)
3636
OS_STR=$OS_ID$OS_REL
3737

38-
if [ $OS_STR = "ubuntu22.04" ]; then
39-
echo "Warning: Ubuntu 22.04 LTS currently not yet officially supported by linux-sgx Intel SDK; overriding to Ubuntu 20.04 .."
40-
OS_STR="ubuntu20.04"
41-
sudo ln -fs /usr/bin/python2 /usr/bin/python
42-
python --version
43-
fi
44-
4538
# ----------------------------------------------------------------------
4639
echo "[ building SDK ]"
4740
cd linux-sgx
4841
make preparation
49-
sudo cp "external/toolset/$OS_STR/"* /usr/local/bin
5042

51-
ci_silent make -j`nproc` sdk_install_pkg
43+
if [ -d "external/toolset/$OS_STR" ]; then
44+
sudo cp "external/toolset/$OS_STR/"* /usr/local/bin
45+
fi
46+
47+
ci_silent make sdk_install_pkg
5248

5349
echo "[ installing SDK system-wide ]"
5450
cd linux/installer/bin/
@@ -60,7 +56,7 @@ cd ../../../
6056

6157
# ----------------------------------------------------------------------
6258
echo "[ building PSW ]"
63-
ci_silent make -j`nproc` psw_install_pkg
59+
ci_silent make psw_install_pkg
6460

6561
echo "[ installing PSW/SDK system-wide ]"
6662
cd linux/installer/bin/

sdk/intel-sdk/linux-sgx

0 commit comments

Comments
 (0)