Giter Site home page Giter Site logo

vnigade / dangsan-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vusec/dangsan

0.0 1.0 0.0 1.09 MB

Shell 1.91% PHP 0.61% Assembly 0.25% C++ 76.95% HTML 3.64% SourcePawn 0.01% Python 0.51% Makefile 2.63% C 5.24% M4 1.72% CSS 0.07% Roff 0.10% Perl 6.32% CMake 0.04%

dangsan-1's Introduction

DangSan

DangSan instruments programs written in C or C++ to invalidate pointers whenever a block of memory is freed, preventing dangling pointers. Instead, whenever such a pointer is dereferenced, it refers to unmapped memory and results in a crash. As a consequence, attackers can no longer exploit dangling pointers.

For more information, see the paper "DangSan: Scalable Use-after-free Detection" by Erik van der Kouwe, Vinod Nigade, and Cristiano Giuffrida, presented at the EuroSys 2017 conference.

Terminology

To explain our system to automatically build DangSan and instrument programs, we will use the following terms: instance and target.

An instance is a compiler configuration used to instrument a program. Instances provided by this repository are:

  • baseline-lto compiles a program without instrumentation, using LLVM with link-time optimizations and using the base version of tcmalloc;
  • dangsan instruments the program with our pointer tracker;
  • dangsan-stats instruments the program using a static library that tracks various statistics about DangSan's work (this instance should not be used for performance measurements).

A target is a program to be instrumented by DangSan. We include support for two targets by default:

  • parsec is the PARSEC 3.0 benchmarking suite;
  • spec-cpu2006 is the SPEC CPU2006 benchmarking suite.

Prerequistes

DangSan runs on Linux and was tested on Ubuntu 16.04.2 LTS 64-bit. It requires a number of packages to be installed, depending on the particular Linux distribution used. In case of Ubuntu 16.04.2 LTS, the following command installs the required packages (on a clean server installation):

sudo apt-get install bison build-essential gettext git pkg-config python ssh subversion

Our prototype includes scripts to instrument the SPEC CPU2006 and PARSEC benchmarks. While PARSEC is open source and automatically downloaded installed by our scripts, SPEC CPU2006 is not freely available and must be supplied by the user.

Our prototype requires about 22GB of disk space, which includes about 2GB for the SPEC CPU2006 installation and about 11GB for the PARSEC installation. Both of these are optional.

Installation

First, obtain the DangSan source code:

git clone https://github.com/vusec/dangsan.git

The following command automatically installs remaining dependencies locally (no need for root access), builds DangSan, builds all targets for all instances, and generate scripts to run the targets conveniently:

cd dangsan
PATHSPEC=/path/to/spec/cpu2006 ./autosetup.sh

To control which targets are built, set and export the TARGETS environment variable to a space-separated (possibly empty) list of desired targets. Currently supported options are parsec and spec-cpu2006. The default is to build all targets.

When building the SPEC CPU2006 target, PATHSPEC must point to an existing SPEC CPU2006 installation. We recommend creating a fresh installation for DangSan to use because we need to apply some (very minor) patches.

Running benchmarks

After building DangSan and the desired targets, the targets can be executed using the run scripts generated in the root directory of the DangSan repository. The run scripts pass along parameters to the run utility supplied by the benchmarking suite to allow the user to specify the benchmark and any other settings. There is a separate run script for each instance. For example, run-parsec-dangsan.sh runs the parsec target instrumented with DangSan.

For example, to run the bzip2 benchmark from SPEC CPU2006 instrumented by DangSan, use the following command:

./run-spec-cpu2006-dangsan.sh 401.bzip2

To run the blackscholes benchmark from PARSEC in a baseline configuration using 16 threads, use the following command:

./run-parsec-baseline-lto.sh -p parsec.blackscholes -n 16 -i native

Lists of available benchmarks can be found in autosetup/targets/{parsec,spec-cpu2006}/benchmarks.inc.

Analyzing results

The run scripts write logs to the standard output. To analyze the results after running a number of benchmarks, redirect each output to a separate file and pass the names of output files (or, alternatively, the name of the directory containing the output files) to scripts/analyze-logs.py.

dangsan-1's People

Watchers

Vinod Nigade 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.