Git Product home page Git Product logo

heap-expo's Introduction

HeapExpo

Introduction

HeapExpo is an instrumentation tool to mitigate use-after-free(UAF) vulnerability which is widely present in C/C++ programs. Previous work DangSan is unable to cover important source of danging pointers like local variables and function arguments. HeapExpo addresses the coverage gap by pinpointing promoted pointer that can casue UAF.

Prerequiste

Install dependencies.

sudo apt-get update
sudo apt-get install -y bison build-essential gettext git pkg-config python ssh subversion wget time vim

For runnig comparision tests, you need to install llvm-10.

sudo apt-get install -y automake libtool-bin libunwind-dev
sudo apt-get install -y libllvm-10-ocaml-dev libllvm10 llvm-10 llvm-10-dev llvm-10-doc llvm-10-runtime clang-10 clang-tools-10 libclang-common-10-dev libclang-10-dev libclang1-10 libc++-10-dev libc++abi-10-dev

Or install llvm-10 more easily with llvm scripts

wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 10

CPU2006 Benchmark

Installation

Run the following commands to setup

Normal setup

git clone https://github.com/buszk/heap-expo.git
cd heap-expo
PATHSPEC=/path/to/spec/cpu2006 ./autosetup.sh

Docker setup

We actually recomment using a docker environment to avoid mess in your system. Create a docker container with the following command. Adjust cpu2006 directory properly.

docker run --name heap-expo --privileged -it -v /path/to/spec/cpu2006:/cpu2006 debian:9

Inside the docker container, install depencies and then run the following script to build.

git clone https://github.com/buszk/heap-expo.git /heap-expo
cd /heap-expo
FORCE_UNSAFE_CONFIGURE=1 PATHSPEC=/cpu2006 ./autosetup.sh

After build, use ./run-spec-cpu2006-{baseline-lto,heap-expo,dangsan}.sh all to run the benchmarks. The results available in /cpu2006/result are shown in Figure 2 of our paper.

Benchmarking

./run-spec-cpu2006-dangsan.sh all

Coverage Test (Compared with DangSan)

All tested c programs are located at tests/ in port branch. We summarized the test results to Table 5.

To provide an easy test environment, we ported HeapExpo from llvm-3.8 to llvm-10. It should also be compatible with other modern versions. We put our ported version under the port branch. In order to build our test, you can use the following commands.

git clone https://github.com/buszk/heap-expo.git
cd heap-expo
git checkout port
make -j

Run test with

make test

The compared coverage test script is in Makefile. You can find out the tests where HeapExpo detects UAF while DangSan fails.

heap-expo's People

Contributors

buszk 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.