ESBMC 1.22 (Competition Contribution) Jeremy Morse, Mikhail Ramalho, Lucas Cordeiro, Denis Nicole, Bernd Fischer

Similar documents
MEMORY MANAGEMENT TEST-CASE GENERATION OF C PROGRAMS USING BOUNDED MODEL CHECKING

Verifying C & C++ with ESBMC

SMT-Based Bounded Model Checking for Embedded ANSI-C Software. Lucas Cordeiro, Bernd Fischer, Joao Marques-Silva

Handling Loops in Bounded Model Checking of C Programs via k-induction

Model Checking Embedded C Software using k-induction and Invariants

Bounded Model Checking Of C Programs: CBMC Tool Overview

UNDERSTANDING PROGRAMMING BUGS IN ANSI-C SOFTWARE USING BOUNDED MODEL CHECKING COUNTER-EXAMPLES

OptCE: A Counterexample-Guided Inductive Optimization Solver

SMT-Based Bounded Model Checking for Embedded ANSI-C Software

ECBS SMT-Bounded Model Checking of C++ Programs. Mikhail Ramalho, Mauro Freitas, Felipe Sousa, Hendrio Marques, Lucas Cordeiro, Bernd Fischer

Introduction to CBMC: Part 1

Introduction to CBMC. Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Arie Gurfinkel December 5, 2011

System LAV and Its Applications

Software Model Checking. Xiangyu Zhang

: A Bounded Model Checking Tool to Verify Qt Applications

Applying Multi-Core Model Checking to Hardware-Software Partitioning in Embedded Systems

More on Verification and Model Checking

Lecture Notes on Memory Layout

Model Checking of C and C++ with DIVINE 4

Application of Propositional Logic II - How to Test/Verify my C program? Moonzoo Kim

Applications of Logic in Software Engineering. CS402, Spring 2016 Shin Yoo

Static Analysis in C/C++ code with Polyspace

Context-Switch-Directed Verification in DIVINE

Deductive Methods, Bounded Model Checking

Seminar in Software Engineering Presented by Dima Pavlov, November 2010

The Low-Level Bounded Model Checker LLBMC

Bounded Model Checking of Concurrent Programs

CS 430 Spring Mike Lam, Professor. Data Types and Type Checking

Formal Verification of Embedded Software in Medical Devices Considering Stringent Hardware Constraints

CS 267: Automated Verification. Lecture 13: Bounded Model Checking. Instructor: Tevfik Bultan

Symbolic and Concolic Execution of Programs

Understanding Undefined Behavior

Garbage Collection Algorithms. Ganesh Bikshandi

SAT-based Model Checking for C programs

C Code Verification based on the Extended Labeled Transition System Model

Structures, Unions Alignment, Padding, Bit Fields Access, Initialization Compound Literals Opaque Structures Summary. Structures

Counterexample Guided Inductive Optimization Applied to Mobile Robot Path Planning SBR/LARS 2017

Xuandong Li. BACH: Path-oriented Reachability Checker of Linear Hybrid Automata

377 Student Guide to C++

C and C++ Secure Coding 4-day course. Syllabus

Verification & Validation of Open Source

Research on the Static Analysis Method of the Localization Embedded Platform Software Code Zhijie Gaoa, Ling Lu, Wen Jiao

Embedded Software Verification Challenges and Solutions. Static Program Analysis

A Bounded Model Checker for SPARK Programs

EL6483: Brief Overview of C Programming Language

Copyright 2008 CS655 System Modeling and Analysis. Korea Advanced Institute of Science and Technology

One-Slide Summary. Lecture Outline. Language Security

CSC 467 Lecture 13-14: Semantic Analysis

C2TLA+: A translator from C to TLA+

DSVerifier: A Bounded Model Checking Tool for Digital Systems

Tutorial 5. Overflow. Data Types. Structures. Call stack. Stack frames. Debugging Tips. CS 136 Winter 2019 Tutorial 5 1

Encoding floating-point numbers using the SMT theory in ESBMC: An empirical evaluation over the SV-COMP benchmarks

Homework #3 CS2255 Fall 2012

Lexical Considerations

Verifying Multithreaded Software with Impact

Temporal Refinement Using SMT and Model Checking with an Application to Physical-Layer Protocols

Data Storage. August 9, Indiana University. Geoffrey Brown, Bryce Himebaugh 2015 August 9, / 19

Data Representation and Storage. Some definitions (in C)

Introduction to C. Why C? Difference between Python and C C compiler stages Basic syntax in C

Type Checking. Prof. James L. Frankel Harvard University

arxiv: v2 [cs.se] 13 Jul 2009

Bounded Model Checking with Parametric Data Structures

Simple Overflow. #include <stdio.h> int main(void){ unsigned int num = 0xffffffff;

SMT-Based Bounded Model Checking of C++ Programs

Lexical Considerations

CS558 Programming Languages

Lecture 6. Process Synchronization

Language Security. Lecture 40

We would like to find the value of the right-hand side of this equation. We know that

Exploiting Safety Properties in Bounded Model Checking for Test Cases Generation of C Programs

Short Notes of CS201

Encoding floating-point numbers using the SMT theory in ESBMC: An empirical evaluation over the SV-COMP benchmarks

HySAT. what you can use it for how it works example from application domain final remarks. Christian Herde /12

A program execution is memory safe so long as memory access errors never occur:

C Review. MaxMSP Developers Workshop Summer 2009 CNMAT

Cascade 2.0. C static analysis tool with an SMT backend. Wei Wang, Clark Barrett, Thomas Wies

CS201 - Introduction to Programming Glossary By

1 Lexical Considerations

Symbolic Execution, Dynamic Analysis

COMP 181. Agenda. Midterm topics. Today: type checking. Purpose of types. Type errors. Type checking

Computer Systems A Programmer s Perspective 1 (Beta Draft)

Introduction to C++ Introduction. Structure of a C++ Program. Structure of a C++ Program. C++ widely-used general-purpose programming language

The SPL Programming Language Reference Manual

Lecture 10. Pointless Tainting? Evaluating the Practicality of Pointer Tainting. Asia Slowinska, Herbert Bos. Advanced Operating Systems

Q1: /8 Q2: /30 Q3: /30 Q4: /32. Total: /100

Formally Certified Satisfiability Solving

Programming in C. Lecture 9: Tooling. Dr Neel Krishnaswami. Michaelmas Term

BITCOIN MINING IN A SAT FRAMEWORK

Introduction to C++ with content from

SMT-Based Modular Analysis of Sequential Systems Code

Honours/Master/PhD Thesis Projects Supervised by Dr. Yulei Sui

Automated Test Generation using CBMC

CPSC 3740 Programming Languages University of Lethbridge. Data Types

SE352b: Roadmap. SE352b Software Engineering Design Tools. W3: Programming Paradigms

Promela and SPIN. Mads Dam Dept. Microelectronics and Information Technology Royal Institute of Technology, KTH. Promela and SPIN

Final Exam. 11 May 2018, 120 minutes, 26 questions, 100 points

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions)

Memory Management: The process by which memory is shared, allocated, and released. Not applicable to cache memory.

C++ Undefined Behavior

Program Analysis and Code Verification

Transcription:

ESBMC 1.22 (Competition Contribution) Jeremy Morse, Mikhail Ramalho, Lucas Cordeiro, Denis Nicole, Bernd Fischer

ESBMC: SMT-based BMC of single- and multi-threaded software exploits SMT solvers and their background theories: optimized encodings for pointers, bit operations, unions and arithmetic over- and underflow efficient search methods (non-chronological backtracking, conflict clauses learning) supports verifying multi-threaded software that uses pthreads threading library interleaves only at visible instructions lazy exploration of the reachability tree optional context-bound derived from CBMC (v2.9) and has inherited its objectbased memory model

ESBMC verification support built-in properties: arithmetic under- and overflow pointer safety array bounds division by zero memory leaks atomicity and order violations deadlocks data races user-specified assertions ( ESBMC_assume, ESBMC_assert) built-in scheduling functions ( ESBMC_atomic_begin, ESBMC_atomic_end, ESBMC_yield)

Differences to ESBMC 1.20 ESBMC 1.22 is largely a bugfixing release: memory handling replaced CBMC s string-based accessor functions increased ESBMC s speed by 2x improved memory model for precision, performance, and stability produces a smaller number of false results more errors detected (+109), fewer unexpected (-15) and missed (-157) errors

ESBMC s memory model statically tracks possible pointer variable targets (objects) dereferencing a pointer leads to the construction of guarded references to each potential target C is very liberal about permitted dereferences struct foo { uint16_t bar[2]; uint8_t baz; }; struct foo qux; char *quux = &qux; quux++; *quux; pointer and object types do not match SAT: immediate access to bit-level representation

ESBMC s memory model statically tracks possible pointer variable targets (objects) dereferencing a pointer leads to the construction of guarded references to each potential target C is very liberal about permitted dereferences struct foo { uint16_t bar[2]; uint8_t baz; }; struct foo qux; char *quux = &qux; quux++; *quux; SMT: sorts must be repeatedly unwrapped pointer and object types do not match

Byte-level data extraction in SMT access to underlying data bytes is complicated requires manipulation of arrays / tuples problem is magnified by nondeterministic offsets uint16_t *fuzz; if (nondet_bool()) { fuzz = &qux.bar[0]; } else { fuzz = &qux.baz; } chooses accessed field nondeterministically requires a byte_extract expression handles the tuple that encoded the struct supporting all legal behaviors at SMT layer difficult extract (unaligned) 16bit integer from *fuzz experiments showed significantly increased memory consumption

Aligned Memory Model framework cannot easily be changed to SMT-level byte representation (a la LLBMC) push unwrapping of SMT data structures to dereference enforce C alignment rules static analysis of pointer alignment eliminates need to encode unaligned data accesses reduces number of behaviors that must be modeled add alignment assertions (if static analysis not conclusive) extracting 16-bit integer from *fuzz: offset = 0: project bar[0] out of foo offset = 1: unaligned memory access failure offset = 2: project bar[1] out of foo offset = 3: unaligned memory access failure offset = 4: access to object out of bounds failure

Strengths: robust context-bounded model checker for C programs improved memory model to handle pointer arithmetic greater accuracy and faster verification Weaknesses: all unexpected results are caused by bounding the programs (Recursive) differences in the memory models (MemorySafety) ESBMC detects an unchecked dereference of a pointer to a freshly allocated memory chunk