Verification of Programs Sensitive to Heap Layout

被引:0
|
作者
Lauko, Henrich [1 ]
Korencik, Lukas [1 ]
Rockai, Petr [1 ]
机构
[1] Masaryk Univ, Bot 68a, Brno 60200, Czech Republic
关键词
Heap; pointers; abstraction; refinement; program transformation; MODEL CHECKING;
D O I
10.1145/3508363
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Most C and C++ programs use dynamically allocated memory (often known as a heap) to store and organize their data. In practice, it can be useful to compare addresses of different heap objects, for instance, to store them in a binary search tree or a sorted array. However, comparisons of pointers to distinct objects are inherently ambiguous: The address order of two objects can be reversed in different executions of the same program, due to the nature of the allocation algorithm and other external factors. This poses a significant challenge to program verification, since a sound verifier must consider all possible behaviors of a program, including an arbitrary reordering of the heap. A naive verification of all possibilities, of course, leads to a combinatorial explosion of the state space: For this reason, we propose an under-approximating abstract domain that can be soundly refined to consider all relevant heap orderings. We have implemented the proposed abstract domain and evaluated it against several existing software verification tools on a collection of pointer-manipulating programs. In many cases, existing tools only consider a single fixed heap order, which is a source of unsoundness. We demonstrate that using our abstract domain, this unsoundness can be repaired at only a very modest performance cost. Additionally, we show that, even though many verifiers ignore it, ambiguous behavior is present in a considerable fraction of programs from software verification competition (SV-COMP).
引用
收藏
页数:27
相关论文
共 50 条
  • [1] Structuring the Verification of Heap-Manipulating Programs
    Nanevski, Aleksandar
    Vafeiadis, Viktor
    Berdine, Josh
    ACM SIGPLAN NOTICES, 2010, 45 (01) : 261 - 273
  • [2] Structuring the Verification of Heap-Manipulating Programs
    Nanevski, Aleksandar
    Vafeiadis, Viktor
    Berdine, Josh
    POPL'10: PROCEEDINGS OF THE 37TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2010, : 261 - 273
  • [3] Template-Based Verification of Heap-Manipulating Programs
    Malik, Viktor
    Hruska, Martin
    Schrammel, Peter
    Vojnar, Tomas
    PROCEEDINGS OF THE 2018 18TH CONFERENCE ON FORMAL METHODS IN COMPUTER AIDED DESIGN (FMCAD), 2018, : 103 - 111
  • [4] Verification of heap manipulating programs with ordered data by extended forest automata
    Abdulla, Parosh Aziz
    Holik, Lukas
    Jonsson, Bengt
    Lengal, Ondrej
    Cong Quy Trinh
    Vojnar, Tomas
    ACTA INFORMATICA, 2016, 53 (04) : 357 - 385
  • [5] Verification of heap manipulating programs with ordered data by extended forest automata
    Parosh Aziz Abdulla
    Lukáš Holík
    Bengt Jonsson
    Ondřej Lengál
    Cong Quy Trinh
    Tomáš Vojnar
    Acta Informatica, 2016, 53 : 357 - 385
  • [6] Hack the Heap: Heap Layout Manipulation made Easy
    Gennissen, Jordy
    O'Keeffe, Daniel
    2022 43RD IEEE SYMPOSIUM ON SECURITY AND PRIVACY WORKSHOPS (SPW 2022), 2022, : 289 - 300
  • [7] Automatic Heap Layout Manipulation for Exploitation
    Heelan, Sean
    Melham, Tom
    Kroening, Daniel
    PROCEEDINGS OF THE 27TH USENIX SECURITY SYMPOSIUM, 2018, : 763 - 779
  • [8] Compositional Verification of Heap-Manipulating Programs Through Property-Guided Learning
    Pham, Long H.
    Sun, Jun
    Quang Loc Le
    PROGRAMMING LANGUAGES AND SYSTEMS, APLAS 2019, 2019, 11893 : 405 - 424
  • [9] Forest automata for verification of heap manipulation
    Peter Habermehl
    Lukáš Holík
    Adam Rogalewicz
    Jiří Šimáček
    Tomáš Vojnar
    Formal Methods in System Design, 2012, 41 : 83 - 106
  • [10] Forest automata for verification of heap manipulation
    Habermehl, Peter
    Holik, Lukas
    Rogalewicz, Adam
    Simacek, Jiri
    Vojnar, Tomas
    FORMAL METHODS IN SYSTEM DESIGN, 2012, 41 (01) : 83 - 106