• Stars
    star
    220
  • Rank 180,422 (Top 4 %)
  • Language LLVM
  • License
    GNU General Publi...
  • Created over 4 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sys: A Static/Symbolic Tool for Finding Good Bugs in Good (Browser) Code

Sys: A Static/Symbolic Tool for Finding Good Bugs in Good (Browser) Code

If you're interested, check out the (very very very) new reimplementation over here!

Install

Install dependencies

If you want to install Sys locally:

  • llvm-9, llvm-9-tools
  • boolector configured with --shared option. See the build() and package() functions in this file as an example of how to install boolector after you clone it. On Arch Linux, you can just install boolector-git from AUR.
  • The Haskell tool Stack

Alternatively, you can use the Dockerfile from Ralf-Philipp Weinmann.

Build project

Once you have all the dependencies installed you should be able to just build the tool:

stack build

Test

Once you built the tool you can build and run our tests with:

stack test

This will run a more-or-less full version of our test suite, along with regression tests for every bug that we list in the paper. The suite takes a little over two minutes on laptop with 64GB of RAM and 8 threads. All tests with one exception---a bug whose source we're having trouble tracking down---should pass. If anything else fails, try re-running the tests; the solver may have timed out (this hasn't happened on our machines, but since we can't give you a login for annonymity, its a possibility that it will happen on your machine).

If you just want to reproduce the paper results and nothing else, run:

stack test --ta '-p End-to-end'

Run

Once you built the tool you can now use it to find bugs!

stack exec sys

The tool takes several options:

  -d DIR    --libdir=DIR   directory (or file) to analyze
  -e EXTN   --extn=EXTN    file extension
  -c CHECK  --check=CHECK  checker to run
  • The -d option is used to specify the directory (containing the LLVM files) or a single LLVM file.
  • The -e option is used to specify the extension of files to check. This is useful when building your project with different optimizations levels (e.g., .ll-O0 for debug build with -O0 and .ll-O0_p for production).
    • ll matches all *.ll files
    • O0 matches all *.ll-O0 and *.ll-O0_p files
    • O1 matches all *.ll-O1 and *.ll-O1_p files
    • O2 matches all *.ll-O2 and *.ll-O2_p files
    • O3 matches all *.ll-O3 and *.ll-O3_p files
    • Og matches all *.ll-Og and *.ll-Og_p files
    • Os matches all *.ll-Os and *.ll-Os_p files
    • Oz matches all *.ll-Oz and *.ll-Os_z files
    • prod matches all *_p files
    • any matches all files
  • The -c option is used to specify the checker to run, one of:
    • uninit: Uninitialized memory checker
    • heapoob: Malloc OOB checker
    • concroob: Negative index OOB checker
    • userinput: User input checker

Example

To find the uninitialized memory access bug that our tool found in Firefox's Prio library:

$ stack exec sys -- -c uninit -e prod -d ./test/Bugs/Uninit/Firefox/serial.ll-O2_p

The tool flags two bugs. Let's look at the first:

Stack uninit bug
Name "serial_read_mp_array_73"
in 
Name "serial_read_mp_array"
path-to-file
[UnName 4,UnName 71]

If you inspect the serial_read_mp_array() function, the buggy block path is %4 (the first block) to %71,where we use [%73].

Help

We haven't tested (and likely won't test) Sys on anything but Arch Linux. We're happy to integrate patches that add support for other OSes and build systems though!

Directory structure

โ”œโ”€โ”€ app            -- Executable used to run the checkers
โ”œโ”€โ”€ src
โ”‚ย ย  โ”œโ”€โ”€ Checkers   -- Static and symbolic checkers
โ”‚ย ย  โ”œโ”€โ”€ Control    -- Logging helpers
โ”‚ย ย  โ”œโ”€โ”€ LLVMAST    -- LLVM AST interface
โ”‚ย ย  โ”œโ”€โ”€ InternalIR -- Internal IR used to represent paths for both static and symex
โ”‚ย ย  โ”œโ”€โ”€ Static     -- Static checker DSL
โ”‚ย ย  โ””โ”€โ”€ Symex      -- Symbolic DSL and execution engine
โ”œโ”€โ”€ community      -- Community files
โ””โ”€โ”€ test           -- Tests

More Repositories

1

haybale

Symbolic execution of LLVM IR with an engine written in Rust
Rust
524
star
2

rlbox

RLBox sandboxing framework
C++
283
star
3

FaCT

Flexible and Constant Time Programming Language
OCaml
197
star
4

veriwasm

SFI verifier of Wasm binaries
Rust
79
star
5

lio

Labeled IO Library
Haskell
54
star
6

haybale-pitchfork

Verifying constant-time code with symbolic execution
Rust
42
star
7

ct-wasm

Constant-Time WebAssembly
24
star
8

wave

Verified Wasm runtime
Rust
20
star
9

swivel

HTML
16
star
10

cargo-scan

A tool for auditing Rust crates
Rust
13
star
11

rlbox_lucet_sandbox

RLbox integration to leverage WASM sandboxes compiled lucet
C++
12
star
12

pitchfork-angr

Python
12
star
13

rlbox_wasm2c_sandbox

C++
11
star
14

vera

JavaScript
11
star
15

veriwasm-verification

Coq proof for Veriwasm
Coq
9
star
16

bindings

Exploits from the Finding and Preventing Bugs in JavaScript Bindings paper
JavaScript
9
star
17

blade

Benchmarks for the Blade paper
C
8
star
18

ms-wasm

MS-Wasm: Soundly Enforcing Memory-Safe Execution of Unsafe Code. Build and reproduce the results from the paper.
7
star
19

haskell-boolector

Haskell bindings for the Boolector SMT solver
Haskell
5
star
20

scooter

Rust
5
star
21

ct-wasm-ports

WebAssembly
5
star
22

hfi-root

C
4
star
23

rlbox-book

C++
3
star
24

go2wrk

a small heavy duty http/https benchmark tool written in go
Go
3
star
25

cse227-spring22

Makefile
2
star
26

cse291-fall16

CSE 291, Fall 2016
HTML
2
star
27

lucet-spectre

Rust
2
star
28

paper_template

A template deian doesn't like for papers
Python
2
star
29

inline-fact

Inline FaCT in Haskell
Haskell
2
star
30

zerocost_root

Root repo for zerocost testing
HTML
2
star
31

cse127-website

HTML
2
star
32

wasmtime-spectre

Rust
2
star
33

frankie

Simple well-typed Haskell webserver and routing framework
Haskell
1
star
34

rlbox_wamr_sandbox

RLBox integration to leverage WASM sandboxes compiled with WAMR
C++
1
star
35

CTFFI

Python FFI for FaCT
Python
1
star
36

simple_library_example

Small library example. Good example for porting to rlbox and testing features
C++
1
star
37

wasm2c_sandbox_compiler

The WebAssembly Binary Toolkit
C++
1
star
38

ct-wasm-chromium

Instructions and resources for building chromium with support for CT-Wasm
1
star
39

cse291-spring21

Makefile
1
star
40

wasm-beyond-the-browser

A site for the workshop at Berkeley
HTML
1
star
41

mswasm-llvm

LLVM fork for producing MS-Wasm
C++
1
star
42

tasty-gradescope

Generate GradeScope score summaries from Tasty tests
Haskell
1
star
43

cse130-winter17

CSE 130 Winter 2017 course repo
HTML
1
star
44

rustc-cet

Rust
1
star
45

node

Fork of node using the safe V8 API to address binding bugs
JavaScript
1
star
46

hostcall_instrumented_wasmtime

wasmtime instrumented with hw timers at the hostcall boundary to measure I/O latency
Rust
1
star
47

ct-wasm-proofs

Proofs about the soundness and timing properties of CT-Wasm
Isabelle
1
star