Presentation is loading. Please wait.

Presentation is loading. Please wait.

Code-Carrying Proofs Aytekin Vargun Rensselaer Polytechnic Institute.

Similar presentations


Presentation on theme: "Code-Carrying Proofs Aytekin Vargun Rensselaer Polytechnic Institute."— Presentation transcript:

1 Code-Carrying Proofs Aytekin Vargun Rensselaer Polytechnic Institute

2 Outline Introduction Proof-Carrying Code (PCC) Code-Carrying Proofs(CCP) Sample CCP session Future Work

3 Potential Problems to be Solved Memory Safety illegal operations or illegal access to memory Security unauthorized access to data or system resources Functional Correctness whether the code does correctly what it is formally required to do

4 Two Solutions Proof-Carrying Code (PCC) Code-Carrying Proofs (CCP)

5 Proof-Carrying Code (PCC) Developed by Necula and Lee [1996] at CMU. Basic Idea: Use machine-checkable proofs as certificates. Proof construction is harder than proof checking Code producer provides the proof Code consumer checks it

6 Code Producer Code Consumer Theorem Prover Safety Policy Native Code With Annotations Proof Checker Ok CPU VCGen Verification Condition Safety Policy Safety Proof VCGen Verification Condition Source Code Touchstone Compiler Native Code With Annotations PCC

7 Code Producer Code Consumer Theorem Prover Safety Policy Native Code With Annotations Proof Checker No CPU VCGen Verification Condition Safety Policy Safety Proof VCGen Verification Condition (may change) Source Code Touchstone Compiler Tampered Native Code With Annotations Hacker  Tampered Code is not delivered to the CPU But safety is still guaranteed if the code is modified in such a way that the VC is unchanged PCC Tampered

8 Code Producer Code Consumer Theorem Prover Safety Policy Native Code With Annotations Proof Checker No CPU VCGen Verification Condition Safety Policy Tampered Safety Proof VCGen Verification Condition Source Code Touchstone Compiler Native Code With Annotations  Proof is either invalid or  is not the proof of the VC Hacker PCC Tampered

9 Code Producer Code Consumer Theorem Prover Safety Policy Native Code With Annotations Proof Checker VCGen Verification Condition Safety Policy VCGen Verification Condition (may change) Source Code Touchstone Compiler Tampered Native Code With Annotations Hacker  Safety is guaranteed if the tampered proof is the proof of the new VC Safety Proof Hacker Tampered Safety Proof Ok CPU PCC Tampered

10 Foundational PCC Developed by Appel in [2000] at Princeton VCGen is a large program. Replace it! Basic Idea: Define the semantics of the machine instructions and safety rules Use foundational mathematical logic instead of programming-language-specific axioms or safety rules No particular type system

11 Foundational PCC Prove w.r.t. the formal machine language semantics Operates at a very low level of abstraction It does reduce dependency on a large program (VCGen) but this is true for CCP also

12 Code-Carrying Proofs (CCP) Start with axioms that define functions The form of axioms is such that it is easy to extract executable code from them. Prove that the defined functions obey certain requirements The producer transmits Axioms The correctness theorems And their proofs

13 Code-Carrying Proofs (CCP) No explicit code transmission The consumer checks proofs to see if the correctness theorem is proved If proof checking succeeds, the consumer applies the code extractor to the axioms and obtain the executable code

14 Code-Carrying Proofs (CCP) CCP attempts to solve Functional Correctness problem We are dealing with a higher-level language

15 Code Producer Code Consumer Axioms & Proofs Theorem Prover Requirements Axioms & Theorems Proof Checker CPU Axioms & Theorems Code Extractor Code CCP Requirements Axioms & Proofs

16 Code Producer Code Consumer Axioms & Proofs Tampered Axioms & Proofs Theorem Prover Requirements Axioms & Theorems Proof Checker CPU Code Extractor Hacker (Failed Proofs) (No Code) CCP Tampered

17 Issues Encoding axioms and proofs Proof Checking Tests to be applied by the consumer to new function definitions (definitional principle) Syntactic Property Consistency Termination Implementing Code Extractor

18 Athena Implemented by K.Arkoudas A language for both: Ordinary Computation Logical Deduction

19 Athena Ordinary Computation Language Provides higher-order functions Has primitive functions for Unification Matching Substitution

20 Athena Logical Language Special Deductive Forms dcheck, dbegin, assume, … Primitive Deduction Methods mp, both, left-and, … Declarations structure, declare, … Directives load-file, clear-assumption-base, …

21 Athena Advantages Better Proof Readability Machine checkable proofs Makes it possible to formulate and write proofs as methods Generic Proofs write the proof once and instantiate it to prove specific cases

22 Code Extractor Quantified Equations and Conditional Equations These are clauses of a recursive function definition CE has to be able to combine these into a recursive function

23

24

25 Code Extractor CE can extract pure functions it is not capable of extracting destructive functions Example Functions: searching functions, sum It cannot handle functions like: in-place reverse, sort

26 Code Extractor We have been working on simple functions. But: In analogy to STL, it is useful to have a library of simple functions from which more complex functions can be composed, especially if the functions are generic It is possible for code extractor to extract complex functions composed of such simple functions

27 Future Work New Definitions and Tests to be applied Defining Memory More Proof Examples Improving the Code Extractor Memory Safety Generic Proofs and Proof packaging


Download ppt "Code-Carrying Proofs Aytekin Vargun Rensselaer Polytechnic Institute."

Similar presentations


Ads by Google