SlideShare una empresa de Scribd logo
1 de 19
Safe to the Last Instruction:Automated Verification of a Type-Safe Operating System Jean Yang MIT CSAIL ChrisHawblitzel Microsoft Research
Safe to the Last Instruction:Automated Verification of a Type-Safe Operating System Jean Yang MIT CSAIL ChrisHawblitzel Microsoft Research
3 Safe to the Last Instruction / Jean Yang
Safe to the Last Instruction / Jean Yang 4
Safe to the Last Instruction / Jean Yang Memory Safety 5
Type Safety 6 Safe to the Last Instruction / Jean Yang
Safe to the Last Instruction / Jean Yang Previously: “Safe” Systems Type-checked OS Applications File System Drivers Microkernel Untyped What currently exists Unsafe code (GC, stacks, drivers, …) Hardware 7
Safe to the Last Instruction / Jean Yang End-to-End Safe Systems Type-checked OS Applications File System Drivers Microkernel Untyped Unsafe code (GC, stacks, drivers, …) 8 What we want Verified code (GC, stacks, drivers, …) Hardware
Verve, a Type-Safe OS Type-checked Safe to the Last Instruction / Jean Yang Verify partial correctness of low-level Nucleususing Hoare logic based on a hardware spec. Verify an interface to typed assembly for end-to-end safety. Applications File System Drivers Microkernel Verified Interface specification Nucleus Hardware specification 9
The Verve Nucleus Safe to the Last Instruction / Jean Yang 10 Type-checked Applications Interface specification File System Drivers GC Heap Interrupt table Microkernel Interrupt/error handling Allocator and GC [POPL 2009] Verified Interface specification Verified Stacks Interface specification Nucleus     x86 instructions Memory bounds Devices Hardware specification
Thread Context Invariant functionStateInv (s:StackID, state:StackState, …) returns(bool) {    (!IsEmpty(state)   …&& (IsInterrupted(state)  … && (IsYielded(state)  … 	&& state == StackYielded( StackEbp(s, tMems) 		, StackEsp(s, tMems) + 4 		, StackRA(s, tMems, fMems)) && … } Safe to the Last Instruction / Jean Yang 11
“Load” Specification procedureLoad(ptr:int) returns(val:int); requiresmemAddr(ptr); requiresAligned(ptr); modifiesEip; ensuresword(val); ensuresval == Mem[ptr]; Safe to the Last Instruction / Jean Yang 12
Assembling Verve Source file Verification tool Compilation tool Verified Nucleus.bpl (x86) Boogie/Z3 Translator/ Assembler Safe to the Last Instruction / Jean Yang 13
Boogie to x86 implementationReadKeyboard(){ call KeyboardStatusIn8(); calleax := And(eax, 1); 	if (eax != 0) { goto proc; } calleax := mov(256); return; 	proc: call KeyboardDataIn8(); calleax := And(eax, 255); return; } Safe to the Last Instruction / Jean Yang ReadKeyboard proc 	in al, 064h 	andeax, 1 cmpeax, 0 jneReadKeyboard$proc moveax, 256 	ret ReadKeyboard$skip: 	in al, 060h 	and eax, 255 	ret 14
Building Verve Kernel.cs Source file Verification tool Compilation tool C# compiler Verified Nucleus.bpl (x86) Kernel.obj (x86) Boogie/Z3 TAL checker Translator/ Assembler Linker/ISO generator 15 Verve.iso  Safe to the Last Instruction / Jean Yang
Verve Performance Safe to the Last Instruction / Jean Yang 16
Low Annotation Burden Safe to the Last Instruction / Jean Yang 17 3x code 9 person-months
Verve vs. SeL4? Safe to the Last Instruction / Jean Yang Applications File System Drivers 120-240 person-months SeL4 Verified microkernel 8,700 lines of C ~600 lines ARM assembly 200,000 lines of Isabelle 18 Verve C# kernel Verified Nucleus ~1500 lines of x86 20x code
Contributions Safe to the Last Instruction / Jean Yang First automatically, mechanically verified OSfortype safety. Real system running on x86 with efficient code. Approach  for using automated techniques to verify safety. Type-checked Applications File System Drivers Microkernel Verified Interface specification Verified nucleus Hardware specification http://www.codeplex.com/singularity 19

Más contenido relacionado

La actualidad más candente

CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...CanSecWest
 
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMU
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMUSFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMU
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMULinaro
 
Vm ware fuzzing - defcon russia 20
Vm ware fuzzing  - defcon russia 20Vm ware fuzzing  - defcon russia 20
Vm ware fuzzing - defcon russia 20DefconRussia
 
Auditing the Opensource Kernels
Auditing the Opensource KernelsAuditing the Opensource Kernels
Auditing the Opensource KernelsSilvio Cesare
 
Virtual platform
Virtual platformVirtual platform
Virtual platformsean chen
 
System Hacking Tutorial #1 - Introduction to Vulnerability and Type of Vulner...
System Hacking Tutorial #1 - Introduction to Vulnerability and Type of Vulner...System Hacking Tutorial #1 - Introduction to Vulnerability and Type of Vulner...
System Hacking Tutorial #1 - Introduction to Vulnerability and Type of Vulner...sanghwan ahn
 
from Binary to Binary: How Qemu Works
from Binary to Binary: How Qemu Worksfrom Binary to Binary: How Qemu Works
from Binary to Binary: How Qemu WorksZhen Wei
 
Presentation buffer overflow attacks and theircountermeasures
Presentation buffer overflow attacks and theircountermeasuresPresentation buffer overflow attacks and theircountermeasures
Presentation buffer overflow attacks and theircountermeasurestharindunew
 
Efficient Bytecode Analysis: Linespeed Shellcode Detection
Efficient Bytecode Analysis: Linespeed Shellcode DetectionEfficient Bytecode Analysis: Linespeed Shellcode Detection
Efficient Bytecode Analysis: Linespeed Shellcode DetectionGeorg Wicherski
 
System Hacking Tutorial #2 - Buffer Overflow - Overwrite EIP
System Hacking Tutorial #2 - Buffer Overflow - Overwrite EIPSystem Hacking Tutorial #2 - Buffer Overflow - Overwrite EIP
System Hacking Tutorial #2 - Buffer Overflow - Overwrite EIPsanghwan ahn
 
Python by Martin Geisler
Python by Martin GeislerPython by Martin Geisler
Python by Martin GeislerAberla
 
Contiki introduction I.
Contiki introduction I.Contiki introduction I.
Contiki introduction I.Dingxin Xu
 
Translation Cache Policies for Dynamic Binary Translation
Translation Cache Policies for Dynamic Binary TranslationTranslation Cache Policies for Dynamic Binary Translation
Translation Cache Policies for Dynamic Binary TranslationSaber Ferjani
 
Killing any security product … using a Mimikatz undocumented feature
Killing any security product … using a Mimikatz undocumented featureKilling any security product … using a Mimikatz undocumented feature
Killing any security product … using a Mimikatz undocumented featureCyber Security Alliance
 
Follow the White Rabbit: Simplifying Fuzz Testing Using FuzzExMachina
Follow the White Rabbit: Simplifying Fuzz Testing Using FuzzExMachinaFollow the White Rabbit: Simplifying Fuzz Testing Using FuzzExMachina
Follow the White Rabbit: Simplifying Fuzz Testing Using FuzzExMachinaPriyanka Aash
 
Compromising Linux Virtual Machines with Debugging Mechanisms
Compromising Linux Virtual Machines with Debugging MechanismsCompromising Linux Virtual Machines with Debugging Mechanisms
Compromising Linux Virtual Machines with Debugging MechanismsRussell Sanford
 
LAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEELAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEELinaro
 
Fuzzing python modules
Fuzzing python modulesFuzzing python modules
Fuzzing python modulesdelimitry
 
Buffer Overflows
Buffer OverflowsBuffer Overflows
Buffer OverflowsSumit Kumar
 

La actualidad más candente (20)

CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
 
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMU
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMUSFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMU
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMU
 
Vm ware fuzzing - defcon russia 20
Vm ware fuzzing  - defcon russia 20Vm ware fuzzing  - defcon russia 20
Vm ware fuzzing - defcon russia 20
 
Auditing the Opensource Kernels
Auditing the Opensource KernelsAuditing the Opensource Kernels
Auditing the Opensource Kernels
 
Virtual platform
Virtual platformVirtual platform
Virtual platform
 
System Hacking Tutorial #1 - Introduction to Vulnerability and Type of Vulner...
System Hacking Tutorial #1 - Introduction to Vulnerability and Type of Vulner...System Hacking Tutorial #1 - Introduction to Vulnerability and Type of Vulner...
System Hacking Tutorial #1 - Introduction to Vulnerability and Type of Vulner...
 
from Binary to Binary: How Qemu Works
from Binary to Binary: How Qemu Worksfrom Binary to Binary: How Qemu Works
from Binary to Binary: How Qemu Works
 
Presentation buffer overflow attacks and theircountermeasures
Presentation buffer overflow attacks and theircountermeasuresPresentation buffer overflow attacks and theircountermeasures
Presentation buffer overflow attacks and theircountermeasures
 
Efficient Bytecode Analysis: Linespeed Shellcode Detection
Efficient Bytecode Analysis: Linespeed Shellcode DetectionEfficient Bytecode Analysis: Linespeed Shellcode Detection
Efficient Bytecode Analysis: Linespeed Shellcode Detection
 
System Hacking Tutorial #2 - Buffer Overflow - Overwrite EIP
System Hacking Tutorial #2 - Buffer Overflow - Overwrite EIPSystem Hacking Tutorial #2 - Buffer Overflow - Overwrite EIP
System Hacking Tutorial #2 - Buffer Overflow - Overwrite EIP
 
Python by Martin Geisler
Python by Martin GeislerPython by Martin Geisler
Python by Martin Geisler
 
Inside Winnyp
Inside WinnypInside Winnyp
Inside Winnyp
 
Contiki introduction I.
Contiki introduction I.Contiki introduction I.
Contiki introduction I.
 
Translation Cache Policies for Dynamic Binary Translation
Translation Cache Policies for Dynamic Binary TranslationTranslation Cache Policies for Dynamic Binary Translation
Translation Cache Policies for Dynamic Binary Translation
 
Killing any security product … using a Mimikatz undocumented feature
Killing any security product … using a Mimikatz undocumented featureKilling any security product … using a Mimikatz undocumented feature
Killing any security product … using a Mimikatz undocumented feature
 
Follow the White Rabbit: Simplifying Fuzz Testing Using FuzzExMachina
Follow the White Rabbit: Simplifying Fuzz Testing Using FuzzExMachinaFollow the White Rabbit: Simplifying Fuzz Testing Using FuzzExMachina
Follow the White Rabbit: Simplifying Fuzz Testing Using FuzzExMachina
 
Compromising Linux Virtual Machines with Debugging Mechanisms
Compromising Linux Virtual Machines with Debugging MechanismsCompromising Linux Virtual Machines with Debugging Mechanisms
Compromising Linux Virtual Machines with Debugging Mechanisms
 
LAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEELAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEE
 
Fuzzing python modules
Fuzzing python modulesFuzzing python modules
Fuzzing python modules
 
Buffer Overflows
Buffer OverflowsBuffer Overflows
Buffer Overflows
 

Similar a PLDI 2010: Safe to the Last Instruction

6. processes and threads
6. processes and threads6. processes and threads
6. processes and threadsMarian Marinov
 
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsSystem Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsashukiller7
 
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Elvin Gentiles
 
Alexander Reelsen - Seccomp for Developers
Alexander Reelsen - Seccomp for DevelopersAlexander Reelsen - Seccomp for Developers
Alexander Reelsen - Seccomp for DevelopersDevDay Dresden
 
emips_overview_apr08
emips_overview_apr08emips_overview_apr08
emips_overview_apr08Neil Pittman
 
PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012Tim Bunce
 
Much ado about randomness. What is really a random number?
Much ado about randomness. What is really a random number?Much ado about randomness. What is really a random number?
Much ado about randomness. What is really a random number?Aleksandr Yampolskiy
 
Introduction to .NET Micro Framework Development
Introduction to .NET Micro Framework DevelopmentIntroduction to .NET Micro Framework Development
Introduction to .NET Micro Framework Developmentchristopherfairbairn
 
Seminar Hacking & Security Analysis
Seminar Hacking & Security AnalysisSeminar Hacking & Security Analysis
Seminar Hacking & Security AnalysisDan H
 
EMBA - Firmware analysis DEFCON30 demolabs USA 2022
EMBA - Firmware analysis DEFCON30 demolabs USA 2022EMBA - Firmware analysis DEFCON30 demolabs USA 2022
EMBA - Firmware analysis DEFCON30 demolabs USA 2022MichaelM85042
 
[JAM 1.2] Design & Multitasking (Andrew Solovey)
[JAM 1.2] Design & Multitasking (Andrew Solovey)[JAM 1.2] Design & Multitasking (Andrew Solovey)
[JAM 1.2] Design & Multitasking (Andrew Solovey)Evgeny Kaziak
 
SANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management DatabasesSANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management DatabasesPhil Hagen
 
Fighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnitFighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnitJames Fuller
 

Similar a PLDI 2010: Safe to the Last Instruction (20)

6. processes and threads
6. processes and threads6. processes and threads
6. processes and threads
 
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsSystem Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
 
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
 
Node intro
Node introNode intro
Node intro
 
Alexander Reelsen - Seccomp for Developers
Alexander Reelsen - Seccomp for DevelopersAlexander Reelsen - Seccomp for Developers
Alexander Reelsen - Seccomp for Developers
 
What`s new in Java 7
What`s new in Java 7What`s new in Java 7
What`s new in Java 7
 
emips_overview_apr08
emips_overview_apr08emips_overview_apr08
emips_overview_apr08
 
PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012
 
Much ado about randomness. What is really a random number?
Much ado about randomness. What is really a random number?Much ado about randomness. What is really a random number?
Much ado about randomness. What is really a random number?
 
Jvm a brief introduction
Jvm  a brief introductionJvm  a brief introduction
Jvm a brief introduction
 
Introduction to .NET Micro Framework Development
Introduction to .NET Micro Framework DevelopmentIntroduction to .NET Micro Framework Development
Introduction to .NET Micro Framework Development
 
Kali kinux1
Kali kinux1Kali kinux1
Kali kinux1
 
Seminar Hacking & Security Analysis
Seminar Hacking & Security AnalysisSeminar Hacking & Security Analysis
Seminar Hacking & Security Analysis
 
EMBA - Firmware analysis DEFCON30 demolabs USA 2022
EMBA - Firmware analysis DEFCON30 demolabs USA 2022EMBA - Firmware analysis DEFCON30 demolabs USA 2022
EMBA - Firmware analysis DEFCON30 demolabs USA 2022
 
Evatronix track h
Evatronix   track hEvatronix   track h
Evatronix track h
 
System Integrity
System IntegritySystem Integrity
System Integrity
 
[JAM 1.2] Design & Multitasking (Andrew Solovey)
[JAM 1.2] Design & Multitasking (Andrew Solovey)[JAM 1.2] Design & Multitasking (Andrew Solovey)
[JAM 1.2] Design & Multitasking (Andrew Solovey)
 
Systemcall1
Systemcall1Systemcall1
Systemcall1
 
SANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management DatabasesSANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management Databases
 
Fighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnitFighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnit
 

Más de jxyz

Programming Languages for Biological Modeling
Programming Languages for Biological ModelingProgramming Languages for Biological Modeling
Programming Languages for Biological Modelingjxyz
 
PLDI 2016 Presentation on Jacqueline Web Framework
PLDI 2016 Presentation on Jacqueline Web FrameworkPLDI 2016 Presentation on Jacqueline Web Framework
PLDI 2016 Presentation on Jacqueline Web Frameworkjxyz
 
Philly ETE 2016: Securing Software by Construction
Philly ETE 2016: Securing Software by ConstructionPhilly ETE 2016: Securing Software by Construction
Philly ETE 2016: Securing Software by Constructionjxyz
 
Cybersecurity: How to Use What We Already Know
Cybersecurity: How to Use What We Already KnowCybersecurity: How to Use What We Already Know
Cybersecurity: How to Use What We Already Knowjxyz
 
Preventing Information Flow with Jeeves - Singapore Data Privacy Workshop
Preventing Information Flow with Jeeves - Singapore Data Privacy WorkshopPreventing Information Flow with Jeeves - Singapore Data Privacy Workshop
Preventing Information Flow with Jeeves - Singapore Data Privacy Workshopjxyz
 
A Brief History of Programming
A Brief History of ProgrammingA Brief History of Programming
A Brief History of Programmingjxyz
 
GigaOM Structure 10 for 2013 Short Talk
GigaOM Structure 10 for 2013 Short TalkGigaOM Structure 10 for 2013 Short Talk
GigaOM Structure 10 for 2013 Short Talkjxyz
 
Jeeves Talk Spring 2012
Jeeves Talk Spring 2012Jeeves Talk Spring 2012
Jeeves Talk Spring 2012jxyz
 

Más de jxyz (8)

Programming Languages for Biological Modeling
Programming Languages for Biological ModelingProgramming Languages for Biological Modeling
Programming Languages for Biological Modeling
 
PLDI 2016 Presentation on Jacqueline Web Framework
PLDI 2016 Presentation on Jacqueline Web FrameworkPLDI 2016 Presentation on Jacqueline Web Framework
PLDI 2016 Presentation on Jacqueline Web Framework
 
Philly ETE 2016: Securing Software by Construction
Philly ETE 2016: Securing Software by ConstructionPhilly ETE 2016: Securing Software by Construction
Philly ETE 2016: Securing Software by Construction
 
Cybersecurity: How to Use What We Already Know
Cybersecurity: How to Use What We Already KnowCybersecurity: How to Use What We Already Know
Cybersecurity: How to Use What We Already Know
 
Preventing Information Flow with Jeeves - Singapore Data Privacy Workshop
Preventing Information Flow with Jeeves - Singapore Data Privacy WorkshopPreventing Information Flow with Jeeves - Singapore Data Privacy Workshop
Preventing Information Flow with Jeeves - Singapore Data Privacy Workshop
 
A Brief History of Programming
A Brief History of ProgrammingA Brief History of Programming
A Brief History of Programming
 
GigaOM Structure 10 for 2013 Short Talk
GigaOM Structure 10 for 2013 Short TalkGigaOM Structure 10 for 2013 Short Talk
GigaOM Structure 10 for 2013 Short Talk
 
Jeeves Talk Spring 2012
Jeeves Talk Spring 2012Jeeves Talk Spring 2012
Jeeves Talk Spring 2012
 

Último

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Último (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

PLDI 2010: Safe to the Last Instruction

  • 1. Safe to the Last Instruction:Automated Verification of a Type-Safe Operating System Jean Yang MIT CSAIL ChrisHawblitzel Microsoft Research
  • 2. Safe to the Last Instruction:Automated Verification of a Type-Safe Operating System Jean Yang MIT CSAIL ChrisHawblitzel Microsoft Research
  • 3. 3 Safe to the Last Instruction / Jean Yang
  • 4. Safe to the Last Instruction / Jean Yang 4
  • 5. Safe to the Last Instruction / Jean Yang Memory Safety 5
  • 6. Type Safety 6 Safe to the Last Instruction / Jean Yang
  • 7. Safe to the Last Instruction / Jean Yang Previously: “Safe” Systems Type-checked OS Applications File System Drivers Microkernel Untyped What currently exists Unsafe code (GC, stacks, drivers, …) Hardware 7
  • 8. Safe to the Last Instruction / Jean Yang End-to-End Safe Systems Type-checked OS Applications File System Drivers Microkernel Untyped Unsafe code (GC, stacks, drivers, …) 8 What we want Verified code (GC, stacks, drivers, …) Hardware
  • 9. Verve, a Type-Safe OS Type-checked Safe to the Last Instruction / Jean Yang Verify partial correctness of low-level Nucleususing Hoare logic based on a hardware spec. Verify an interface to typed assembly for end-to-end safety. Applications File System Drivers Microkernel Verified Interface specification Nucleus Hardware specification 9
  • 10. The Verve Nucleus Safe to the Last Instruction / Jean Yang 10 Type-checked Applications Interface specification File System Drivers GC Heap Interrupt table Microkernel Interrupt/error handling Allocator and GC [POPL 2009] Verified Interface specification Verified Stacks Interface specification Nucleus x86 instructions Memory bounds Devices Hardware specification
  • 11. Thread Context Invariant functionStateInv (s:StackID, state:StackState, …) returns(bool) { (!IsEmpty(state)  …&& (IsInterrupted(state)  … && (IsYielded(state)  … && state == StackYielded( StackEbp(s, tMems) , StackEsp(s, tMems) + 4 , StackRA(s, tMems, fMems)) && … } Safe to the Last Instruction / Jean Yang 11
  • 12. “Load” Specification procedureLoad(ptr:int) returns(val:int); requiresmemAddr(ptr); requiresAligned(ptr); modifiesEip; ensuresword(val); ensuresval == Mem[ptr]; Safe to the Last Instruction / Jean Yang 12
  • 13. Assembling Verve Source file Verification tool Compilation tool Verified Nucleus.bpl (x86) Boogie/Z3 Translator/ Assembler Safe to the Last Instruction / Jean Yang 13
  • 14. Boogie to x86 implementationReadKeyboard(){ call KeyboardStatusIn8(); calleax := And(eax, 1); if (eax != 0) { goto proc; } calleax := mov(256); return; proc: call KeyboardDataIn8(); calleax := And(eax, 255); return; } Safe to the Last Instruction / Jean Yang ReadKeyboard proc in al, 064h andeax, 1 cmpeax, 0 jneReadKeyboard$proc moveax, 256 ret ReadKeyboard$skip: in al, 060h and eax, 255 ret 14
  • 15. Building Verve Kernel.cs Source file Verification tool Compilation tool C# compiler Verified Nucleus.bpl (x86) Kernel.obj (x86) Boogie/Z3 TAL checker Translator/ Assembler Linker/ISO generator 15 Verve.iso Safe to the Last Instruction / Jean Yang
  • 16. Verve Performance Safe to the Last Instruction / Jean Yang 16
  • 17. Low Annotation Burden Safe to the Last Instruction / Jean Yang 17 3x code 9 person-months
  • 18. Verve vs. SeL4? Safe to the Last Instruction / Jean Yang Applications File System Drivers 120-240 person-months SeL4 Verified microkernel 8,700 lines of C ~600 lines ARM assembly 200,000 lines of Isabelle 18 Verve C# kernel Verified Nucleus ~1500 lines of x86 20x code
  • 19. Contributions Safe to the Last Instruction / Jean Yang First automatically, mechanically verified OSfortype safety. Real system running on x86 with efficient code. Approach for using automated techniques to verify safety. Type-checked Applications File System Drivers Microkernel Verified Interface specification Verified nucleus Hardware specification http://www.codeplex.com/singularity 19

Notas del editor

  1. Safe languages give us memory safety, whichmeans that data access will not overflow memory boundaries or dereference dangling pointers.
  2. We can also get type safety, which means that all data access adheres to properties of its type.TRANSITION: What about using safe languages for end-to-end system guarantees?
  3. Projects such as Singularity and SPIN have taken the approach of writing operating systems in safe languages, with the reasoning that it is important for operating systems to be correct, but it is difficult to fully verify them because they are so large and complex.All safe languages have a runtime system, however, and this runtime system contains unsafe code.We are crossing our fingers that this code will not inappropriately access memory, but a bug here can completely subvert our typing guarantees.Make it clear what the problems are with having the unsafe code.Make it clear what we are going to verify. [Animate appear.]Make it clear only hardware instructions are part of the trusted computing base.TRANSITION: We propose a system design that can give you end-to-end guarantees of type safety.
  4. Projects such as Singularity and SPIN have taken the approach of writing operating systems in safe languages, with the reasoning that it is important for operating systems to be correct, but it is difficult to fully verify them because they are so large and complex.All safe languages have a runtime system, however, and this runtime system contains unsafe code.We are crossing our fingers that this code will not inappropriately access memory, but a bug here can completely subvert our typing guarantees.Make it clear what the problems are with having the unsafe code.Make it clear what we are going to verify. [Animate appear.]Make it clear only hardware instructions are part of the trusted computing base.TRANSITION: We propose a system design that can give you end-to-end guarantees of type safety.
  5. We present Verve, an operating system where every assembly instruction in the software stack is mechanically verified for type safety.At the core of Verve is the Nucleus, which contains the low-level functionality that cannot be expressed within the type system of our safe languageWe verify partial correctness properties of the Nucleus using Hoare logic with respect to a specification of device interfaces and assembly instructions.We hoist the rest of the system, the kernel and applications, into managed C# code we compile to typed assembly. We verify that the low-level code and the managed code interact in a type-safe manner.TRANSITION: Let us take a closer look at the Verve Nucleus..
  6. The biggest component of our Nucleus is the allocator and garbage collector. We have integrated both the copying and mark-sweep collectors that Hawblitzel and Petrank described their 2009 POPL paper.The Nucleus also describes the thread context stacks and handles context switching.The Nucleus exports access to devices such as the screen, keyboard, and timer.Additionally the Nucleus contains functionality for error and interrupt handling.The nucleus sits on top of a trusted hardware specification of absolute x86 instructions, memory bounds, and device interfaces.We verify the partial correctness of Nucleus code. For instance, we verify that we restore the appropriate observed registers when switching back to a context, that the garbage-collected heap to be well-formed, and that thread contexts are pushed onto the stack correctly when there is an interrupt.Another goal of our verification was to ensure that the low-level code interacts properly with the typed-checked code. Specifically, we verify that the low-level code does not interfere with well-formedness of the garbage-collected heap and that the managed code does not interfere with thread context memory.The rest of the data structures used by the scheduler are implemented in C#. In the type-checked kernel we have, for example, the ready queue, the GC queue, and the semaphore queues.TRANSITION: We have written Nucleus invariants in Boogie.
  7. Here we show an invariant that has the goal of describing what it means to be a well-formed thread context for the purpose of allowing us to define what it means to context switch back to an “appropriate” context.This is a Boogie function, which is mathematical function in that it express relationships between values. I have shown all functions in light green.This function takes as arguments an identifier ‘s’ specifying the context and a description “state” of the stack state. It also references global variables tMems and fMems, which are mathematical maps used to model the memory.This invariant says that state must match what we have stored in memory for the context s and that the state should adhere to certain properties depending on whether it is not empty, interrupted, or yielded.If the stack has yielded, one of the properties that should hold is that we have captured the frame pointer, the stack pointer, and the return address.TRANSITION: We use invariants such as this one to specify the partial correctness of our Nucleus code, and also to provide trusted specifications of hardware instructions and device interfaces.
  8. For instance, here is specification for the load instruction, which takes a pointer to a memory address and returns the value in memory at that location.We have the post-conditions that we have a 32-bit word and that the result matches the memory value at that location.Note that we need to ensure that the result is a word because Boogie has mathematical integers.In order to be able to call the Load instruction, we need to also satisfy the precondition that the address we have is in bounds and that it is 4-byte aligned.Our specification also declares that we modify the instruction pointer eip.Thus any procedure that calls load can use these postconditions, but they must satisfy the preconditions and cannot make any assumptions about the value of the instruction pointer afterward.TRANSITION: Our Nucleus consists of Boogie procedures using these specifications.
  9. We have defined how Boogie procedures correspond to x86 assembly instructions.We translate Nucleus procedures to x86 to run them.TRANSITION: Let us take a look at one of these procedures.
  10. Here is an example of a Nucleus procedure we verified for reading keystrokes from a keyboard.We first call an x86 input instruction to see if a keystroke is available. KeyboardStatusIn8 is the trusted interface for reading from the keyboard.We get the keyboard status in register eax and we perform a bit-wise and operation to discover the status.If no input was available, it returns. Otherwise does an input instruction to find out what key it is. [TODO: Why do we have the and here?]The functions Go() and Ret() update the global state about the location of the instruction pointer. Our translator requires a Go, which states that we modify the instruction pointer, before a conditional. The translator also requires ret, which updates the return address.It gets translated to the following assembly.Procedure calls get inlined. The conditional gets turned into a comparison and a jump if not equal.TRANSITION: We link the generated x86 with typed assembly that is generated from Bartok, and optimizing C# compiler.
  11. In additions to the Nucleus we have the kernel and applications in C#, which we compiled to typed assembly using Bartok. We check this using the Tal checker.The C# code is untrusted: we do not have to trust its correctness because any C# code that runs goes through the TAL checker.To create the bootable CD-ROM image, we translate and assembly the Nucleus and link it with the kernel.Other than the trusted specification, all other instructions in the system have been verified.TRANSITION: Now we will show that we have indeed built a real system using a scalable approach.
  12. We found that Verve running times compare favorably with other systems.Round-trip context switching takes 98 cycles and round-trip communication takes 26 cycles. We compare this to interprocess communication on the L4 and SeL4 microkernels and thread yield on monolithic operating systems.There is the caveat, however, that Verve does much less than each of these systems.TRANSITION: We are able to verify this system with low annotation overhead.
  13. We have about a thousand lines of specification, which includes definitions of assembly language instructions and device interfaces. This code sets up the environment that the code lives in rather than describing what the code should do.This is the same specification for both garbage collectors.Verification, which includes both executable statements and invariants, preconditions, post-conditions, is approximately 3x the size of the code. The annotation overhead is much lower than systems that use interactive theorem proving.This implementation took nine person-months between two people.TRANSITION: How does Verve compare to SeL4, the state of the art in microkernel verification?
  14. SeL4 verifies the L4 microkernel and presents an approach for verifying the correctness of a large body of low-level code. SeL4 consist of 8700 lines of C verified to be equivalent to a Haskell reference implementation, which is verified to satisfy properties specified in the Isabelle theorem prover. The kernel interfaces with 600 lines of trusted ARM assembly.[Compare to Verve.]The verification takes 200,000 lines of proof script in the Isabelle interactive prover, which is 30 times the size of the code. It also took the team 10-20 man-years.TRANSITION: While SeL4 presents and impressive verification achievement, we are presenting a much lighter-weight approach to verifying important system properties. Verve also verifies the whole system, relying on no lines of trusted assembly.
  15. In this talk, we have presented the first mechanically verified operating system ensuring end-to-end type safety.We have described a real system that we’ve built on top of the x86 architecture with real language features such as classes, virtual methods, arrays, and preemptive threads.The operating system is efficient: we support typed assembly code generated from C#.This whole process demonstrates that we can use automated techniques to verify systems with low-level code.It is exciting that the programming languages and verification community has gotten us to the point where we can combine well-designed languages with efficient verification tools to automatically and mechanically verify important program properties. Here’s to collaborating towards a safer future!