Giter Site home page Giter Site logo

hbgit / map2check-library Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 11.39 MB

C library to support Map2Check Tool

License: GNU General Public License v3.0

CMake 3.66% C++ 55.80% C 38.52% Dockerfile 0.10% Shell 1.92%
map2check-library klee libfuzzer analysis

map2check-library's Introduction

License Build Status codecov

Map2Check-Library

It is a C library to support Map2Check Tool that performs over program analysis:

  • Tracking the basic blocks
  • Tracking the memory addresses used in the memory management, e.g., deference operations
  • Tracking the nondeterministic values generated by KLEE and LibFuzzer
  • Checking of safety properties, e.g.: overflow, invalid memory, and assert defined by the user
  • Providing an API wrapper to call map2check-library functions

To build the map2check-library

You can use the build.sh script, but it's necessary to install all map2check-library dependencies:

$ ./build.sh --debug

You can also use our dockerfile to set up the environment to build map2check-library, as follows:

  • Installing map2check-library tools to build:
$ docker build -t hbgit/map2checklibrary --no-cache -f Dockerfile .
$ docker pull klee/klee:2.2
$ sudo apt install -y python3-pip
$ pip3 install --user cpp-coveralls
  • Building and Testing the tool
$ docker run --rm -v $(pwd):/home/:Z --user $(id -u):$(id -g) hbgit/map2checklibrary /bin/bash -c "cd home/; ./build.sh -d -t"
# KLEE testing
$ ./run_klee_test.sh

Map2Check flow with the library

  • This figure shows how the map2check-library is integrated in the Map2Check tool. In the release is generated two version of the library, (1) a static library with the sufix .a, and (2) a llvm library with sufix .bc.

New Model and Library Flow

In this new data model, we aims to create a model object for each data structure that need a data storage, e.g., NonDetLog that has all data about nondet call functions. In this sense, we have a Container object that handle with the storage for each data structure.

Files Type

Caller

  • The files are simple C++ file (not modelling as class), its goal is to be adopted as wrapper to call the library features using extern "C". This way, the focus is keep simple to be integrated with LLVM-link or adopted as an API in C source code.

Analysis Mode

  • The files that modelling and performing the verification condition to be adopted by Map2Check tool, such as: overflow, memory safety, and reachability error.

Container

  • The files the modelling the data storage, different from the old library, we do not adopt temporary files, and all data gathered are shown in the end of the program analysis.

NonDetGen

  • The files that modelling and performing the generation of nondeterministic values, called by _VERIFIER_nondet* function in Map2Check tool. The tools supported by the library are KLEE and LibFuzzer.

How is the output from map2check-library execution?

After the verification condition from map2check-library to be validate using KLEE or LibFuzzer a JSON (specification RFC 8259) string is shown with all data collected in the execution analysis, as following:

{
  "Output": {
    "Result"     : "string",
    "LineNumber" : "unsigned",
    "Property"   : ["TRUE", "FALSE", "UNKWNON"],
    "Container_NonDetLog": [
      {
        "step"         : "01",
        "line"         : "unsigned",
        "scope"        : "unsigned",
        "value"        : "typename T",
        "function_name": "const char *"
      }
    ],
    "Container_AllocationLog": [
      {
        "step"           : "01",
        "address"        : "long",
        "size_to_destiny": "int"
      }
    ]
  }
}

map2check-library's People

Contributors

hbgit avatar

Watchers

 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.