Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,11 @@ jobs:
cd $GITHUB_WORKSPACE/sdk/intel-sdk/
sudo apt-get update
bash -x ./install_SGX_SDK.sh
source /opt/intel/sgxsdk/environment
sudo service aesmd status

- name: Run Intel SGX SDK sample code in simulator
run: |
source /opt/intel/sgxsdk/environment
cd $GITHUB_WORKSPACE/sdk/intel-sdk/linux-sgx/SampleCode/LocalAttestation
cd $GITHUB_WORKSPACE/sdk/intel-sdk/linux-sgx/sdk/SampleCode/LocalAttestation
make SGX_MODE=SIM
cd bin
ldd ./app
Expand Down
6 changes: 3 additions & 3 deletions app/aep-redirect/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
LIBSGXSTEP_DIR = ../..
LIBSGXSTEP = $(LIBSGXSTEP_DIR)/libsgxstep
URTS_LIB_PATH = $(LIBSGXSTEP_DIR)/linux-sgx/psw/urts/linux
URTS_LIB_PATH = $(LIBSGXSTEP_DIR)/linux-sgx/sdk/build/linuxLOAD
-include $(LIBSGXSTEP)/Makefile.config

ifeq ($(SGX_SDK),)
SGX_SDK = /opt/intel/sgxsdk
endif
export SGX_SDK
ifneq ($(SGX_SDK), /opt/intel/sgxsdk)
URTS_LD_LIBRARY_PATH = LD_LIBRARY_PATH=$(LIBSGXSTEP_DIR)/linux-sgx/psw/urts/linux
URTS_LD_LIBRARY_PATH = LD_LIBRARY_PATH=$(LIBSGXSTEP_DIR)/linux-sgx/sdk/build/linuxLOAD
endif

ENCLAVE = Enclave
Expand All @@ -30,7 +30,7 @@ CFLAGS += -fPIC -fno-stack-protector -fno-builtin -fno-jump-tables
INCLUDE = -I$(SGX_SDK)/include/ -I$(LIBSGXSTEP_DIR)
LDFLAGS += -lsgx-step -lencl_proxy -lsgx_urts \
-lsgx_uae_service -pthread $(SUBDIRS:%=-L %) -L$(SGX_SDK)/lib$(LIB_SUFX)/ \
-L$(LIBSGXSTEP_DIR)/linux-sgx/psw/urts/linux -lelf
-L$(LIBSGXSTEP_DIR)/linux-sgx/sdk/build/linuxLOAD -lelf

SOURCES = $(shell ls *.c)
OBJECTS = $(SOURCES:.c=.o)
Expand Down
4 changes: 2 additions & 2 deletions app/bench/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ifeq ($(SGX_SDK),)
endif
export SGX_SDK
ifneq ($(SGX_SDK), /opt/intel/sgxsdk)
URTS_LD_LIBRARY_PATH = LD_LIBRARY_PATH=$(LIBSGXSTEP_DIR)/sdk/intel-sdk/linux-sgx/psw/urts/linux
URTS_LD_LIBRARY_PATH = LD_LIBRARY_PATH=$(LIBSGXSTEP_DIR)/sdk/intel-sdk/linux-sgx/sdk/build/linuxLOAD
endif

ENCLAVE = Enclave
Expand All @@ -30,7 +30,7 @@ CFLAGS += -fPIC -fno-stack-protector -fno-builtin -fno-jump-tables
INCLUDE = -I$(SGX_SDK)/include/ -I$(LIBSGXSTEP_DIR)
LDFLAGS += -lsgx-step -lencl_proxy -lsgx_urts \
-lsgx_uae_service -pthread $(SUBDIRS:%=-L %) -L$(SGX_SDK)/lib$(LIB_SUFX)/ \
-L$(LIBSGXSTEP_DIR)/linux-sgx/psw/urts/linux -lelf
-L$(LIBSGXSTEP_DIR)/linux-sgx/sdk/build/linuxLOAD -lelf

SOURCES = $(shell ls *.c)
OBJECTS = $(SOURCES:.c=.o)
Expand Down
4 changes: 2 additions & 2 deletions app/foreshadow/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ifeq ($(SGX_SDK),)
endif
export SGX_SDK
ifneq ($(SGX_SDK), /opt/intel/sgxsdk)
URTS_LD_LIBRARY_PATH = LD_LIBRARY_PATH=$(LIBSGXSTEP_DIR)/linux-sgx/psw/urts/linux
URTS_LD_LIBRARY_PATH = LD_LIBRARY_PATH=$(LIBSGXSTEP_DIR)/linux-sgx/sdk/build/linuxLOAD
endif

ENCLAVE = Enclave
Expand All @@ -30,7 +30,7 @@ CFLAGS += -fPIC -fno-stack-protector -fno-builtin -fno-jump-tables
INCLUDE = -I$(SGX_SDK)/include/ -I$(LIBSGXSTEP_DIR)
LDFLAGS += -lsgx-step -lencl_proxy -lsgx_urts \
-lsgx_uae_service -pthread $(SUBDIRS:%=-L %) -L$(SGX_SDK)/lib$(LIB_SUFX)/ \
-L$(LIBSGXSTEP_DIR)/linux-sgx/psw/urts/linux
-L$(LIBSGXSTEP_DIR)/linux-sgx/sdk/build/linuxLOAD

SOURCES = main.c #$(shell ls *.c)
OBJECTS = $(SOURCES:.c=.o)
Expand Down
6 changes: 3 additions & 3 deletions app/lvi/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
LIBSGXSTEP_DIR = ../..
LIBSGXSTEP = $(LIBSGXSTEP_DIR)/libsgxstep
URTS_LIB_PATH = $(LIBSGXSTEP_DIR)/linux-sgx/psw/urts/linux
URTS_LIB_PATH = $(LIBSGXSTEP_DIR)/linux-sgx/sdk/build/linuxLOAD
-include $(LIBSGXSTEP)/Makefile.config

ifeq ($(SGX_SDK),)
SGX_SDK = /opt/intel/sgxsdk
endif
export SGX_SDK
ifneq ($(SGX_SDK), /opt/intel/sgxsdk)
URTS_LD_LIBRARY_PATH = LD_LIBRARY_PATH=$(LIBSGXSTEP_DIR)/linux-sgx/psw/urts/linux
URTS_LD_LIBRARY_PATH = LD_LIBRARY_PATH=$(LIBSGXSTEP_DIR)/linux-sgx/sdk/build/linuxLOAD
endif

ENCLAVE = Enclave
Expand All @@ -30,7 +30,7 @@ CFLAGS += -fpic -fno-stack-protector -fno-builtin -fno-jump-tables
INCLUDE = -I$(SGX_SDK)/include/ -I$(LIBSGXSTEP_DIR)
LDFLAGS += -lsgx-step -lencl_proxy -lsgx_urts \
-lsgx_uae_service -pthread $(SUBDIRS:%=-L %) -L$(SGX_SDK)/lib$(LIB_SUFX)/ \
-L$(LIBSGXSTEP_DIR)/linux-sgx/psw/urts/linux -lelf
-L$(LIBSGXSTEP_DIR)/linux-sgx/sdk/build/linuxLOAD -lelf

SOURCES = $(shell ls *.c) $(ENCLAVE)/encl_u.c
OBJECTS = $(SOURCES:.c=.o)
Expand Down
4 changes: 2 additions & 2 deletions app/memcmp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ifeq ($(SGX_SDK),)
endif
export SGX_SDK
ifneq ($(SGX_SDK), /opt/intel/sgxsdk)
URTS_LD_LIBRARY_PATH = LD_LIBRARY_PATH=$(LIBSGXSTEP_DIR)/linux-sgx/psw/urts/linux
URTS_LD_LIBRARY_PATH = LD_LIBRARY_PATH=$(LIBSGXSTEP_DIR)/linux-sgx/sdk/build/linuxLOAD
endif

ENCLAVE = Enclave
Expand All @@ -30,7 +30,7 @@ CFLAGS += -fPIC -fno-stack-protector -fno-builtin -fno-jump-tables
INCLUDE = -I$(SGX_SDK)/include/ -I$(LIBSGXSTEP_DIR)
LDFLAGS += -lsgx-step -lencl_proxy -lsgx_urts \
-lsgx_uae_service -pthread $(SUBDIRS:%=-L %) -L$(SGX_SDK)/lib$(LIB_SUFX)/ \
-L$(LIBSGXSTEP_DIR)/linux-sgx/psw/urts/linux -lelf
-L$(LIBSGXSTEP_DIR)/linux-sgx/sdk/build/linuxLOAD -lelf

SOURCES = $(shell ls *.c)
OBJECTS = $(SOURCES:.c=.o)
Expand Down
4 changes: 2 additions & 2 deletions app/tracer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ifeq ($(SGX_SDK),)
endif
export SGX_SDK
ifneq ($(SGX_SDK), /opt/intel/sgxsdk)
URTS_LD_LIBRARY_PATH = LD_LIBRARY_PATH=$(LIBSGXSTEP_DIR)/linux-sgx/psw/urts/linux
URTS_LD_LIBRARY_PATH = LD_LIBRARY_PATH=$(LIBSGXSTEP_DIR)/linux-sgx/sdk/build/linuxLOAD
endif

ENCLAVE = Enclave
Expand All @@ -30,7 +30,7 @@ CFLAGS += -fPIC -fno-stack-protector -fno-builtin -fno-jump-tables
INCLUDE = -I$(SGX_SDK)/include/ -I$(LIBSGXSTEP_DIR)
LDFLAGS += -lsgx-step -lencl_proxy -lsgx_urts \
-lsgx_uae_service -pthread $(SUBDIRS:%=-L %) -L$(SGX_SDK)/lib$(LIB_SUFX)/ \
-L$(LIBSGXSTEP_DIR)/linux-sgx/psw/urts/linux -lelf
-L$(LIBSGXSTEP_DIR)/linux-sgx/sdk/build/linuxLOAD -lelf

SOURCES = $(shell ls *.c)
OBJECTS = $(SOURCES:.c=.o)
Expand Down
56 changes: 25 additions & 31 deletions sdk/intel-sdk/0001-reconfigure-AEP-TCS-ebase.patch
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
From 017a3611d99aa7d913cef150941bf66bc8db9cb7 Mon Sep 17 00:00:00 2001
From 502d7dc3b8645ca35de27c17fa8d327bc72035b7 Mon Sep 17 00:00:00 2001
From: Hayao Otsuka <shun819.mail@gmail.com>
Date: Thu, 28 May 2026 15:31:27 +0900
Date: Sat, 5 Sep 2026 09:48:43 +0900
Subject: [PATCH] SGX-Step SDK patches to reconfigure AEP/TCS (rebased on
sgx_2.29)
sgx_2.30.1)

---
common/inc/sgx_urts.h | 6 ++-
psw/urts/linux/enter_enclave.S | 56 +++++++++++++++++++++++++---
psw/urts/linux/urts.cpp | 20 ++++++++++
psw/urts/linux/urts.lds | 3 ++
sdk/simulation/urtssim/urts_deploy.c | 17 +++++++++
5 files changed, 95 insertions(+), 7 deletions(-)
common/inc/sgx_urts.h | 4 ++
enclave_runtime/urts/linux/enter_enclave.S | 56 +++++++++++++++++++---
enclave_runtime/urts/linux/urts.cpp | 20 ++++++++
enclave_runtime/urts/linux/urts.lds | 3 ++
sdk/simulation/urtssim/urts_deploy.c | 17 +++++++
5 files changed, 94 insertions(+), 6 deletions(-)

diff --git a/common/inc/sgx_urts.h b/common/inc/sgx_urts.h
index 8cad503c..bc54c5c3 100644
index 8cad503..65f60c0 100644
--- a/common/inc/sgx_urts.h
+++ b/common/inc/sgx_urts.h
@@ -76,11 +76,15 @@ typedef struct _sgx_kss_config_t
@@ -76,6 +76,10 @@ typedef struct _sgx_kss_config_t
extern "C" {
#endif

Expand All @@ -27,16 +27,10 @@ index 8cad503c..bc54c5c3 100644

typedef uint8_t sgx_reserved_field_1024t[1024];

/**
- * @deprecated Support for launch tokens was removed in v2.28 (in favor of Flexible Launch Control).
+ * @deprecated Support for launch tokens was removed in v2.28 (in favor of Flexible Launch Control).
* This field is now reserved. Please update your API to use @c sgx_reserved_field_1024t type
*/
typedef sgx_reserved_field_1024t sgx_launch_token_t;
diff --git a/psw/urts/linux/enter_enclave.S b/psw/urts/linux/enter_enclave.S
index 69c7c67a..c7322591 100644
--- a/psw/urts/linux/enter_enclave.S
+++ b/psw/urts/linux/enter_enclave.S
diff --git a/enclave_runtime/urts/linux/enter_enclave.S b/enclave_runtime/urts/linux/enter_enclave.S
index 69c7c67..c732259 100644
--- a/enclave_runtime/urts/linux/enter_enclave.S
+++ b/enclave_runtime/urts/linux/enter_enclave.S
@@ -32,6 +32,29 @@

#include "enter_enclave.h"
Expand Down Expand Up @@ -121,10 +115,10 @@ index 69c7c67a..c7322591 100644
ret
END_FUNC

diff --git a/psw/urts/linux/urts.cpp b/psw/urts/linux/urts.cpp
index 73f1c77f..3bd98bc9 100644
--- a/psw/urts/linux/urts.cpp
+++ b/psw/urts/linux/urts.cpp
diff --git a/enclave_runtime/urts/linux/urts.cpp b/enclave_runtime/urts/linux/urts.cpp
index 73f1c77..3bd98bc 100644
--- a/enclave_runtime/urts/linux/urts.cpp
+++ b/enclave_runtime/urts/linux/urts.cpp
@@ -40,6 +40,26 @@

#include "urts_com.h"
Expand Down Expand Up @@ -152,10 +146,10 @@ index 73f1c77f..3bd98bc9 100644
static bool inline _check_ex_params_(const uint32_t ex_features, const void* ex_features_p[32])
{
//update last feature index if it fails here
diff --git a/psw/urts/linux/urts.lds b/psw/urts/linux/urts.lds
index 6cfd06d4..4cdfcfc3 100644
--- a/psw/urts/linux/urts.lds
+++ b/psw/urts/linux/urts.lds
diff --git a/enclave_runtime/urts/linux/urts.lds b/enclave_runtime/urts/linux/urts.lds
index 6cfd06d..4cdfcfc 100644
--- a/enclave_runtime/urts/linux/urts.lds
+++ b/enclave_runtime/urts/linux/urts.lds
@@ -1,5 +1,8 @@
{
global:
Expand All @@ -166,7 +160,7 @@ index 6cfd06d4..4cdfcfc3 100644
sgx_create_enclave_ex;
sgx_destroy_enclave;
diff --git a/sdk/simulation/urtssim/urts_deploy.c b/sdk/simulation/urtssim/urts_deploy.c
index 52c2b853..dd932326 100644
index 52c2b85..dd93232 100644
--- a/sdk/simulation/urtssim/urts_deploy.c
+++ b/sdk/simulation/urtssim/urts_deploy.c
@@ -57,6 +57,23 @@ sgx_status_t sgx_create_encrypted_enclave()
Expand Down Expand Up @@ -194,5 +188,5 @@ index 52c2b853..dd932326 100644
void sgx_debug_unload_state_remove_element(){};
void sgx_destroy_enclave(){};
--
2.51.2
2.54.0

16 changes: 3 additions & 13 deletions sdk/intel-sdk/install_SGX_SDK.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ function ci_silent() {
fi
}

git submodule init
git submodule update
git submodule update --init --recursive

# ----------------------------------------------------------------------
echo "[ patching SDK ]"
Expand Down Expand Up @@ -55,16 +54,7 @@ EOF
cd ../../../

# ----------------------------------------------------------------------
echo "[ building PSW ]"
ci_silent make psw_install_pkg

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

if [ -e /opt/intel/sgxpsw/uninstall.sh ]
then
sudo /opt/intel/sgxpsw/uninstall.sh
fi
sudo ./sgx_linux_x64_psw_*.bin
echo "[ building patched uRTS ]"
ci_silent make psw

echo "SGX SDK succesfully installed!"
2 changes: 1 addition & 1 deletion sdk/intel-sdk/linux-sgx
Submodule linux-sgx updated 3650 files
6 changes: 3 additions & 3 deletions sdk/intel-sdk/patch_sdk.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash

cd linux-sgx
cd linux-sgx/sdk

if [[ -v M32 ]]
then
echo "=== patching SDK ==="
patch -p1 < ../0000-32bit-compatibility-fixes.patch
patch -p1 < ../../0000-32bit-compatibility-fixes.patch
fi

echo "=== patching AEP/TCS/EBASE ==="
patch -p1 < ../0001-reconfigure-AEP-TCS-ebase.patch
patch -p1 < ../../0001-reconfigure-AEP-TCS-ebase.patch
Loading