/191 Typed Compilation of Objects Andrew McCreight and Zhong Shao FLINT Project Yale University.

Slides:



Advertisements
Similar presentations
A Translation from Typed Assembly Language to Certified Assembly Programming Zhong Shao Yale University Joint work with Zhaozhong Ni Paper URL:
Advertisements

Auto-Generation of Test Cases for Infinite States Reactive Systems Based on Symbolic Execution and Formula Rewriting Donghuo Chen School of Computer Science.
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
Static and User-Extensible Proof Checking Antonis StampoulisZhong Shao Yale University POPL 2012.
A little bit on Class-Based OO Languages CS153: Compilers Greg Morrisett.
Type Analysis and Typed Compilation Stephanie Weirich Cornell University.
Comparing Semantic and Syntactic Methods in Mechanized Proof Frameworks C.J. Bell, Robert Dockins, Aquinas Hobor, Andrew W. Appel, David Walker 1.
Certified Typechecking in Foundational Certified Code Systems Susmit Sarkar Carnegie Mellon University.
Programming Paradigms and languages
March 4, 2005Susmit Sarkar 1 A Cost-Effective Foundational Certified Code System Susmit Sarkar Thesis Proposal.
Ensuring Operating System Kernel Integrity with OSck By Owen S. Hofmann Alan M. Dunn Sangman Kim Indrajit Roy Emmett Witchel Kent State University College.
Dynamic Typing COS 441 Princeton University Fall 2004.
Lightweight Abstraction for Mathematical Computation in Java 1 Pavel Bourdykine and Stephen M. Watt Department of Computer Science Western University London.
VeriML: Revisiting the Foundations of Proof Assistants Zhong Shao Yale University MacQueen Fest May 13, 2012 (Joint work with Antonis Stampoulis)
The Design and Implementation of a Certifying Compiler [Necula, Lee] A Certifying Compiler for Java [Necula, Lee et al] David W. Hill CSCI
Code-Carrying Proofs Aytekin Vargun Rensselaer Polytechnic Institute.
Ross Tate, Juan Chen, Chris Hawblitzel. Typed Assembly Languages Compilers are great but they make mistakes and can introduce vulnerabilities Typed assembly.
Extensible Verification of Untrusted Code Bor-Yuh Evan Chang, Adam Chlipala, Kun Gao, George Necula, and Robert Schneck May 14, 2004 OSQ Retreat Santa.
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
Building Reliable Software Requirements and Methods.
1 Enforcing Confidentiality in Low-level Programs Andrew Myers Cornell University.
Proofs, Types, and Safe Mobile Code CoS 598E David Walker.
Programmability with Proof-Carrying Code George C. Necula University of California Berkeley Peter Lee Carnegie Mellon University.
Reasons to study concepts of PL
Type Checking in Cool Alex Aiken (Modified by Mooly Sagiv)
Software Reliability Methods Sorin Lerner. Software reliability methods: issues What are the issues?
A Type System for Expressive Security Policies David Walker Cornell University.
1 A Short Introduction to (Object-Oriented) Type Systems Kris De Volder.
1/25 Pointer Logic Changki PSWLAB Pointer Logic Daniel Kroening and Ofer Strichman Decision Procedure.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
The Impact of Programming Language Theory on Computer Security Drew Dean Computer Science Laboratory SRI International.
Secure Virtual Architecture John Criswell, Arushi Aggarwal, Andrew Lenharth, Dinakar Dhurjati, and Vikram Adve University of Illinois at Urbana-Champaign.
JIT in webkit. What’s JIT See time_compilation for more info. time_compilation.
Types for Programs and Proofs Lecture 1. What are types? int, float, char, …, arrays types of procedures, functions, references, records, objects,...
Adapted from Prof. Necula UCB CS 1641 Overview of COOL ICOM 4029 Lecture 2 ICOM 4029 Fall 2008.
Containment and Integrity for Mobile Code Security policies as types Andrew Myers Fred Schneider Department of Computer Science Cornell University.
Proof Carrying Code Zhiwei Lin. Outline Proof-Carrying Code The Design and Implementation of a Certifying Compiler A Proof – Carrying Code Architecture.
Chapter 25 Formal Methods Formal methods Specify program using math Develop program using math Prove program matches specification using.
OOP and Dynamic Method Binding Chapter 9. Object Oriented Programming Skipping most of this chapter Focus on 9.4, Dynamic method binding – Polymorphism.
© Andrew IrelandDependable Systems Group On the Scalability of Proof Carrying Code for Software Certification Andrew Ireland School of Mathematical & Computer.
A Certifying Compiler and Pointer Logic Zhaopeng Li Software Security Lab. Department of Computer Science and Technology, University of Science and Technology.
Writing Systems Software in a Functional Language An Experience Report Iavor Diatchki, Thomas Hallgren, Mark Jones, Rebekah Leslie, Andrew Tolmach.
The Fail-Safe C to Java translator Yuhki Kamijima (Tohoku Univ.)
Types in programming languages1 What are types, and why do we need them?
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Overview of Compilers and JikesRVM John.
Compiling Objects in Class-Based Languages CS 153: Compilers.
Secure Compiler Seminar 4/11 Visions toward a Secure Compiler Toshihiro YOSHINO (D1, Yonezawa Lab.)
Fortress Aaron Becker Abhinav Bhatele Hassan Jafri 2 May 2006.
Introduction Program File Authorization Security Theorem Active Code Authorization Authorization Logic Implementation considerations Conclusion.
SAFE KERNEL EXTENSIONS WITHOUT RUN-TIME CHECKING George C. Necula Peter Lee Carnegie Mellon U.
CMSC 330: Organization of Programming Languages Operational Semantics.
Prof. Necula CS 164 Lecture 171 Operational Semantics of Cool ICOM 4029 Lecture 10.
CSCE 343 – Programming Language Concepts Welcome!.
1 Interactive Computer Theorem Proving CS294-9 October 19, 2006 Adam Chlipala UC Berkeley Lecture 9: Beyond Primitive Recursion.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Automatic Memory Management Without Run-time Overhead Brian Brooks.
The heavyweight parts of lightweight languages LL1 Workshop November 17, 2001.
The architecture of the P416 compiler
Types for Programs and Proofs
The heavyweight parts of lightweight languages
State your reasons or how to keep proofs while optimizing code
Interfaces and Inheritance
CSE401 Introduction to Compiler Construction
A Trustworthy Proof Checker
Types and Type Checking (What is it good for?)
The Design & Implementation of Hyperupcalls
ICOM 4029 Fall 2003 Lecture 2 (Adapted from Prof. Necula UCB CS 164)
Reasons To Study Programming Languages
Drew Wyborski Programming Languages
Abstract Types Defined as Classes of Variables
Presentation transcript:

/191 Typed Compilation of Objects Andrew McCreight and Zhong Shao FLINT Project Yale University

/192 Background Modern OO systems like ROTOR are big Error in runtime can be safety problem Safety problem can be security problem Want to minimize Trusted Computing Base (TCB) Can we avoid trusting, say, the compiler? What about the type tests? GC?

/193 Outline Typed compilation Lightweight object types OO in machine level Hoare Logic

/194 Standard managed runtime bytecode +types checker binaryruntime compiler CPU TRUSTEDUNTRUSTED

/195 PCC/TAL bytecode +types checker binary +types runtime compiler CPU TRUSTED UNTRUSTED

/196 Typed Compilation Have to get compiler to emit types Types for machine level objects Don’t want to change compiler a lot Don’t want to learn fancy type theory Solution: a lightweight type system

/197 Lightweight type system Must be sound  Passes type check: memory safe (no crashes) Minimize number of type annotations  Complicates optimizations Match abstraction level of program  Objects, vtables, methods

/198 Lightweight types for objects Explicit self application is dangerous  Must track source of each VMT Object types: C, classOf(x) VMT types: vmt(C), vmt(classOf(x)) Method types: (classOf(x), C, D)  E

/199 Example (untyped) // Assume class C has method m // where m takes one argument of type D Object example(C a, C b, D c) { y := a.vmt; z := y.m; return (z(a, c)); } Must only let a be used for self argument

/1910 Example (explicitly typed) // Assume class C has method m // where m takes one argument of type D Object example(C a, C b, D c) { y : vmt(classOf(a)) := a.vmt; z : (classOf(a), D)  Object := y.m; return (z(a, c)); } b does not have type classOf(a)

/1911 Example (typed) // We can easily reconstruct local var types. Object example(C a, C b, D c) { y := a.vmt; z := y.m; return (z(a, c)); } Method body is same as in untyped version!

/1912 Lightweight types We have a sound type system for objects  Formal system, soundness proof in TR At the machine level Without annotations in method bodies

/1913 Limitations Not very expressive How to reason about optimizations? How to reason about runtime?  Chen and Tarditi’s type system Can reason about downcast implementation While retaining lightweight types (though not as lightweight as ours)  But what about, say, GC?  We take another approach

/1914 FPCC bytecode checker binary +types runtime +proof compiler CPU TRUSTED UNTRUSTED

/1915 Hoare logic for objects Don’t extend type system for downcast implementation How to reason about, say, Cheney GC with types? It gets messy. Don’t want to pollute our compiler Give up on types for checking runtime Use Hoare logic: very expressive Can interface types with HL

/1916 Turn types into propositions “there’s an object of type C at address h if h contains the VTB of C, and h+1,…,h+k contain values having the same types as the k fields of C” Object layout laid bare Allows flexible reasoning Have verified impl. of dynamic type check Target for Spec#?

/1917 Future work Close gap between simple OO type system and HL OO type system Make OO type system expressive enough to handle results of optimizations Support more of CIL Verify type safety of a GC Typed compilation of Spec#?

/1918 Conclusion Less trust = more reliable Sound typing for low level objects No annotations or type machinery needed in method body in our type system Use Hoare logic to reason about runtime services Gives us strengths of both approaches

/1919 Questions?