Code Monkey home page Code Monkey logo

chengguozhen / sgx-shield Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jaebaek/sgx-shield

0.0 2.0 0.0 56.7 MB

SGX-Shield: Enabling Address Space Layout Randomization (ASLR) for SGX Programs

License: Other

C++ 69.91% C 15.16% Assembly 8.50% Makefile 0.20% Shell 0.09% HTML 0.85% CSS 0.01% Java 0.11% Groovy 0.01% Objective-C 3.47% Python 0.84% Protocol Buffer 0.01% M4 0.01% Roff 0.08% TeX 0.07% OCaml 0.32% CMake 0.28% Go 0.08% Batchfile 0.02% Standard ML 0.01%

sgx-shield's Introduction

SGX-Shield

Introduction

Hello! SGX-Shield is a system supporting ASLR in the SGX environment. The paper is still under review for publication.

All implementations for this project (except the existing code base like LLVM) is done by Jaebaek Seo (jaebaek at kaist dot ac dot kr).

Build and run

###Install Intel SGX SDK for Linux:

  • See (rootdir)/linux-driver/README.md and (rootdir)/linux-sdk/README.md

###Build LLVM

$ cd (rootdir)/llvm
$ mkdir build
$ cmake -G 'Unix Makefiles' ../ -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_TARGETS_TO_BUILD="X86"
$ make  # or make -jN

###Build libraries and link program with them

  • Generate ocall stubs.
$ cd (rootdir)/program/lib/
$ ./gen_ocall_stub.py   # this python script works with Python 2.7.6
  • Build libraries (musl-libc, libgcc, ocall stubs) and link program with them
$ cd (rootdir)/program/
$ make CC="`pwd`/../llvm/build/bin/clang -fPIC -fno-asynchronous-unwind-tables -fno-jump-tables"

###Run in an enclave

$ cp (rootdir)/program/program (rootdir)/loader
$ cd (rootdir)/loader/
$ make SGX_MODE=HW SGX_DEBUG=1

How to write another program

  • The entry function is void enclave_main() (See (rootdir)/program/in_enclave_test.c).
  • It must be ended by calling enclave_exit();

Limitation

  • Some libc functions will not work because of system calls. Currently, ocall stubs support system calls (See (rootdir)/program/lib/).

TODO

###Documentation

  • How to build nbenchmark.
  • How to build mbedTLS and a ssl sample server.
  • Debugging the program with non-enclave mode.
  • How to add ocalls.
  • ptrace/rop_attack mode.
  • Add Windows version.

###Optimization

  • Improve software-DEP loop optimization.

###Etc.

sgx-shield's People

Contributors

jaebaek avatar

Watchers

James Cloos avatar cheng guozhen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.