Advanced Systems Security: Symbolic Execution

Total Page:16

File Type:pdf, Size:1020Kb

Advanced Systems Security: Symbolic Execution Systems and Internet Infrastructure Security Network and Security Research Center Department of Computer Science and Engineering Pennsylvania State University, University Park PA Advanced Systems Security:! Symbolic Execution Trent Jaeger Systems and Internet Infrastructure Security (SIIS) Lab Computer Science and Engineering Department Pennsylvania State University Systems and Internet Infrastructure Security (SIIS) Laboratory Page 1 Problem • Programs have flaws ‣ Can we find (and fix) them before adversaries can reach and exploit them? • Then, they become “vulnerabilities” Systems and Internet Infrastructure Security (SIIS) Laboratory Page 2 Vulnerabilities • A program vulnerability consists of three elements: ‣ A flaw ‣ Accessible to an adversary ‣ Adversary has the capability to exploit the flaw • Which one should we focus on to find and fix vulnerabilities? ‣ Different methods are used for each Systems and Internet Infrastructure Security (SIIS) Laboratory Page 3 Is It a Flaw? • Problem: Are these flaws? ‣ Failing to check the bounds on a buffer write? ‣ printf(char *n); ‣ strcpy(char *ptr, char *user_data); ‣ gets(char *ptr) • From man page: “Never use gets().” ‣ sprintf(char *s, const char *template, ...) • From gnu.org: “Warning: The sprintf function can be dangerous because it can potentially output more characters than can fit in the allocation size of the string s.” • Should you fix all of these? Systems and Internet Infrastructure Security (SIIS) Laboratory Page 4 Is It a Flaw? • Problem: Are these flaws? ‣ open( filename, O_CREAT ); • Need O_EXCL to ensure only new file is created ‣ stat, then open • To check access/ownership before open ‣ mkdir, then chmod • Change perms after making a directory ‣ x = x + n; (all ints) • Yes, this is just addition… ‣ strncpy(filename, user_data, n), then open(filename) • Should you fix all of these? Systems and Internet Infrastructure Security (SIIS) Laboratory Page 5 Finding Flaws • Researchers have explored program analysis methods to find flaws that may lead to vulnerabilities • Dynamic analysis ‣ Dynamic program analysis is the analysis of computer software that is performed by running the program ‣ Can perform dynamic analysis easily on binaries • Static analysis ‣ Static program analysis is the analysis of computer software that is performed without running the program ‣ Generally, use the source code, but not required Systems and Internet Infrastructure Security (SIIS) Laboratory Page 6 Dynamic Analysis • Given the code, find whether the code may reach an execution state that fails an invariant ‣ Choose sequences of inputs to provide to the program • The choice of sequences can include random inputs (fuzzing) ‣ See what happens – does it violate an invariant? • Does it crash? ‣ Keep trying – must try all paths on all inputs • Not much in the way of feedback usually • Not as much theory here ‣ Can abstract conditions under which result holds Systems and Internet Infrastructure Security (SIIS) Laboratory Page 7 Dynamic Analysis – Limits • Have both access control policy and program system calls 01 /* filename = /var/mail/root */ 02 /* First, check if file already exists */ 03 fd = open (filename, flg); 04 if (fd == -1) • Inherently results in false negatives 05 /* Create the{ file */ 06 fd = open(filename, O_CREAT|O_EXCL); 07 if (fd < 0) 08 return errno;{ 09 ‣ Attacks require special conditions 10 } 11 /*} We now have a file. Make sure 12 we did not open a symlink. */ 13 struct stat fdbuf, filebuf; • Current working directory, links, … 14 if (fstat (fd, &fdbuf) == -1) 15 return errno; 16 if (lstat (filename, &filebuf) == -1) 17 return errno; • 18 /* Now check if file and fd reference the same file, Can’t run all cases… 19 file only has one link, file is plain file. */ 20 if ((fdbuf.st_dev??? != filebuf.st_dev 21 || fdbuf.st_ino != filebuf.st_ino 22 || fdbuf.st_nlink != 1 • Still, many false positives 23 || filebuf.st_nlink != 1 24 || (fdbuf.st_mode & S_IFMT) != S_IFREG)) 25 error (_("%s must be a plain file { 26 with one link"), filename); 27 close (fd); ‣ Program code might defend itself 28 return EINVAL; 29 30 /*} If we get here, all checks passed. 31 Start using the file */ • Manual audits impractical 32 read(fd, ...) ‣ In our study, only 13% of adversary- accessible name resolutions are actually vulnerable Systems and Internet Infrastructure Security (SIIS) Laboratory Page 8 Static Analysis • Given the code, find whether the code may reach an execution state that fails an invariant ‣ grep – find existence of a dangerous command • Syntactic ‣ Examine possible executions • Semantic • “Run program in aggregate” – maintain an approximation of the possible values that can reach a statement • “Run in a non-standard way” – evaluate each function separately and stitch their executions together • There is a lot of theory and experience on this! Systems and Internet Infrastructure Security (SIIS) Laboratory Page 9 Static Analysis 2 Environmental Dependencies. Most of the code is 1:void expand(char *arg, unsigned char *buffer) { 8 • “Run program in aggregate”controlled by values derived from– environmental in- 2: int i, ac; 9 put. Command line arguments determine what pro- 3: while (*arg) { 10* 4: if (*arg == ’\\’) { 11* cedures execute, input values determine which way 5: arg++; maintain an approximationif-statements trigger, and theof program depends on the 6: i = ac =0; ability to read from the file system. Since inputs can 7: if (*arg >= ’0’ && *arg <= ’7’) { be invalid (or even malicious), the code must handle 8: do { 9: ac =(ac << 3) + *arg++ − ’0’; the possible values thesethat cases gracefully. can It is not trivial to test all im- 10: i++; portant values and boundary cases. 11: } while (i<4&&*arg>=’0’ && *arg<=’7’); The code illustrates two additional common features. 12: *buffer++ = ac; 13: } else if (*arg != ’\0’) First, it has bugs, which KLEE finds and generates test reach a statement 14: *buffer++ = *arg++; cases for. Second, KLEE quickly achieves good code 15: } else if (*arg == ’[’) { 12* coverage: in two minutes it generates 37 tests that cover 16: arg++; 13 all executable statements. 2 17: i =*arg++; 14 18: if (*arg++ != ’-’) { 15! KLEE has two goals: (1) hit every line of executable 19: *buffer++ = ’[’; • “Run in a non-standardcode in the program way” and (2) detect at each– dangerous op- 20: arg −=2; eration (e.g., dereference, assertion) if any input value 21: continue; 22: } exists that could cause an error. KLEE does so by running 23: ac =*arg++; evaluate each functionprograms symbolically :unlikenormalexecution,where 24: while (i <= ac)*buffer++ = i++; operations produce concrete values from their operands, 25: arg++; /* Skip ’]’ */ here they generate constraints that exactly describe the 26: } else 27: *buffer++ = *arg++; set of values possible on a given path. When KLEE de- separately and stitch their 28: } tects an error or when a path reaches an exit call, KLEE 29: } solves the current path’s constraints (called its path con- 30: . dition)toproduceatestcasethatwillfollowthesame 31: int main(int argc, char* argv[]) { 1 executions together 32: int index =1; 2 path when rerun on an unmodified version of the checked 33: if (argc > 1&&argv[index][0] == ’-’) { 3* program (e.g, compiled with gcc). 34: . 4 KLEE is designed so that the paths followed by the 35: } 5 unmodified program will always follow the same path 36: . 6 37: expand(argv[index++], index); 7 KLEE took (i.e., there are no false positives). However, 38: . non-determinism in checked code and bugs in KLEE or 39: } its models have produced false positives in practice. The ability to rerun tests outside of KLEE,inconjunctionwith Figure 1: Code snippet from MINIX’s tr,representative standard tools such as gdb and gcov is invaluable for of the programs checked in this paper: tricky, non-obvious, diagnosing such errors and for validating our results. difficult to verify by inspection or testing. The order of the We next show how to use KLEE,thengiveanoverview statements on the path to the error at line 18 are numbered on of how it works. the right hand side. 2.1 Usage Systems and Internet Infrastructure Security (SIIS) Laboratory AusercanstartcheckingmanyrealprogramswithKLEE The first option, --max-time,tellsKLEE toPage check 10 in seconds: KLEE typically requires no source modifi- tr.bc for at most two minutes. The rest describe the cations or manual work. Users first compile their code symbolic inputs. The option --sym-args 1 10 10 to bytecode using the publicly-available LLVM com- says to use zero to three command line arguments, the 3 piler [33] for GNU C. We compiled tr using: first 1 character long, the others 10 characters long. The option --sym-files 2 2000 says to use standard llvm-gcc --emit-llvm -c tr.c -o tr.bc input and one file, each holding 2000 bytes of symbolic data. The option --max-fail 1 says to fail at most Users then run KLEE on the generated bytecode, option- one system call along each program path (see § 4.2). ally stating the number, size, and type of symbolic inputs to test the code on. For tr we used the command: 2.2 Symbolic execution with KLEE klee --max-time 2 --sym-args 1 10 10 When KLEE runs on tr,itfindsabufferoverflowerror --sym-files 2 2000 --max-fail 1 tr.bc at line 18 in Figure 1 and then produces a concrete test 2The program has one line of dead code, an unreachable return 3Since strings in C are zero terminated, this essentially generates statement, which, reassuringly, KLEE cannot run. arguments of up to that size. 3 Static Analysis – Limits • Analyze program to find potentially vulnerable
Recommended publications
  • Chopped Symbolic Execution
    Chopped Symbolic Execution David Trabish Andrea Mattavelli Noam Rinetzky Cristian Cadar Tel Aviv University Imperial College London Tel Aviv University Imperial College London Israel United Kingdom Israel United Kingdom [email protected] [email protected] [email protected] [email protected] ABSTRACT the code with symbolic values instead of concrete ones. Symbolic Symbolic execution is a powerful program analysis technique that execution engines thus replace concrete program operations with systematically explores multiple program paths. However, despite ones that manipulate symbols, and add appropriate constraints on important technical advances, symbolic execution often struggles to the symbolic values. In particular, whenever the symbolic executor reach deep parts of the code due to the well-known path explosion reaches a branch condition that depends on the symbolic inputs, it problem and constraint solving limitations. determines the feasibility of both sides of the branch, and creates In this paper, we propose chopped symbolic execution, a novel two new independent symbolic states which are added to a worklist form of symbolic execution that allows users to specify uninter- to follow each feasible side separately. This process, referred to as esting parts of the code to exclude during the analysis, thus only forking, refines the conditions on the symbolic values by adding targeting the exploration to paths of importance. However, the appropriate constraints on each path according to the conditions excluded parts are not summarily ignored, as this may lead to on the branch. Test cases are generated by finding concrete values both false positives and false negatives. Instead, they are executed for the symbolic inputs that satisfy the path conditions.
    [Show full text]
  • Opportunities and Open Problems for Static and Dynamic Program Analysis Mark Harman∗, Peter O’Hearn∗ ∗Facebook London and University College London, UK
    1 From Start-ups to Scale-ups: Opportunities and Open Problems for Static and Dynamic Program Analysis Mark Harman∗, Peter O’Hearn∗ ∗Facebook London and University College London, UK Abstract—This paper1 describes some of the challenges and research questions that target the most productive intersection opportunities when deploying static and dynamic analysis at we have yet witnessed: that between exciting, intellectually scale, drawing on the authors’ experience with the Infer and challenging science, and real-world deployment impact. Sapienz Technologies at Facebook, each of which started life as a research-led start-up that was subsequently deployed at scale, Many industrialists have perhaps tended to regard it unlikely impacting billions of people worldwide. that much academic work will prove relevant to their most The paper identifies open problems that have yet to receive pressing industrial concerns. On the other hand, it is not significant attention from the scientific community, yet which uncommon for academic and scientific researchers to believe have potential for profound real world impact, formulating these that most of the problems faced by industrialists are either as research questions that, we believe, are ripe for exploration and that would make excellent topics for research projects. boring, tedious or scientifically uninteresting. This sociological phenomenon has led to a great deal of miscommunication between the academic and industrial sectors. I. INTRODUCTION We hope that we can make a small contribution by focusing on the intersection of challenging and interesting scientific How do we transition research on static and dynamic problems with pressing industrial deployment needs. Our aim analysis techniques from the testing and verification research is to move the debate beyond relatively unhelpful observations communities to industrial practice? Many have asked this we have typically encountered in, for example, conference question, and others related to it.
    [Show full text]
  • Test Generation Using Symbolic Execution
    Test Generation Using Symbolic Execution Patrice Godefroid Microsoft Research [email protected] Abstract This paper presents a short introduction to automatic code-driven test generation using symbolic execution. It discusses some key technical challenges, solutions and milestones, but is not an exhaustive survey of this research area. 1998 ACM Subject Classification D.2.5 Testing and Debugging, D.2.4 Software/Program Veri- fication Keywords and phrases Testing, Symbolic Execution, Verification, Test Generation Digital Object Identifier 10.4230/LIPIcs.FSTTCS.2012.24 1 Automatic Code-Driven Test Generation In this paper, we discuss the problem of automatic code-driven test generation: Given a program with a known set of input parameters, automatically generate a set of input values that will exercise as many program statements as possible. Variants of this problem definition can be obtained using other code coverage criteria [48]. An optimal solution to this problem is theoretically impossible since this problem is undecidable in general (for infinite-state programs written in Turing-expressive programming languages). In practice, approximate solutions are sufficient. Although automating test generation using program analysis is an old idea (e.g., [41]), practical tools have only started to emerge during the last few years. Indeed, the expensive sophisticated program-analysis techniques required to tackle the problem, such as symbolic execution engines and constraint solvers, have only become computationally affordable in recent years thanks to the increasing computational power available on modern computers. Moreover, this steady increase in computational power has in turn enabled recent progress in the engineering of more practical software analysis techniques. Specifically, this recent progress was enabled by new advances in dynamic test generation [29], which generalizes and is more powerful than static test generation, as explained later in this paper.
    [Show full text]
  • The Art, Science, and Engineering of Fuzzing: a Survey
    1 The Art, Science, and Engineering of Fuzzing: A Survey Valentin J.M. Manes,` HyungSeok Han, Choongwoo Han, Sang Kil Cha, Manuel Egele, Edward J. Schwartz, and Maverick Woo Abstract—Among the many software vulnerability discovery techniques available today, fuzzing has remained highly popular due to its conceptual simplicity, its low barrier to deployment, and its vast amount of empirical evidence in discovering real-world software vulnerabilities. At a high level, fuzzing refers to a process of repeatedly running a program with generated inputs that may be syntactically or semantically malformed. While researchers and practitioners alike have invested a large and diverse effort towards improving fuzzing in recent years, this surge of work has also made it difficult to gain a comprehensive and coherent view of fuzzing. To help preserve and bring coherence to the vast literature of fuzzing, this paper presents a unified, general-purpose model of fuzzing together with a taxonomy of the current fuzzing literature. We methodically explore the design decisions at every stage of our model fuzzer by surveying the related literature and innovations in the art, science, and engineering that make modern-day fuzzers effective. Index Terms—software security, automated software testing, fuzzing. ✦ 1 INTRODUCTION Figure 1 on p. 5) and an increasing number of fuzzing Ever since its introduction in the early 1990s [152], fuzzing studies appear at major security conferences (e.g. [225], has remained one of the most widely-deployed techniques [52], [37], [176], [83], [239]). In addition, the blogosphere is to discover software security vulnerabilities. At a high level, filled with many success stories of fuzzing, some of which fuzzing refers to a process of repeatedly running a program also contain what we consider to be gems that warrant a with generated inputs that may be syntactically or seman- permanent place in the literature.
    [Show full text]
  • Symstra: a Framework for Generating Object-Oriented Unit Tests Using Symbolic Execution
    Symstra: A Framework for Generating Object-Oriented Unit Tests using Symbolic Execution Tao Xie1, Darko Marinov2, Wolfram Schulte3, David Notkin1 1 Dept. of Computer Science & Engineering, Univ. of Washington, Seattle, WA 98195, USA 2 Department of Computer Science, University of Illinois, Urbana-Champaign, IL 61801, USA 3 Microsoft Research, One Microsoft Way, Redmond, WA 98052, USA {taoxie,notkin}@cs.washington.edu, [email protected], [email protected] Abstract. Object-oriented unit tests consist of sequences of method invocations. Behavior of an invocation depends on the method’s arguments and the state of the receiver at the beginning of the invocation. Correspondingly, generating unit tests involves two tasks: generating method sequences that build relevant receiver- object states and generating relevant method arguments. This paper proposes Symstra, a framework that achieves both test generation tasks using symbolic execution of method sequences with symbolic arguments. The paper defines sym- bolic states of object-oriented programs and novel comparisons of states. Given a set of methods from the class under test and a bound on the length of sequences, Symstra systematically explores the object-state space of the class and prunes this exploration based on the state comparisons. Experimental results show that Symstra generates unit tests that achieve higher branch coverage faster than the existing test-generation techniques based on concrete method arguments. 1 Introduction Object-oriented unit tests are programs that test classes. Each test case consists of a fixed sequence of method invocations with fixed arguments that explores a particular aspect of the behavior of the class under test. Unit tests are becoming an important component of software development.
    [Show full text]
  • Static Program Analysis As a Fuzzing Aid
    Static Program Analysis as a Fuzzing Aid Bhargava Shastry1( ), Markus Leutner1, Tobias Fiebig1, Kashyap Thimmaraju1, Fabian Yamaguchi2, Konrad Rieck2, Stefan Schmid3, Jean-Pierre Seifert1, and Anja Feldmann1 1 TU Berlin, Berlin, Germany [email protected] 2 TU Braunschweig, Braunschweig, Germany 3 Aalborg University, Aalborg, Denmark Abstract. Fuzz testing is an effective and scalable technique to per- form software security assessments. Yet, contemporary fuzzers fall short of thoroughly testing applications with a high degree of control-flow di- versity, such as firewalls and network packet analyzers. In this paper, we demonstrate how static program analysis can guide fuzzing by aug- menting existing program models maintained by the fuzzer. Based on the insight that code patterns reflect the data format of inputs pro- cessed by a program, we automatically construct an input dictionary by statically analyzing program control and data flow. Our analysis is performed before fuzzing commences, and the input dictionary is sup- plied to an off-the-shelf fuzzer to influence input generation. Evaluations show that our technique not only increases test coverage by 10{15% over baseline fuzzers such as afl but also reduces the time required to expose vulnerabilities by up to an order of magnitude. As a case study, we have evaluated our approach on two classes of network applications: nDPI, a deep packet inspection library, and tcpdump, a network packet analyzer. Using our approach, we have uncovered 15 zero-day vulnerabilities in the evaluated software that were not found by stand-alone fuzzers. Our work not only provides a practical method to conduct security evalua- tions more effectively but also demonstrates that the synergy between program analysis and testing can be exploited for a better outcome.
    [Show full text]
  • A Randomized Dynamic Program Analysis Technique for Detecting Real Deadlocks
    A Randomized Dynamic Program Analysis Technique for Detecting Real Deadlocks Pallavi Joshi Chang-Seo Park Mayur Naik Koushik Sen Intel Research, Berkeley, USA EECS Department, UC Berkeley, USA [email protected] {pallavi,parkcs,ksen}@cs.berkeley.edu Abstract cipline followed by the parent software and this sometimes results We present a novel dynamic analysis technique that finds real dead- in deadlock bugs [17]. locks in multi-threaded programs. Our technique runs in two stages. Deadlocks are often difficult to find during the testing phase In the first stage, we use an imprecise dynamic analysis technique because they happen under very specific thread schedules. Coming to find potential deadlocks in a multi-threaded program by observ- up with these subtle thread schedules through stress testing or ing an execution of the program. In the second stage, we control random testing is often difficult. Model checking [15, 11, 7, 14, 6] a random thread scheduler to create the potential deadlocks with removes these limitations of testing by systematically exploring high probability. Unlike other dynamic analysis techniques, our ap- all thread schedules. However, model checking fails to scale for proach has the advantage that it does not give any false warnings. large multi-threaded programs due to the exponential increase in We have implemented the technique in a prototype tool for Java, the number of thread schedules with execution length. and have experimented on a number of large multi-threaded Java Several program analysis techniques, both static [19, 10, 2, 9, programs. We report a number of previously known and unknown 27, 29, 21] and dynamic [12, 13, 4, 1], have been developed to de- real deadlocks that were found in these benchmarks.
    [Show full text]
  • Learning to Accelerate Symbolic Execution Via Code Transformation
    Learning to Accelerate Symbolic Execution via Code Transformation Junjie Chen Key Laboratory of High Confidence Software Technologies (Peking University), MoE Institute of Software, EECS, Peking University, Beijing, 100871, China [email protected] Wenxiang Hu Key Laboratory of High Confidence Software Technologies (Peking University), MoE Institute of Software, EECS, Peking University, Beijing, 100871, China [email protected] Lingming Zhang Department of Computer Science, University of Texas at Dallas, 75080, USA [email protected] Dan Hao1 Key Laboratory of High Confidence Software Technologies (Peking University), MoE Institute of Software, EECS, Peking University, Beijing, 100871, China [email protected] Sarfraz Khurshid Department of Electrical and Computer Engineering, University of Texas at Austin, 78712, USA [email protected] Lu Zhang Key Laboratory of High Confidence Software Technologies (Peking University), MoE Institute of Software, EECS, Peking University, Beijing, 100871, China [email protected] Abstract Symbolic execution is an effective but expensive technique for automated test generation. Over the years, a large number of refined symbolic execution techniques have been proposed to improve its efficiency. However, the symbolic execution efficiency problem remains, and largely limits the application of symbolic execution in practice. Orthogonal to refined symbolic execution, in this paper we propose to accelerate symbolic execution through semantic-preserving code transform- ation on the target programs. During the initial stage of this direction, we adopt a particular code transformation, compiler optimization, which is initially proposed to accelerate program concrete execution by transforming the source program into another semantic-preserving tar- get program with increased efficiency (e.g., faster or smaller).
    [Show full text]
  • Formally Verifying Webassembly with Kwasm
    Formally Verifying WebAssembly with KWasm Towards an Automated Prover for Wasm Smart Contracts Master’s thesis in Computer Science and Engineering RIKARD HJORT Department of Computer Science and Engineering CHALMERS UNIVERSITY OF TECHNOLOGY UNIVERSITY OF GOTHENBURG Gothenburg, Sweden 2020 Master’s thesis 2020 Formally Verifying WebAssembly with KWasm Towards an Automated Prover for Wasm Smart Contracts RIKARD HJORT Department of Computer Science and Engineering Chalmers University of Technology University of Gothenburg Gothenburg, Sweden 2020 Formally Verifying WebAssembly with KWasm Towards an Automated Prover for Wasm Smart Contracts RIKARD HJORT © RIKARD HJORT, 2020. Supervisor: Thomas Sewell, Department of Computer Science and Engineering Examiner: Wolfgang Ahrendt, Department of Computer Science and Engineering Master’s Thesis 2020 Department of Computer Science and Engineering Chalmers University of Technology and University of Gothenburg SE-412 96 Gothenburg Telephone +46 31 772 1000 Cover: Conceptual rendering of the KWasm system, as the logos for K ans Web- Assembly merged together, with a symbolic execution proof tree protruding. The cover image is made by Bogdan Stanciu, with permission. The WebAssembly logo made by Carlos Baraza and is licensed under Creative Commons License CC0. The K logo is property of Runtime Verification, Inc., with permission. Typeset in LATEX Gothenburg, Sweden 2020 iv Formally Verifying WebAssembly with KWasm Towards an Automated Prover for Wasm Smart Contracts Rikard Hjort Department of Computer Science and Engineering Chalmers University of Technology and University of Gothenburg Abstract A smart contract is immutable, public bytecode which handles valuable assets. This makes it a prime target for formal methods. WebAssembly (Wasm) is emerging as bytecode format for smart contracts.
    [Show full text]
  • Seminar on Program Analysis ECS 289C (Programming Languages and Compilers) Winter 2015 Preliminary Reading List
    Seminar on Program Analysis ECS 289C (Programming Languages and Compilers) Winter 2015 Preliminary Reading List 1. Abstract Interpretation and Dataflow Analysis (a) Global Data Flow Analysis and Iterative Algorithms [J.ACM'76] (b) Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints [POPL'77] (c) Precise Interprocedural Dataflow Analysis via Graph Reachability [POPL'95] 2. Pointer Analysis (a) Points-to Analysis in Almost Linear Time [POPL'96] (b) Pointer Analysis: Haven't We Solved This Problem Yet? [PASTE'01] (c) The Ant and the Grasshoper: Fast and Accurate Pointer Analysis for Millions of Lines of Code [PLDI'07] 3. Program Slicing (a) Interprocedural Slicing Using Dependence Graphs [PLDI'88] (b) Dynamic Program Slicing [PLDI'90] 4. Dynamic Symbolic Execution and Test Generation (a) DART: Directed Automated Random Testing [PLDI'05] (b) CUTE: A Concolic Unit Testing Engine for C [FSE'05] (c) KLEE: Unassisted and Automatic Generation of High-Coverage Tests for Complex System Programs [OSDI'08] 5. Model Checking (a) Counterexample-Guided Abstraction Refinement [CAV'00] (b) Automatic predicate abstraction of C programs [PLDI'01] (c) Lazy Abstraction [POPL'02] 6. Concurrency (a) Learning from Mistakes: A Comprehensive Study on Real World Concurrency Bug Characteristics [ASPLOS'08] (b) Finding and Reproducing Heisenbugs in Concurrent Programs [OSDI'08] 1 (c) Life, Death, and the Critical Transition: Finding Liveness Bugs in Systems Code [NSDI'07] (d) RacerX: Effective, Static Detection of Race Conditions and Deadlocks [SOSP'03] (e) FastTrack: Efficient and Precise Dynamic Race Detection [PLDI'09] (f) A Randomized Dynamic Program Analysis Technique for Detecting Real Dead- locks [PLDI09] 7.
    [Show full text]
  • Decoupling Dynamic Program Analysis from Execution in Virtual Environments
    Decoupling dynamic program analysis from execution in virtual environments Jim Chow Tal Garfinkel Peter M. Chen VMware Abstract 40x [18, 26], rendering many production workloads un- Analyzing the behavior of running programs has a wide usable. In non-production settings, such as program de- variety of compelling applications, from intrusion detec- velopment or quality assurance, this overhead may dis- tion and prevention to bug discovery. Unfortunately, the suade use in longer, more realistic tests. Further, the per- high runtime overheads imposed by complex analysis formance perturbations introduced by these analyses can techniques makes their deployment impractical in most lead to Heisenberg effects, where the phenomena under settings. We present a virtual machine based architec- observation is changed or lost due to the measurement ture called Aftersight ameliorates this, providing a flex- itself [25]. ible and practical way to run heavyweight analyses on We describe a system called Aftersight that overcomes production workloads. these limitations via an approach called decoupled analy- Aftersight decouples analysis from normal execution sis. Decoupled analysis moves analysis off the computer by logging nondeterministic VM inputs and replaying that is executing the main workload by separating execu- them on a separate analysis platform. VM output can tion and analysis into two tasks: recording, where system be gated on the results of an analysis for intrusion pre- execution is recorded in full with minimal interference, vention or analysis can run at its own pace for intrusion and analysis, where the log of the execution is replayed detection and best effort prevention. Logs can also be and analyzed. stored for later analysis offline for bug finding or foren- Aftersight is able to record program execution effi- sics, allowing analyses that would otherwise be unusable ciently using virtual machine recording and replay [4, 9, to be applied ubiquitously.
    [Show full text]
  • Practical Concurrency Testing Or: How I Learned to Stop Worrying and Love the Exponential Explosion
    Practical Concurrency Testing or: How I Learned to Stop Worrying and Love the Exponential Explosion Ben Blum Decembruary 2018 School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 Thesis Committee: Garth Gibson, Chair David A. Eckhardt Brandon Lucia Haryadi Gunawi, University of Chicago Submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy. Copyright © 2018 Ben Blum September 20, 2018 DRAFT Keywords: landslide terminal, baggage claim, ground transportation, ticketing September 20, 2018 DRAFT For my family, my teachers, and my students. September 20, 2018 DRAFT iv September 20, 2018 DRAFT Abstract Concurrent programming presents a challenge to students and experts alike because of the complexity of multithreaded interactions and the diffi- culty to reproduce and reason about bugs. Stateless model checking is a con- currency testing approach which forces a program to interleave its threads in many different ways, checking for bugs each time. This technique is power- ful, in principle capable of finding any nondeterministic bug in finite time, but suffers from exponential explosion as program size increases. Checking an exponential number of thread interleavings is not a practical or predictable approach for programmers to find concurrency bugs before their project dead- lines. In this thesis, I develop several new techniques to make stateless model checking more practical for human use. I have built Landslide, a stateless model checker specializing in undergraduate operating systems class projects. Landslide extends the traditional model checking algorithm with a new frame- work for automatically managing multiple state spaces according to their esti- mated completion times, which I show quickly finds bugs should they exist and also quickly verifies correctness otherwise.
    [Show full text]