项目作者: DhavalKapil

项目描述 :
A toy implementation of 'Stack Guard' on top of the LLVM compiler toolchain
高级语言: C++
项目地址: git://github.com/DhavalKapil/stack-guard.git
创建时间: 2017-06-30T16:01:31Z
项目社区:https://github.com/DhavalKapil/stack-guard

开源协议:MIT License

下载


stack-guard

A toy implementation of ‘Stack Guard’ on top of the LLVM compiler toolchain.

Instrumentation code is added during compilation process to insert and verify stack canaries. Local variables (on the stack) are reordered to prevent buffers overflowing into other local variables. Vulnerable buffers are identified by performing a simple version of static taint analysis. Dependencies are maintained between function calls and pointer manipulations.

Note: This was developed as a hobby project for fun. It should only be used for educational purposes. Some of its features could be implemented in a much simpler way, but I choose techniques which involved more of LLVM API, just to get used to it.

Installation

StackGuard requires cmake >= 3.8. It has been tested on llvm 3.5 and clang 3.5.

To build:

  1. mkdir build && cd build
  2. cmake -DLLVM_ROOT=/path/to/llvm/build ..
  3. make

Usage

  1. clang -Xload -load -Xload /path/to/StackGuard/build/StackGuardPass/LLVMStackGuardPass.so <source code>

Tests are present in ./tests. Run them using:

  1. make test

License

StackGuard is licensed under the MIT license.