GDBitflip [v1.04]

Runtime fault injection platform by Daniele Rizzieri (2021)
This platform executes N times a binary and during each execution it injects a bitflip in a random register, at a random time, then let the execution finish and observes/reports the outcomes.

Requirements

Required Linux packages:

  • python3
  • procps
  • gdb (configured with –with-python option, usually by default)

Test Binary File Guidelines

In order to be properly testable, the program under test must be compliant with the following guidelines:

  1. Application’s output must be redirected to the standard output virtual file (i.e., it must be instructed to print the functional results to screen/console)
  2. Application’s behaviour and functional output must be fully deterministic: the tester must ensure that the entire code does not depend on time or other random variables. Examples:
    • if some kind of randomization function is involved, the tester must fix the randomization seed;
    • if some kind of time related function is involved, the tester must either suppress it or fix the time dependant variable;
  3. The test application must be compiled from code, following the here reported guidelines:
    1. During the compilation the debug symbols must be included using the GCC option “-g”
    2. The application must be statically linked, through the “-static” compilation option
    3. When compiling, the tester should avoid the compiler optimization options “-o#”

Quick Start

  1. Remember to compile binary under test with -g option (to include debug symbols) and without optimization flags -O

  2. Remember to make the binary file executable

  3. Type “python3 gdbitflip.py -h” or “python3 gdbitflip.py –help” for usage info:

Usage: python3 gdbitflip.py PATH/TO/BINARY -n [–args
ARGS] [options]

   required:

        PATH/TO/BINARY          Path (relative or absolute) to binary file under test

        -n ,                        = number of injections

   optional:

        –args

ARGS

                                          

= number of args of binary;

                                          ARGS = argument of program divided by space

        -s r_seed,                   Set the random seed to r_seed

        -v, –verbose,             To produce verbose execution report

        -c, –clean,                 To clean the bitflipped results folder and exit

        -z, –zip,                     To compact all the reports in ./exec_reports/ in a summary in ./exec_reports/SUMMARIES/

  1. See crash report in the file indicated at end of execution.

  2. See execution report in the file indicated at end of execution.

Output File Locations

  • ./bitflipped_results/ –> functional results of the binaries
  • ./core_dumps/ –> coredumps file of crashed processes
  • ./crash_reports/ –> reports containing info about the crashed processes
  • ./crash_logs/ –> log files from gdb analysis of the coredumps
  • ./exec_reports/ –> reports containing info about the exit codes, correctness of results and hang processes

GitHub

View Github