![Page 1: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/1.jpg)
Typed Assembly Language and Proof-Carrying Code
Nicholas MooreBianca Curutan
Pooya SamizadehMcMaster UniversityMarch 30, 2012
![Page 2: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/2.jpg)
Part I:Typed Assembly Language
IntroductionTAL and PCCTAL-0 Real World Application
![Page 3: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/3.jpg)
Typed Assembly Language (TAL) extends traditional untyped assembly languages with typing annotations, memory management primitives, and a sound set of typing rules
These typing rules guarantee the memory safety, control flow safety, and type safety of TAL programs
Introduction
![Page 4: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/4.jpg)
Principle of Proof-Carrying Code (PCC): Eliminate the need to trust code by requiring a formal, machine-checkable proof that the code has some desired properties
1. What properties should we require of the code?
2. How do code producers construct a formal proof that their code has the desired properties?
TAL and PCC
![Page 5: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/5.jpg)
Control-flow Safety: Ensure that a program jumps only to a well-defined subset of possible entry points
A focus on control-flow safety allows us to develop a simple abstract machine and demonstrate the key ideas of adapting a type system to machine code
TAL-0
![Page 6: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/6.jpg)
Instructions and Operands
TAL-0 (cont’d)
![Page 7: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/7.jpg)
Abstract Machine Syntax
TAL-0 (cont’d)
![Page 8: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/8.jpg)
Limitations:◦Only supports simple tuple or record-like data
structures◦ Insufficient for compiling real-world high-level
languages which provide data abstraction mechanisms
◦Can only allocate objects whose size is known at compile time
Real World Application
![Page 9: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/9.jpg)
Examples to make type system more useful:◦Annotate primitive memory type components
with flags to control whether that component supports read-only, write-only, or read-write access
◦Add support for subtyping◦Consider a read-write component to be a
subtype of a read-only or a write-only component
Real World Application (cont’d)
![Page 10: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/10.jpg)
Part II:Proof-Carrying Code
IntroductionTouchstone PCC ArchitectureAdvantages Over Related TechniquesTechnical Difficulties to Overcome
![Page 11: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/11.jpg)
Proof-Carrying Code (PCC): General framework that allows the host to verify properties about an agent via a formal proof that accompanies the executable code
The host system can quickly verify the validity of the proof and compare the conclusions to its own security policy to determine if the agent has certain safety properties
Introduction
![Page 12: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/12.jpg)
Touchstone PCC Architecture
![Page 13: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/13.jpg)
1. Operates at load time before the agent code is installed in the host system
2. Trusted computing base is small3. Can operate even on agents expressed in
native-code form4. General – all PCC has to do is verify safety
explanations and match them with the code and safety policy
Advantages Over Related Techniques
![Page 14: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/14.jpg)
How to encode the formal proof?
How to check the proof?
How to relate the proof with the program?
Technical Difficulties to Overcome
![Page 15: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/15.jpg)
Part III:Project
IntroductionRecall TAL-0Description and Demo
![Page 16: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/16.jpg)
Task◦Build an interpreter for the TAL-0 abstract
machine in Haskell, i.e., (lazy) functional programming language
Introduction
![Page 17: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/17.jpg)
Instructions and Operands
Abstract Machine Syntax
Recall TAL-0
![Page 18: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/18.jpg)
Description and Demo
![Page 19: Typed Assembly Language and Proof-Carrying Code](https://reader035.vdocuments.site/reader035/viewer/2022081507/568161b4550346895dd17eda/html5/thumbnails/19.jpg)
Jones, Mark. Functional Programming with Overloading and Higher-Order Polymorphism. Diss. University of Nottingham. Nottingham. Print.
Liang, Sheng, Paul Hudak, and Mark Jones. Monad Transformers and Modular Interpreters. Diss. Yale University. New Haven. Print.
Necula, George. "Proof-Carrying Code." Computer Science Division, EECS at UC Berkeley. 22 July 2002. Web. 21 Mar. 2012. <http://www.cs.berkeley.edu/~necula/pcc.html>.
Pierce, Benjamin C. Advanced Topics in Types and Programming Languages. Cambridge, MA: MIT, 2005. Print.
"Typed Assembly Language Compiler." Cornell University Department of Computer Science. Web. 21 Mar. 2012. <http://www.cs.cornell.edu/talc/>.
References