forked from apache/incubator-teaclave-sgx-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
883 changed files
with
28,141 additions
and
37,203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,29 +3,37 @@ | |
[](https://gitter.im/rust-sgx-sdk/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) | ||
|
||
# Rust SGX SDK | ||
Rust SGX SDK helps developers write Intel SGX applications in Rust programming language. [[Paper pdf]](documents/ccsp17.pdf) | ||
Rust SGX SDK helps developers write Intel SGX applications in Rust programming language. [[CCS'17 Paper pdf]](documents/ccsp17.pdf) [[CCS'19 Paper pdf]](https://dingelish.com/ccs19.pdf) | ||
|
||
Good news! Our paper "Towards Memory Safety for Enclave Programs with Rust-SGX" has been accepted in ACM CCS'19. See you guys in London! | ||
Good News! Our paper "Building and Maintaining a Third-Party Library Supply Chain for Productive and Secure SGX Enclave Development" has been accepted by ICSE'20 SEIP track. See you guys in Seoul! | ||
|
||
We open-sourced [gbdt-rs](https://github.com/mesalock-linux/gbdt-rs), a light-weight, amazingly fast, memory safe, and trustworthy gradient boosting decision tree implementation and the [paper](documents/gbdt.pdf) has been accepted by IEEE S&P'19! It is optimized for SGX! | ||
|
||
To achieve better security, we recommend developers to apply [Non-bypassable Security Paradigm (NbSP)](https://github.com/baidu/rust-sgx-sdk/blob/master/documents/nbsp.pdf) to the system design and implementation. | ||
To achieve better security, we recommend developers to apply [Non-bypassable Security Paradigm (NbSP)](https://github.com/apache/teaclave-sgx-sdk/blob/master/documents/nbsp.pdf) to the system design and implementation. | ||
|
||
To help understand this project and know how to use it, we are writing some [wiki](https://github.com/baidu/rust-sgx-sdk/wiki) articles. Please [send me an email](mailto:[email protected]?subject=Wiki%20page%20needed:) if you'd like to see other topics. We'll add it as soon as possible. | ||
To help understand this project and know how to use it, we are writing some [wiki](https://github.com/apache/teaclave-sgx-sdk/wiki) articles. Please [send me an email](mailto:[email protected]?subject=Wiki%20page%20needed:) if you'd like to see other topics. We'll add it as soon as possible. | ||
|
||
Current wiki pages: | ||
|
||
* [The World of Forked crates](https://github.com/baidu/rust-sgx-sdk/wiki/The-World-of-Forked-crates) introduces the forked crate ecosystem, and provides some guidelines and usage, and show how we secure them. | ||
* [Mitigation of Intel SA 00219 in Rust SGX](https://github.com/apache/incubator-mesatee-sgx/wiki/Mitigation-of-Intel-SA-00219-in-Rust-SGX) | ||
|
||
* [Setup gdb 7.11 on Ubuntu 18.04 for VSCode sgx-gdb remote debugging](https://github.com/baidu/rust-sgx-sdk/wiki/Setup-gdb-7.11-on-Ubuntu-18.04-for-VSCode---sgx-gdb-remote-debugging) If you encounter errors like `gdb.error: syntax error in expression, near )0x7ffff4127370 = 0.`, probably you need to follow this instruction to setup gdb 7. Thanks to @akoskinas for this great instruction! | ||
* [`is_x86_feature_detected` in Rust SGX SDK](https://github.com/apache/incubator-mesatee-sgx/wiki/%60is_x86_feature_detected%60-in-Rust-SGX-SDK) | ||
|
||
* [Performance Optimization Tips](https://github.com/baidu/rust-sgx-sdk/wiki/Performance-Optimization-Tips) | ||
* [The World of Forked crates](https://github.com/apache/teaclave-sgx-sdk/wiki/The-World-of-Forked-crates) introduces the forked crate ecosystem, and provides some guidelines and usage, and show how we secure them. | ||
|
||
* [Use VSCode rls+rust-analysis+sgx-gdb for graphic developing (not in docker)](https://github.com/baidu/rust-sgx-sdk/wiki/Use-VSCode---rls---rust-analysis---sgx-gdb-for-graphic-developing-(not-in-docker)) | ||
* [Setup gdb 7.11 on Ubuntu 18.04 for VSCode sgx-gdb remote debugging](https://github.com/apache/teaclave-sgx-sdk/wiki/Setup-gdb-7.11-on-Ubuntu-18.04-for-VSCode---sgx-gdb-remote-debugging) If you encounter errors like `gdb.error: syntax error in expression, near )0x7ffff4127370 = 0.`, probably you need to follow this instruction to setup gdb 7. Thanks to @akoskinas for this great instruction! | ||
|
||
* [Debugging local enclave in docker](https://github.com/baidu/rust-sgx-sdk/wiki/Debugging-a-local-Rust-SGX-enclave-in-docker-with-sgx-gdb) | ||
* [Performance Optimization Tips](https://github.com/apache/teaclave-sgx-sdk/wiki/Performance-Optimization-Tips) | ||
|
||
* Everything about [environment setup](https://github.com/baidu/rust-sgx-sdk/wiki/Environment-Setup) | ||
* [Use VSCode rls+rust-analysis+sgx-gdb for graphic developing (not in docker)](https://github.com/apache/teaclave-sgx-sdk/wiki/Use-VSCode---rls---rust-analysis---sgx-gdb-for-graphic-developing-(not-in-docker)) | ||
|
||
* [Debugging local enclave in docker](https://github.com/apache/teaclave-sgx-sdk/wiki/Debugging-a-local-Rust-SGX-enclave-in-docker-with-sgx-gdb) | ||
|
||
* Everything about [environment setup](https://github.com/apache/teaclave-sgx-sdk/wiki/Environment-Setup) | ||
|
||
## v1.1.0 | ||
|
||
Supports Intel SGX SDK v2.7.1, and Rust nightly-2019-11-25. v1.1.0 brings up dynamic static supports by `thread::spawn`, and almost everything of `std::sync`. Also v1.1.0 benefits from Intel SGX SDK's aligned memory allocation primitives to mitigate [INTEL-SA-00219](https://github.com/apache/incubator-mesatee-sgx/wiki/Mitigation-of-Intel-SA-00219-in-Rust-SGX). Besides, we enabled [`is_x86_feature_detected!`](https://github.com/apache/incubator-mesatee-sgx/wiki/%60is_x86_feature_detected%60-in-Rust-SGX-SDK) by parsing a hidden global CPU feature indicator initialized by Intel SGX urts/trts. And we provided Dockerfile for Fedora 27. For detailed information, please refer to [release_notes](release_notes.md) for more details. | ||
|
||
## v1.0.9 Release | ||
|
||
|
@@ -64,7 +72,7 @@ This version supports Rust nightly build (nightly-2018-10-01) in the master bran | |
This version supports the Rust nightly build (nightly-2018-07-16) in master branch and the most recent Rust stable build (stable-2018-07-10). And it supports the latest Intel SGX SDK **v2.2**. New third party libraries include: bytes, http, iovec, rust-crypto, rust-fnv and rust-threshold-secret-sharing. New code sample 'secretsharing' and 'rust-threshold-secret-sharing' is provided by @davidp94. Please refer to [release_notes](release_notes.md) for further details. | ||
|
||
## v1.0.0 Release | ||
We proudly announce v1.0.0 of rust-sgx-sdk! We port Parity's [Webassembly Interpreter](https://github.com/paritytech/wasmi) to Intel SGX and provide a full functional in-enclave [wasmi sample](samplecode/wasmi), and a [sample solution](samplecode/psi) of two-party private-set-intersection resisting side-channel attacks! From this version, we start to support most recent stable branch of Rust instead of nightly for better stability and future production use. Thus, the [stable branch](https://github.com/baidu/rust-sgx-sdk/tree/rust-stable) of v1.0.0 supports the most recent Rust stable toolchain (1.26.0 stable-2018-05-07), while the master only supports Rust nightly toolchain of nightly-2018-04-11. Please refer to [release_notes](release_notes.md) for further details. | ||
We proudly announce v1.0.0 of rust-sgx-sdk! We port Parity's [Webassembly Interpreter](https://github.com/paritytech/wasmi) to Intel SGX and provide a full functional in-enclave [wasmi sample](samplecode/wasmi), and a [sample solution](samplecode/psi) of two-party private-set-intersection resisting side-channel attacks! From this version, we start to support most recent stable branch of Rust instead of nightly for better stability and future production use. Thus, the [stable branch](https://github.com/apache/teaclave-sgx-sdk/tree/rust-stable) of v1.0.0 supports the most recent Rust stable toolchain (1.26.0 stable-2018-05-07), while the master only supports Rust nightly toolchain of nightly-2018-04-11. Please refer to [release_notes](release_notes.md) for further details. | ||
|
||
## v0.9.8 Release | ||
This version provides security updates regards to recent Spectre attacks in Intel SGX, and supports **Rust stable (2018-03-01)** (in branch named 'rust-stable'). It contains support of [Intel SGX SDK 2.1.2](https://download.01.org/intel-sgx/linux-2.1.2/) and a series of API functions to stop speculative execution on demand. In addition, we provide a ported version of [rust-protobuf](https://crates.io/crates/protobuf) v1.4.4. Please refer to [release_notes](release_notes.md) for further details. | ||
|
@@ -238,8 +246,6 @@ Baidu Rust-SGX SDK is provided under the BSD license. Please refer to the [Licen | |
|
||
Ran Duan, Long Li, Shi Jia, Yu Ding, Yulong Zhang, Yueqiang Cheng, Lenx Wei, Tanghui Chen | ||
|
||
 | ||
|
||
# Acknowledgement | ||
|
||
Thanks to [Prof. Jingqiang Lin](http://people.ucas.ac.cn/~0010268) for his contribution to this project. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: complex.h,v 1.3 2010/07/24 22:17:03 guenther Exp $ */ | ||
/* $OpenBSD: complex.h,v 1.3 2010/07/24 22:17:03 guenther Exp $ */ | ||
/* | ||
* Copyright (c) 2008 Martynas Venckus <[email protected]> | ||
* | ||
|
@@ -16,7 +16,7 @@ | |
*/ | ||
|
||
#ifndef _COMPLEX_H_ | ||
#define _COMPLEX_H_ | ||
#define _COMPLEX_H_ | ||
|
||
#include <sys/cdefs.h> | ||
|
||
|
@@ -25,18 +25,18 @@ | |
*/ | ||
#ifdef __GNUC__ | ||
#if __STDC_VERSION__ < 199901 | ||
#define _Complex __complex__ | ||
#define _Complex __complex__ | ||
#endif | ||
#define _Complex_I 1.0fi | ||
#define _Complex_I 1.0fi | ||
#elif defined(lint) | ||
#define _Complex_I 1.0fi | ||
#define _Complex_I 1.0fi | ||
#endif | ||
|
||
#define complex _Complex | ||
#define complex _Complex | ||
|
||
/* XXX switch to _Imaginary_I */ | ||
#undef I | ||
#define I _Complex_I | ||
#define I _Complex_I | ||
|
||
__BEGIN_DECLS | ||
/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* $OpenBSD: iso646.h,v 1.3 2001/10/11 00:05:21 espie Exp $ */ | ||
/* $NetBSD: iso646.h,v 1.1 1995/02/17 09:08:10 jtc Exp $ */ | ||
/* $OpenBSD: iso646.h,v 1.3 2001/10/11 00:05:21 espie Exp $ */ | ||
/* $NetBSD: iso646.h,v 1.1 1995/02/17 09:08:10 jtc Exp $ */ | ||
|
||
/* | ||
* Written by J.T. Conklin <[email protected]> 02/16/95. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* Copyright (C) 1996-2018 Free Software Foundation, Inc. | ||
This file is part of the GNU C Library. | ||
The GNU C Library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
The GNU C Library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with the GNU C Library; if not, see | ||
<http://www.gnu.org/licenses/>. */ | ||
|
||
/* All data returned by the network data base library are supplied in | ||
host order and returned in network order (suitable for use in | ||
system calls). */ | ||
|
||
#ifndef _NETDB_H | ||
#define _NETDB_H | ||
|
||
struct addrinfo | ||
{ | ||
int ai_flags; /* Input flags. */ | ||
int ai_family; /* Protocol family for socket. */ | ||
int ai_socktype; /* Socket type. */ | ||
int ai_protocol; /* Protocol for socket. */ | ||
socklen_t ai_addrlen; /* Length of socket address. */ | ||
struct sockaddr *ai_addr; /* Socket address for socket. */ | ||
char *ai_canonname; /* Canonical name for service location. */ | ||
struct addrinfo *ai_next; /* Pointer to next in list. */ | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#ifndef _SYS_THREAD_H_ | ||
#define _SYS_THREAD_H_ | ||
|
||
/* Thread identifiers. The structure of the attribute type is not | ||
exposed on purpose. */ | ||
typedef unsigned long int pthread_t; | ||
|
||
#if defined __x86_64__ && !defined __ILP32__ | ||
# define __WORDSIZE 64 | ||
#else | ||
# define __WORDSIZE 32 | ||
#define __WORDSIZE32_SIZE_ULONG 0 | ||
#define __WORDSIZE32_PTRDIFF_LONG 0 | ||
#endif | ||
|
||
#ifdef __x86_64__ | ||
# if __WORDSIZE == 64 | ||
# define __SIZEOF_PTHREAD_ATTR_T 56 | ||
# else | ||
# define __SIZEOF_PTHREAD_ATTR_T 32 | ||
#endif | ||
|
||
union pthread_attr_t | ||
{ | ||
char __size[__SIZEOF_PTHREAD_ATTR_T]; | ||
long int __align; | ||
}; | ||
#ifndef __have_pthread_attr_t | ||
typedef union pthread_attr_t pthread_attr_t; | ||
# define __have_pthread_attr_t 1 | ||
#endif | ||
|
||
#endif | ||
#endif |
Oops, something went wrong.