This contains all the defenses (compiler based) for the Glitch Please project.
- Clang/LLVM 8.0.0
Building LLVM and Clang from sources (This needs ~40GB disk space and compilation time of ~90min)
-
Download LLVM-8.0.0, clang-8.0.0
-
Unzip the LLVM and Clang source files
tar xf llvm-8.0.0.src.tar.xz
tar xf cfe-8.0.0.src.tar.xz
mv cfe-8.0.0.src llvm-8.0.0.src/tools/clang
- Create your target build folder and make
mkdir llvm-8.0.0.obj
cd llvm-8.0.0.obj
cmake -DCMAKE_BUILD_TYPE=Debug ../llvm-8.0.0.src (or add "-DCMAKE_BUILD_TYPE:STRING=Release" for releae version)
make -j8
- Add paths for LLVM and Clang
export LLVM_SRC=your_path_to_llvm-8.0.0.src
export LLVM_OBJ=your_path_to_llvm-8.0.0.obj
export LLVM_DIR=your_path_to_llvm-8.0.0.obj
export PATH=$LLVM_DIR/bin:$PATH
If you have direnv
installed (i.e., sudo apt-get install direnv
), and configured, you can simply do the following:
./setup_dev_environment.sh
This will also add the bin
directory of our Source Rewriter to your direnv path so that you can use it via:
gp-source-rewriter
We used the latest version of the arm compiler from here
There are two main components of our defense:
- Source Rewriter (gp_source_rewriter)
- Instrumenter
As the name implies, this component uses source rewriting to apply the appropriate defenses. For this, we use clang
tooling infrastructure.
More details of this could be found at: gp_source_rewriter
This component uses the classic compiler based instrumentation to apply the defenses.
More details of this could be found at: Instrumenter