Modular verification of assembly code with stack-based control abstractions

被引:4
|
作者
Feng, Xinyu [1 ]
Shao, Zhong [1 ]
Vaynberg, Alexander [1 ]
Xiang, Sen [2 ]
Ni, Zhaozhong [1 ]
机构
[1] Yale Univ, Dept Comp Sci, New Haven, CT 06520 USA
[2] Univ Sci & Technol China, Dept Comp Sci & Technol, Anhua 230026, Peoples R China
关键词
assembly code verification; modularity; stack-based control abstractions; proof-carrying code;
D O I
10.1145/1133255.1134028
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Runtime stacks are critical components of any modern software they are used to implement powerful control structures such as function call/return, stack cutting and unwinding, coroutines, and thread context switch. Stack operations, however, are very hard to reason about: there are no known formal specifications for certifying C-style setjmp/longjmp, stack cutting and unwinding, or weak continuations ( in C--). In many proof-carrying code (PCC) systems, return code pointers and exception handlers are treated as general first-class functions ( as in continuation-passing style) even though both should have more limited scopes. In this paper we show that stack-based control abstractions follow a much simpler pattern than general first-class code pointers. We present a simple but flexible Hoare-style framework for modular verification of assembly code with all kinds of stackbased control abstractions, including function call/return, tail call, setjmp/longjmp, weak continuation, stack cutting, stack unwinding, multi-return function call, coroutines, and thread context switch. Instead of presenting a specific logic for each control structure, we develop all reasoning systems as instances of a generic framework. This allows program modules and their proofs developed in different PCC systems to be linked together. Our system is fully mechanized. We give the complete soundness proof and a full verification of several examples in the Coq proof assistant.
引用
收藏
页码:401 / 414
页数:14
相关论文
共 50 条
  • [1] Stack-based typed assembly language
    Morrisett, G
    Crary, K
    Glew, N
    Walker, D
    [J]. JOURNAL OF FUNCTIONAL PROGRAMMING, 2002, 12 : 43 - 88
  • [2] Stack-based typed assembly language
    Morrisett, Greg
    Crary, Karl
    Glew, Neal
    Walker, David
    [J]. Journal of Functional Programming, 2002, 12 (01) : 43 - 88
  • [3] Type Systems for Optimizing Stack-based Code
    Saabas, Ando
    Uustalu, Tarmo
    [J]. ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2007, 190 (01) : 103 - 119
  • [4] Stack-based access control and secure information flow
    Banerjee, A
    Naumann, DA
    [J]. JOURNAL OF FUNCTIONAL PROGRAMMING, 2005, 15 : 131 - 177
  • [5] Type annotations to improve stack-based access control
    Zhao, T
    Boyland, J
    [J]. 18TH IEEE COMPUTER SECURITY FOUNDATIONS WORKSHOP, PROCEEDINGS, 2005, : 197 - 210
  • [6] Stack-based Music Recommendation
    Zhao, Yong-hua
    [J]. INTERNATIONAL CONFERENCE ON ADVANCED COMPUTER SCIENCE AND ENGINEERING (ACSE 2014), 2014, : 290 - 294
  • [7] STACK-BASED SORTING ALGORITHMS
    AMMAR, RA
    [J]. JOURNAL OF SYSTEMS AND SOFTWARE, 1989, 9 (03) : 225 - 239
  • [8] STACK-BASED SCHEDULING OF REALTIME PROCESSES
    BAKER, TP
    [J]. REAL-TIME SYSTEMS, 1991, 3 (01) : 67 - 99
  • [9] An abstract semantics tool for secure information flow of stack-based assembly programs
    Bernardeschi, C
    De Francesco, N
    Lettieri, G
    [J]. MICROPROCESSORS AND MICROSYSTEMS, 2002, 26 (08) : 391 - 398
  • [10] Cat: A functional stack-based language - An intermediate language for program verification, optimization, and more!
    Diggins, Christopher
    [J]. DR DOBBS JOURNAL, 2008, 33 (05): : 22 - +