1 Architectural Support for Copy and Tamper- Resistant Software David Lie Computer Systems Laboratory Stanford University.

Slides:



Advertisements
Similar presentations
Secure In-VM Monitoring Using Hardware Virtualization Monirul Sharif, Wenke Lee, Weidong Cui, and Andrea Lanzi Presented by Tyler Bletsch.
Advertisements

Ensuring Operating System Kernel Integrity with OSck By Owen S. Hofmann Alan M. Dunn Sangman Kim Indrajit Roy Emmett Witchel Kent State University College.
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.
Implementing an Untrusted Operating System on Trusted Hardware.
Lecture 19 Page 1 CS 111 Online Protecting Operating Systems Resources How do we use these various tools to protect actual OS resources? Memory? Files?
Digital Signatures and Hash Functions. Digital Signatures.
May 7, A Real Problem  What if you wanted to run a program that needs more memory than you have?
Information Security 1 Information Security: Security Tools Jeffy Mwakalinga.
1 A Real Problem  What if you wanted to run a program that needs more memory than you have?
Secure web browsers, malicious hardware, and hardware support for binary translation Sam King.
1 Future Technologies Group Shane Canon, canon at nersc dot govSummer Linux Kernel Class Root Kit Protection and Detection Shane Canon October
19.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 19: Security The Security Problem Authentication Program Threats.
Memory Management (II)
Security Internet Management & Security 06 Learning outcomes At the end of this session, you should be able to: –Describe the reasons for having system.
Translation Buffers (TLB’s)
Security Internet Management & Security 06 Learning outcomes At the end of this session, you should be able to: –Describe the reasons for having system.
Towards Application Security On Untrusted OS
Overview of Cryptography and Its Applications Dr. Monther Aldwairi New York Institute of Technology- Amman Campus INCS741: Cryptography.
Architectural Support for Copy and Tamper Resistant Software David Lie, Chandu Thekkath, Mark Mitchell, Patrick Lincoln, Dan Boneh, John Mitchell and Mark.
1 RAKSHA: A FLEXIBLE ARCHITECTURE FOR SOFTWARE SECURITY Computer Systems Laboratory Stanford University Hari Kannan, Michael Dalton, Christos Kozyrakis.
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
Alexander Potapov.  Authentication definition  Protocol architectures  Cryptographic properties  Freshness  Types of attack on protocols  Two-way.
1 Introduction to Security and Cryptology Enterprise Systems DT211 Denis Manley.
Computer Security Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
Secure Embedded Processing through Hardware-assisted Run-time Monitoring Zubin Kumar.
Trusted Computing BY: Sam Ranjbari Billy J. Garcia.
G53SEC 1 Reference Monitors Enforcement of Access Control.
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.
1 Architectural Support for Copy and Tamper Resistant Software David Lie, Chandu Thekkath, Mark Mitchell, Patrick Lincoln, Dan Boneh, John Mitchell and.
Trusted Computing Or How I Learned to Stop Worrying and Love the MPAA.
Cryptography, Authentication and Digital Signatures
Certificate-Based Operations. Module Objectives By the end of this module participants will be able to: Define how cryptography is used to secure information.
July 30, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 8: Exploiting Memory Hierarchy: Virtual Memory * Jeremy R. Johnson Monday.
Chapter 14 Part II: Architectural Adaptation BY: AARON MCKAY.
Strong Security for Distributed File Systems Group A3 Ka Hou Wong Jahanzeb Faizan Jonathan Sippel.
Computer Studies (AL) Memory Management Virtual Memory I.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
G53SEC 1 Reference Monitors Enforcement of Access Control.
1 Some Real Problem  What if a program needs more memory than the machine has? —even if individual programs fit in memory, how can we run multiple programs?
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
Operating Systems Security
Processes and Virtual Memory
Attribute-Based Encryption With Verifiable Outsourced Decryption.
Efficient software-based fault isolation Robert Wahbe, Steven Lucco, Thomas Anderson & Susan Graham Presented by: Stelian Coros.
Implementing Precise Interrupts in Pipelined Processors James E. Smith Andrew R.Pleszkun Presented By: Shrikant G.
Exploiting Instruction Streams To Prevent Intrusion Milena Milenkovic.
Creating Security using Software and Hardware Bradley Herrup CS297- Security and Programming Languages.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
Tamper Resistant Software: An Implementation By David Aucsmith, IAL In Information Hiding Workshop, RJ Anderson (ed), LNCS, 1174, pp , “Integrity.
TRUSTED FLOW: Why, How and Where??? Moti Yung Columbia University.
LECTURE 12 Virtual Memory. VIRTUAL MEMORY Just as a cache can provide fast, easy access to recently-used code and data, main memory acts as a “cache”
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Information Systems Design and Development Security Precautions Computing Science.
Computer Security By Rubel Biswas. Introduction History Terms & Definitions Symmetric and Asymmetric Attacks on Cryptosystems Outline.
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.
Web Applications Security Cryptography 1
Hardware-rooted Trust for Secure Key Management & Transient Trust
Trusted Computing and the Trusted Platform Module
e-Health Platform End 2 End encryption
Outline What does the OS protect? Authentication for operating systems
Outline What does the OS protect? Authentication for operating systems
AEGIS: Secure Processor for Certified Execution
User-mode Secret Protection (SP) architecture
Translation Buffers (TLB’s)
Outline Using cryptography in networks IPSec SSL and TLS.
ONLINE SECURE DATA SERVICE
Presentation transcript:

1 Architectural Support for Copy and Tamper- Resistant Software David Lie Computer Systems Laboratory Stanford University

2 Resistance is not Futile Tamper-Resistant software can be used to –Prevent Software Piracy –Protect Intellectual Property –Prevent tampering by Viruses, Hackers –Can ensure that program performs certain actions Other initiatives starting: –Trusted Computing Platform Alliance (TCPA) –Microsoft Next-Generation Secure Computing Base (Palladium) –Intel LaGrande

3 Why Tamper-Resistance? Example: Electronic Online Voting Voting Client Voting Client Operating System Vote Counter InternetUser Operating System No! Voting Client Yes!

4 XOM Our solution: eXecute Only Memory or “XOM” –Programs in this memory can only be executed, they cannot be read or modified –Program authentication –Hide secrets in the program XOM combines cryptographic and architectural techniques –Access Control tags are fast but not necessarily secure Only used on the trusted hardware of the processor –Cryptography is slow but offers more guarantees Used to protect data that has to be stored off the processor XOM defends against attacks on memory

5 Compartments Compartments control access to data –Prevent adversary from reading data or code –Prevent adversary from modifying data or code Compartments provide a way of thinking about how data is handled Program XOM Compartment

6 Where to Implement Compartments User Level security is hard –Relies on software obfuscation –Barak et. al. CRYPTO 2001 Operating system can’t be trusted –OS can be open source –OS can be hacked or hijacked Hardware has some good security properties –Hardware is hard to observe –Hardware is difficult to alter Hardware Registers, Caches, Memory Operating System Kernel, Shared Libraries Application User Code

7 How to Implement Compartments Each compartment has a XOM ID –Programs are assigned a XOM ID, which indicates what compartment they are in –Data from their operations is tagged with their XOM ID –On-chip storage for data and tags is immutable Off-chip storage, memory and disk are insecure –Cannot by protected by tags –Cryptographic ciphers and hashes are used

8 Crypto Review Symmetric Ciphers (Rijndael, 3DES) –Single key used for encryption and decryption –Pretty fast when implemented in hardware How do we securely distribute the keys? Secret Key Plain TextCipher TextPlain Text Secret Key Sender (Alice)Receiver (Bob)

9 Crypto Review Asymmetric Ciphers or public-key ciphers (RSA, El Gamal) –Pairs of keys –Public key and is used to encrypt data –Private key and is used to decrypt data Public-key ciphers are very slow –Typically use hybrid systems with both ciphers together Private KeyPublic Key Plain TextCipher TextPlain Text Sender (Alice)Receiver (Bob)

10 Outline 1.Introduction 2.XOM Hardware i.Distributing and Loading Code ii.Executing Code iii.Supporting Memory iv.Hardware Simulator 3.Operating System Support 4.Attack Models 5.Conclusion

11 Computer Hardware L2 Cache L1 Instruction Cache L1 Data Cache Register File Data Path Fetch and Decode Key Table Private Key Bus to Memory

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

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

14 Supporting Execution L2 Cache L1 Instruction Cache L1 Data Cache Register File Data Path Fetch and Decode Key Table Private Key XOM Tags Bus to Memory

15 Secure Execution Engine 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 !

16 How to Share Data Compartments are too restrictive, programs cannot share data Have a special compartment with a XOM ID of zero called the “null” compartment –Data in this compartment is not protected by any mechanism Special instructions provided for owners to move data to and from null compartment –Only owner can move to and from null compartment

17 Supporting Memory L2 Cache L1 Instruction Cache L1 Data Cache Register File Data Path Fetch and Decode Key Table Private Key XOM Tags Crypto Units Plain Text in Processor Encrypted Text in Memory

18 Supporting Memory secure store instruction DataTag RegistersCaches Memory DataTag Secure Store: Tag is copied from register to cache Writeback: Look up Tag, Encrypt and Hash Data XOM Key Table

19 Supporting Memory secure load instruction RegistersCaches Memory DataTagDataTag Secure Load: Load data and tag from cache Data Memory Fetch: Look up currently XOM ID, Decrypt and verify Hash Currently executing XOM ID XOM Key Table Set Tag in cache

20 Protection Granularity Caching reduces the number of cryptographic operations The granularity of each message is increased The granularity of ownership is increased –Need to add per word valid bits –Clear all valid bits when tag changes TagWord Program 1 Program 2 Tag

21 XOM Hardware Simulator The SimOS Simulator: –Simulates hardware in enough detail to boot an unmodified operating system –Performance modeling processor, caches, memory and disk Processor Model: MIPS processor –Private Key and Key Table –Ciphers and hashes on memory bus –Tags in registers and caches –Additional instructions Enter/Exit XOM Move to/from NULL Secure Load/Store

22 Outline 1.Introduction 2.XOM Hardware 3.Operating System Support i.OS Issues ii.OS Modifications iii.Overheads 4.Attack Models 5.Conclusion

23 Operating System Issue Traditional operating systems perform both resource management and protection for applications –Since XOM does not trust OS, protection is done in hardware –However, OS still has to manage resources –Must be able to store interrupted state and restore it later Compartments do not allow other programs to read data Solution is to encrypt data before allowing the Operating System to handle it

24 Supporting Interrupts save register instruction Data To Insecure Main Memory Tag Currently executing XOM ID Look up program key based on Tag Encrypt Data XOM Key Table

25 Supporting Interrupts register restore instruction Data From Insecure Main Memory Tag Currently executing XOM ID Decrypt Data XOM Key Table Operating System indicates which XOM ID to use Target register tag is set to XOM ID

26 Operating System Support Modify the IRIX 6.5 Operating System to run on XOM processor –IRIX 6.5 is the most current operating system from SGI –Deployed on MIPS based SGI computers –Boot and run modified IRIX6.5 on our XOM simulator Main areas that need modification: –Need support for XOM key table Loading/unloading, management –Resource management of secure data Traps, Virtual Memory –Compatibility with original system Fork, Signal Handling, Dynamic Linking

27 Operating System Overhead Slow down due to operating system overhead due to extra instructions and cache pollution: –Costs largely due additional cache misses, a result of larger code and data footprint larger registers –Avoid doing these instructions whenever you can, check for XOM compartment Total CyclesCache Misses IRIXXOMOVIRIXXOMOV System Call9K11K18% % Signal Handling65K99K53%263431% Fork702K784K12% %

28 Application Overhead Application overhead due to: –Memory latency due to cryptography –Cache behavior Results are depend on application: –These applications did not miss heavily in the cache –Additional memory latency adds small overhead Execution Overhead Instruction Overhead MPG Decode3.0%0.0004% RSA3.0%0.0004%

29 Outline 1.Introduction 2.XOM Hardware 3.Operating System Support 4.Attack Models I.Formal Verification II.Spoofing Attacks III.Splicing Attacks IV.Replay Attacks 5.Conclusion

30 Model Checking Model Checker exhaustively explores the state space of the model, checking that every state satisfies invariants The state space must be kept small –Model is an abstraction of the real system –Model checkers cannot prove correctness, but are very useful in finding errors Use model checker to verify that given a malicious operating system, program code and data is safe from tampering and observation

31 Invariant 1 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 Adversary DataAdversary Tag Program DataProgram Tag

32 Invariant 2 2.Adversary cannot modify the program without detection Need a “pristine” model to compare XOM model against Define a second, simpler model that adversary cannot affect Make sure the state of the model is consistent with the state of the “pristine” model Adversary Program XOM Model Pristine Model =

33 Spoofing Attacks Tags are able to catch spoofed attacks because tag ID changes Encryption alone is not sufficient for memory Spoofing attack: –Adversary tries to substitute fake cipher text to alter behavior Data Adversary swaps data DataFalse Data Encrypt and store to memory Junk Decrypts to Junk but alters program behavior

34 Spoofing Prevention Solution is to add an integrity hash to the encryption –Adversary has to reverse encryption to fake the hash For this reason, encrypted data is larger than unencrypted data Data Adversary swaps data False Data Encrypt and store to memory with added hash Hash does not match data so exception is thrown !

35 Splicing attack: –Adversary copies valid cipher text from another location replacing one value with another Position dependent hash prevents this –For secure load/store, values must be from the same virtual address –For secure restore/save values must be from the same register number Splicing Attacks Data 1 Data 2 Data 1 Data 2 Encryption and storage into memory Data 1 Decryption from memory, Data 2 has been replaced with Data 1 Address 1 Address 2

36 Replay Attack –Adversary records previous valid values and reuses them –The OS records register values and replays them Key Table uses a register key (different from the compartment key) Old register key is revoked every time OS interrupts process Similarly, we can protect memory from replay attacks by keeping a hash in a register Register Replay Attacks Data 1 Data 2 Data 1 Data 2 OS Saves Registers Data 1 Restore old register value Time 1 Time 2 (Same Register) Data 1

37 What XOM Cannot Prevent XOM does not prevent denial of service –The Operating System controls resource management –So it can always prevent applications from running by denying resources XOM does not prevent frequency analysis of data –Attacker can observe cipher texts in memory XOM does not prevent adversary from getting an address trace –OS can use the TLB to get a trace –Application can stop this (Ostrovsky, Oblivious RAM) Other attacks are shown to be prevented with formal verification (model checker)

38 Verification Result Show that a malicious operating system can’t tamper with software Show that all actions in the XOM processor are required: –Removing any actions allows the adversary to break the model Show that a properly working operating system can guarantee forward progress: –By restraining the OS, show that XOM exceptions are never triggered

39 Conclusions The XOM model is a working system that separates protection from resource management –Data protection and access control is in hardware –Resource management is in Operating System –Complete working system –OS semantics are preserved Implementation requires –Required hardware is a secret private key and storage for key table –Modifications to the operating system, mainly in areas that deal with program data Performance impact can be made pretty small with hardware assist

40 Future Work More detailed analysis of applications: –XOM doesn’t stop programmers from writing security bugs into their programs –How do applications mitigate XOM OS and Hardware overhead Implementation alternatives –Virtual machine authenticated with secure boot –Use a secure coprocessor Alternative applications –Intrusion detection and monitoring –Strong forms of isolation for services