Architectural Support for Copy and Tamper Resistant Software David Lie, Chandu Thekkath, Mark Mitchell, Patrick Lincoln, Dan Boneh, John Mitchell and Mark.

Slides:



Advertisements
Similar presentations
Computer-System Structures Er.Harsimran Singh
Advertisements

Vpn-info.com.
Secure In-VM Monitoring Using Hardware Virtualization Monirul Sharif, Wenke Lee, Weidong Cui, and Andrea Lanzi Presented by Tyler Bletsch.
1 Implementing an Untrusted Operating System on Trusted Hardware David Lie Chandramohan A. Thekkath Mark Horowitz University of Toronto, Microsoft Research,
1 Specifying and Verifying Hardware Support for Copy and Tamper-Resistant Software David Lie, John Mitchell, Chandramohan Thekkath and Mark Horowitz Computer.
1 Architectural Support for Copy and Tamper- Resistant Software David Lie Computer Systems Laboratory Stanford University.
Implementing an Untrusted Operating System on Trusted Hardware.
Digital Signatures and Hash Functions. Digital Signatures.
Chapter 12 CPU Structure and Function. CPU Sequence Fetch instructions Interpret instructions Fetch data Process data Write data.
Computer Organization CS224 Fall 2012 Lesson 44. Virtual Memory  Use main memory as a “cache” for secondary (disk) storage l Managed jointly by CPU hardware.
Title of Selected Paper: Design and Implementation of Secure Embedded Systems Based on Trustzone Authors: Yan-ling Xu, Wei Pan, Xin-guo Zhang Presented.
OS2-1 Chapter 2 Computer System Structures. OS2-2 Outlines Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
Towards Application Security On Untrusted OS
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Acknowledgements: William Stallings.William Stallings All rights Reserved Session 4 Public Key Cryptography (Part 2) Network Security Essentials Application.
Programming Satan’s Computer
Secure Embedded Processing through Hardware-assisted Run-time Monitoring Zubin Kumar.
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
Lecture 19 Page 1 CS 111 Online Symmetric Cryptosystems C = E(K,P) P = D(K,C) E() and D() are not necessarily the same operations.
Protection and the Kernel: Mode, Space, and Context.
Topics covered: Memory subsystem CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Architecture for Protecting Critical Secrets in Microprocessors Ruby Lee Peter Kwan Patrick McGregor Jeffrey Dwoskin Zhenghong Wang Princeton Architecture.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
CHAPTER 2: COMPUTER-SYSTEM STRUCTURES Computer system operation Computer system operation I/O structure I/O structure Storage structure Storage structure.
2: Computer-System Structures
1 Architectural Support for Copy and Tamper Resistant Software David Lie, Chandu Thekkath, Mark Mitchell, Patrick Lincoln, Dan Boneh, John Mitchell and.
Cryptography, Authentication and Digital Signatures
Hardware Assisted Control Flow Obfuscation for Embedded Processors Xiaoton Zhuang, Tao Zhang, Hsien-Hsin S. Lee, Santosh Pande HIDE: An Infrastructure.
July 30, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 8: Exploiting Memory Hierarchy: Virtual Memory * Jeremy R. Johnson Monday.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
Virtual Memory Expanding Memory Multiple Concurrent Processes.
Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection Network Structure.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
G53SEC 1 Reference Monitors Enforcement of Access Control.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
CS2100 Computer Organisation Virtual Memory – Own reading only (AY2015/6) Semester 1.
Efficient software-based fault isolation Robert Wahbe, Steven Lucco, Thomas Anderson & Susan Graham Presented by: Stelian Coros.
Creating Security using Software and Hardware Bradley Herrup CS297- Security and Programming Languages.
Virtual Memory Ch. 8 & 9 Silberschatz Operating Systems Book.
Protection of Processes Security and privacy of data is challenging currently. Protecting information – Not limited to hardware. – Depends on innovation.
Efficient Software-Based Fault Isolation Authors: Robert Wahbe Steven Lucco Thomas E. Anderson Susan L. Graham Presenter: Gregory Netland.
Lecture 5 Rootkits Hoglund/Butler (Chapters 1-3).
Fall 2006CS 395: Computer Security1 Key Management.
Virtual Memory 1 Computer Organization II © McQuain Virtual Memory Use main memory as a “cache” for secondary (disk) storage – Managed jointly.
High Performance Computing1 High Performance Computing (CS 680) Lecture 2a: Overview of High Performance Processors * Jeremy R. Johnson *This lecture was.
Architecture Support for Secure Computing Mikel Bezdek Chun Yee Yu CprE 585 Survey Project 12/10/04.
Cryptographic Hash Function. A hash function H accepts a variable-length block of data as input and produces a fixed-size hash value h = H(M). The principal.
Hardware-rooted Trust for Secure Key Management & Transient Trust
Chapter 8: Main Memory.
Chapter 1: Introduction
Computer-System Architecture
Module 2: Computer-System Structures
AEGIS: Secure Processor for Certified Execution
User-mode Secret Protection (SP) architecture
Architectural Support for OS
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Module 2: Computer-System Structures
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
Sai Krishna Deepak Maram, CS 6410
Lecture 8: Efficient Address Translation
Architectural Support for OS
CS703 - Advanced Operating Systems
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Virtual Memory Use main memory as a “cache” for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs share main.
Presentation transcript:

Architectural Support for Copy and Tamper Resistant Software David Lie, Chandu Thekkath, Mark Mitchell, Patrick Lincoln, Dan Boneh, John Mitchell and Mark Horowitz Computer Systems Laboratory Stanford University Reference:

XOM uXOM: eXecute Only Memory uProtect programs from copying and tampering Prevent software theft –Mark software for specific machine Guarantee pay-per-use –Program contains usage meter –Program sends payment to distributor –Cannot proceed until receipt is received Fraud detection in embedded apps –Cell phone id, etc. Software Distributor Customer Program XOM Compartment

Software Distribution Method DistributorCustomer Customer wishes to purchase software Customer sends public key Encrypted Code Randomly Selected Symmetric Key Program Code Encrypted Code Symmetric key is encrypted with public key Customer receives encrypted code with encrypted key Encrypt Program

Loading Secure Code Executable Code Encrypted Symmetric Key Encrypted Code Symmetric Decryption Module Decrypted Symmetric Key (Session Key) Private Key Secure Execution Engine Secure XOM Machine Insecure Main Memory XOM Key Table Asymmetric Decryption Module

A Simple XOM Machine

Two problems uMemory is insecure All sensitive program data must fit in registers Too restrictive a programming model uPrograms can’t read or write data that doesn’t belong to them But OS needs to do this when doing a context switch uUse encryption to solve both problems Same technique used to protect sensitive code

Supporting Main Memory store_secure instruction Data To Insecure Main Memory Tag Encrypt Data before storing in memory Currently executing XOM ID Check that the currently executing XOM ID matches the tag XOM Key Table

Supporting Main Memory load_secure instruction Data From Insecure Main Memory Tag Currently executing XOM ID Target register tag is set to XOM ID Decrypt Data XOM Key Table

Supporting Interrupts save_secure instruction Data To Insecure Main Memory Tag Currently executing XOM ID Look up session key based on Tag Encrypt Data XOM Key Table

Supporting Interrupts restore_secure instruction Data From Insecure Main Memory Tag Currently executing XOM ID Decrypt Data XOM Key Table Executing Program indicates which XOM ID to use Target register tag is set to XOM ID

Spoofing Attacks uSpoofing attack: Adversary tries to substitute fake ciphertext to alter behavior uTags are able to catch spoofed attacks because tag ID changes uEncryption alone is not sufficient for memory Data Adversary swaps data DataFalse Data Encrypt and store to memory Junk Decrypts to Junk but alters program behavior

Spoofing Prevention uSolution is to add an integrity hash to the encryption Message Authentication Code (MAC) Data Adversary swaps data False Data Encrypt and store to memory with added hash Hash does not match data so exception is thrown !

Splicing Attacks and Replay Attacks uSplicing Attacks Attacker moves valid data from one location to another location Add position dependent hash: –Virtual Address for secure load/stores –Register number for secure save/restores uReplay Attacks Attack records and reuses old register and memory values Add a regenerative key to Key Table that is used for save/restores Use protected registers to protect memory values

Required Hardware Micro-code or Virtual Machine for control

XOM Provides Isolation Secure XOM Machine Compartments Ownership Tags Program 2 Tag 2Data Register 2 ???Data Register 3 Program 1 Tag 1Data Register 1 Tag 2Data Register 3 Tag 1Data Register 3 Program 1 Tag 1Data Register 1 !

Performance Issues uPerformance hit is going to come from the cryptographic operations XOM start-up Instruction load path from memory Data loads and stores to and from memory Register saves and restores to and from memory uThe accesses to memory occur the most often uWe want to speed up the symmetric and hashing operations, as well as optimize access to memory

Additional Hardware uCache decrypted data Add tags to caches uSpeed up symmetric operations Add special symmetric cryptography hardware uSpeed up hash calculation Select a fast hash calculation such as 128 bit CRC

Full XOM Machine

XOM architecture Summary uImplement compartments with architectural support uTrust only the processor; assume memory, OS are insecure uUse: Data tagging on-chip Crypto off-chip uRequired hardware is modest Private Memory and Key XOM Tags on registers uAdditional hardware can be added to improve performance Symmetric hardware XOM Tags in caches

Model Checking XOM uXOM Model is a state machine: State Vector –A set of all things on the chip that can hold state –Based on the Processor Hardware Next-State Functions –A set of state transitions that the hardware can have –Derived from the instructions that can be executed on the processor Invariants –Define the correct operation of the XOM processor –Two Goals: Prevent observation and modification

XOM Processor Hardware Cache Register File XOM Tags Crypto Units Plain Text in Processor Encrypted Text in Memory Memory DataHash

Modeling XOM uDefining the state space: Hardware units are modeled as arrays of elements Number of elements is scaled down u3 Registers: u3 Cache Lines: u3 Memory Words: DataTag r i = {Data, Tag, Key, Hash} DataTag c j = {Data, Addr, Tag} Addr Tag Data m k = {Data, Hash, Key} KeyHash

XOM User Instructions InstructionDescription Register UseReading a register Register DefineWriting a register StoreStore data to memory LoadLoad data from memory

XOM Kernel Instructions uWe assume an adversarial operating system Operating system can execute user instructions and privileged kernel instructions InstructionDescription Register SaveEncrypt a user register for saving Register RestoreDecrypt a user register for restore Prefetch CacheMove data from memory into the cache Write CacheOverwrite data in the caches Flush CacheFlush a cache line into memory TrapInterrupt User Return from TrapReturn execution to User

State Transitions uState Transitions derived from instruction set User has access to user level instructions Adversary has access to kernel level instructions  Example: Store r i  m j if r i.tag = user then reset else if j is in cache then c k = {data = r i.data, addr = j, tag = r i.tag} else pick a free c c free = {data = r i.data, addr = j, tag = r i.tag}

No Observation Invariant 1.Program data cannot be read by adversary XOM machine performs tag check on every access Make sure that owner of data always matches the tag if r i.data is user data then check that: r i.tag = user else check that: r i.tag = adversary Adversary DataAdversary Tag User DataUser Tag

No Modification Invariant 2.Adversary cannot modify the program without detection Adversary may modify state by copying or moving user data Need a “ideal” correct model to check against For Memory: if xom.m i.data = user data then check that: ideal.m i.data = xom.m i.data Adversary Program XOM Model Ideal Model =

Checking for Correctness uModel checker helped us find bugs and correct them 2 old errors were found 2 new errors were found and corrected uExample: Case where it’s possible to replay a memory location This was due to the write to memory and hash of the memory location not being atomic

Memory Replay uOptimization 1: Only update hash on cache write-back On-chip cache is protected by tags PrincipalAction$MHash Program Writes A into Cache A--H =  MachineFlushes Cache--AH = h(A) ProgramWrites B into CacheBAH = h(A) AdversaryInvalidates Cache--AH = h(A) ProgramReads Memory--AH = h(A) Fix by making write and hash calculation atomic!

Reducing Complexity uFewer operations makes logic simpler uExhaustively remove actions from the next-state functions If a removed action does not result in a violation of an invariant then the action is extraneous Example: DataTag Secure Load: Tag and Data is copied from cache Tag Check: Make sure the tag matches the user DataTag CachesRegisters Register Use: Check that tag matches user Check Happens Anyways!

Liveness uA weak form of forward progress guarantee: At all times operating system or user can always execute an instruction All instructions can be executed somewhere in the state space uConstrain the operating system so that: 1.Operating system always restores user state 2.Operating system does not overwrite user data uCheck that within the state-space: 1.User is never halted due to access violation 2.User and operating system are able to execute every instruction

Conclusions uModel Checkers are an effective tool for verifying security of processors Hardware blocks define state vector Instructions define next-state functions uCan be used to verify: Tamper-resistance by checking consistency between an “ideal” model and “actual” model Minimal Complexity by checking that every action is necessary for correctness Liveness by making the adversary cooperative and showing that both are always able to execute actions