(A Somewhat Self-Indulgent) Splint Retrospective David Evans University of Virginia 25 October 2010.

Slides:



Advertisements
Similar presentations
Static Analysis for Security
Advertisements

Advanced programming tools at Microsoft
Challenges in increasing tool support for programming K. Rustan M. Leino Microsoft Research, Redmond, WA, USA 23 Sep 2004 ICTAC Guiyang, Guizhou, PRC joint.
The ideal of program correctness Tony Hoare CAVSeattleAugust 2006.
An Abstract Interpretation Framework for Refactoring P. Cousot, NYU, ENS, CNRS, INRIA R. Cousot, ENS, CNRS, INRIA F. Logozzo, M. Barnett, Microsoft Research.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Data-Flow Analysis Framework Domain – What kind of solution is the analysis looking for? Ex. Variables have not yet been defined – Algorithm assigns a.
SPLINT STATIC CHECKING TOOL Sripriya Subramanian 10/29/2002.
The ideal of program correctness Tony Hoare BudapestSeptember 2006.
Joel Winstead CS201j: Engineering Software University of Virginia Computer Science Lecture 16: Pointers and Memory Management.
Software Reliability Methods Sorin Lerner. Software reliability methods: issues What are the issues?
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
Statically Detecting Likely Buffer Overflow Vulnerabilities David Larochelle David Evans University of Virginia Department of Computer Science Supported.
Static Analysis for Security Amir Bazine Per Rehnberg.
CSCI 5801: Software Engineering
CS527: (Advanced) Topics in Software Engineering Overview of Software Quality Assurance Tao Xie ©D. Marinov, T. Xie.
Software Construction. Implementation System Specification Requirements Analysis Architectural Design Detailed Design Coding & Debugging Unit Testing.
Towards Scalable Modular Checking of User-defined Properties Thomas Ball, MSR Brian Hackett, Mozilla Shuvendu Lahiri, MSR Shaz Qadeer, MSR Julien Vanegue,
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
Computer Science Detecting Memory Access Errors via Illegal Write Monitoring Ongoing Research by Emre Can Sezer.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 12: Pointers continued, C strings.
Chapter 0.2 – Pointers and Memory. Type Specifiers  const  may be initialised but not used in any subsequent assignment  common and useful  volatile.
Computer Science and Software Engineering University of Wisconsin - Platteville 2. Pointer Yan Shi CS/SE2630 Lecture Notes.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
Static Program Analyses of DSP Software Systems Ramakrishnan Venkitaraman and Gopal Gupta.
COMP 111 Threads and concurrency Sept 28, Tufts University Computer Science2 Who is this guy? I am not Prof. Couch Obvious? Sam Guyer New assistant.
David Evans These slides: Introduction to Static Analysis.
David Evans CS551/651: Dependable Computing University of Virginia Computer Science Static Analysis.
Buffer Overflow Attack-proofing by Transforming Code Binary Gopal Gupta Parag Doshi, R. Reghuramalingam The University of Texas at Dallas 11/15/2004.
David Evans The Bugs and the Bees Research in Swarm Programming and Security University of Virginia.
David Evans The Bugs and the Bees Research in Programming Languages and Security University of.
Systems for Safety and Dependability David Evans University of Virginia Department of Computer Science.
Buffer Overflow Proofing of Code Binaries By Ramya Reguramalingam Graduate Student, Computer Science Advisor: Dr. Gopal Gupta.
1 Splint: A Static Memory Leakage tool Presented By: Krishna Balasubramanian.
An Undergraduate Course on Software Bug Detection Tools and Techniques Eric Larson Seattle University March 3, 2006.
A Tool for Pro-active Defense Against the Buffer Overrun Attack D. Bruschi, E. Rosti, R. Banfi Presented By: Warshavsky Alex.
Lecture 14 Page 1 CS 236 Online Variable Initialization Some languages let you declare variables without specifying their initial values And let you use.
Static/Dynamic Analysis: Past, Present and Future Verification Grand Challenge Workshop SRI Menlo Park 22 February 2005 David Evans University of Virginia.
David Evans CS201j: Engineering Software University of Virginia Computer Science Lecture 9: Designing Exceptionally.
Introduction to Software Analysis CS Why Take This Course? Learn methods to improve software quality – reliability, security, performance, etc.
It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures. Alan Perlis Lecture 15: Data Abstraction.
Refined Online Citation Matching and Adaptive Canonical Metadata Construction CSE 598B Course Project Report Huajing Li.
David Evans The Bugs and the Bees Research in Programming Languages and Security University of.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Operational Semantics (Slides mainly.
CS 440 Database Management Systems Stored procedures & OR mapping 1.
Lecture 2 Page 1 CS 236 Online Security Policies Security policies describe how a secure system should behave Policy says what should happen, not how you.
@Yuan Xue Worm Attack Yuan Xue Fall 2012.
Lecture 1 Page 1 CS 111 Summer 2013 Important OS Properties For real operating systems built and used by real people Differs depending on who you are talking.
University of Virginia Computer Science Extensible Lightweight Static Checking David Evans On the I/O.
Secure Coding Rules for C++ Copyright © 2016 Curt Hill
Static/Dynamic Analysis: Past, Present and Future
Sabrina Wilkes-Morris CSCE 548 Student Presentation
CMSC 345 Defensive Programming Practices from Software Engineering 6th Edition by Ian Sommerville.
Protecting Memory What is there to protect in memory?
Types for Programs and Proofs
Protecting Memory What is there to protect in memory?
Protecting Memory What is there to protect in memory?
Secure Software Development: Theory and Practice
Pointers and References
Improving software quality using Visual Studio 11 C++ Code Analysis
CodePeer Update Arnaud Charlet CodePeer Update Arnaud Charlet
Improving Security Using Extensible Lightweight Static Analysis
AdaCore Technologies for Cyber Security
CodePeer Update Arnaud Charlet CodePeer Update Arnaud Charlet
Program Assertions in Security
Lecture 22: Shameless Self-Promotion From (Bob Nelson)
Lecture 18: Deep C Garbage Collection CS201j: Engineering Software
Annotation-Assisted Lightweight Static Checking
White Box testing & Inspections
Outline Introduction Memory protection Buffer overflows
Presentation transcript:

(A Somewhat Self-Indulgent) Splint Retrospective David Evans University of Virginia 25 October 2010

Splint Pre-History Pre-history 1973: Steve Ziles – algebraic specification of set 1975: John Guttag’s PhD thesis: algebraic specifications for abstract datatypes 1983: Jeanette Wing’s PhD thesis: two-tiered specifications – separate program interface from underlying semantics 1993: John Guttag/Jeanette Wing seminar Larch family specification, theorem prover interface specification languages (including LCL)

Formal verifiers are too expensive and time consuming… Effort Required Low Unfathomable Formal Verifiers Bugs Detected none all Compilers

Splint offers a low-effort Alternative Effort Required Low Unfathomable Formal Verifiers Bugs Detected none all Compilers Splint

1 March 2004Static Analysis5 Security Flaws Reported flaws in Common Vulnerabilities and Exposures Database, Jan-Sep [Evans & Larochelle, IEEE Software, Jan 2002.] 190 Vulnerabilities Only 4 having to do with crypto 108 of them could have been detected with simple static analyses!

(Almost) Everyone Hates Specifications Hard to understand Lots of strange notations Don’t match what the code does Can’t even run them

(Almost) Everyone Likes Types Easy to Understand Easy to Use Quickly Detect Many Programming Errors Useful Documentation …even though they are lots of work! – 1/4 of text of typical C program is for types

One type per reference System or programmer defines checking rules Language defines checking rules State changes along program paths Type of reference never changes Attributes Types Many attributes per reference

Approach Programmers add “annotations” (formal specifications) – Simple and precise – Describe programmers intent: Types, memory management, data hiding, aliasing, modification, null-ity, buffer sizes, security, etc. Splint detects inconsistencies between annotations and code – Simple (fast!) dataflow analyses – Intraprocedural: except for annotations – Unsound and incomplete

Sample Annotation: only Reference (return value) owns storage No other persistent (non-local) references to it Implies obligation to transfer ownership Transfer ownership by: – Assigning it to an external only reference – Return it as an only result – Pass it as an only parameter: e.g., extern void free (only void *); extern only char *gptr; extern only out null void *malloc (int);

Example 1int dummy (void) { 2 int *ip= (int *) malloc (sizeof (int)); 3 *ip = 3; 4 return *ip; 5 } extern only null void *malloc (int); in library Splint output: dummy.c:3:4: Dereference of possibly null pointer ip: *ip dummy.c:2:13: Storage ip may become null dummy.c:4:14: Fresh storage ip not released before return dummy.c:2:43: Fresh storage ip allocated

Example: Buffer Overflows Most commonly exploited security vulnerability – 1988 Internet Worm – Still the most common attack Code Red exploited buffer overflow in IIS >50% of CERT advisories, 23% of CVE entries in 2001 Attributes describe sizes of allocated buffers Heuristics for analyzing loops Found several known and unknown buffer overflow vulnerabilities in wu-ftpd

Adding Data Abstraction to C Warnings if code depends on the representation of an abstract type Biggest payoff in maintainability for minimal effort typedef char *mstring;

Defining Properties to Check Many properties can be described in terms of state attributes – A file is open or closed fopen: returns an open file fclose: open  closed fgets, etc. require open files – Reading/writing – must reset between certain operations

Defining Openness attribute openness context reference FILE * oneof closed, open annotations open ==> open closed ==> closed transfers open as closed ==> error closed as open ==> error merge open + closed ==> error losereference open ==> error "file not closed" defaults reference ==> open end Cannot abandon FILE in open state Object cannot be open on one path, closed on another

Specifying I/O Functions FILE *fopen (const char *filename, const char *mode); int fclose FILE *stream) closed ; char *fgets (char *s, int n, FILE *stream);

Checking Simple dataflow analysis Intraprocedural – except uses annotations to alter state around procedure calls Integrates with other Splint analyses (e.g., nullness, aliases, ownership, etc.)

Splint Success/Failure splint.org visits (last 12 months) Academic impact: over 1000 citations (4 papers with > 200 each) Practice impact: still used, mostly in embedded software development (C) incorporated in popular Linux distributions, commercial products “Splint-inspired” tools are widely used: PREfix/PREfast, Fortify, FindBugs Failures: no slippery slope to more advanced uses of formal methods did not build a self-maintaining open source community

FindBugs Slide from Bill Pugh’s talk (2009)

Static/Dynamic Analysis: Past, Present and Future Verification Grand Challenge Workshop SRI Menlo Park 22 February 2005 David Evans University of Virginia Computer Science Original slides: with updates in orange boxes

Static/Dynamic Analysis21 The Past: Trends Lines of Source Code FL Proofs LCLint Splint “Loss of Ambition” “Faster Machines”

Static/Dynamic Analysis22 The Present Microsoft PREfix/fast, SLAM  SDV ASTRÉE (Cousot) – Airbus A380 Acquired by MathWorks, 2007 $35M in 2008 $41M in 2008 Acquired by IBM, 2009

Static/Dynamic Analysis23 The Present Static Analysis: good at checking generic requirements (types, buffer overflows, …) Dynamic Analysis: good at checking assertions inserted by programmer Bad at knowing what properties to check – Automatic inference techniques – Grand Challenge Repository No good techniques for combining static and dynamic analyses A few since 2005! Concolic Testing [Sen et al., 2007], SAGE (MSR) A few since 2005! Concolic Testing [Sen et al., 2007], SAGE (MSR)

The Future: Predictions for Software vendor will lose a major lawsuit because of a program bug 2.Someone will come up with a cool name like “VerXifiedProgramming” and sell a lot of books on program verification 3.No more buffer overflows in major commercial software – Brian Snow at 20 th Oakland conference (1999) predicted we will still be talking about buffer overflows in 2019 Static/Dynamic Analysis24 Has this happened? Still waiting…but 5 years left! SANS list 2010: Buffer overflows are still #3 but…not in OWASP top ten SANS list 2010: Buffer overflows are still #3 but…not in OWASP top ten

Static/Dynamic Analysis25 Predictions for Standard compilers prevent most concurrency problems 5.Programmers will still make dumb mistakes and resist change 6.“Good” CS degree programs will: – Incorporate verification into their first course – Include a course on identifying and checking program properties Still a long way off…but lots of work going on

Static/Dynamic Analysis26 Making Predictions Never make predictions, especially about the future. – Casey Stengel The best way to predict the future is to invent it. – Alan Kay, 1971 Our plan and our hope was that the next generation of kids would come along and do something better than Smalltalk around 1984 or so… But a variety of different things conspired together, and that next generation actually didn’t show up. – Alan Kay, 2005