AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on...

23
L C S AEGIS: Architecture for Tamper-Evident and Tamper-Resistant Processing G. Edward Suh, Dwaine Clarke, Blaise Gassend, Marten van Dijk, Srinivas Devadas Massachusetts Institute of Technology

Transcript of AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on...

Page 1: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

L C S

AEGIS: Architecture for Tamper-Evident and Tamper-Resistant Processing

G. Edward Suh, Dwaine Clarke, Blaise Gassend, Marten van Dijk, Srinivas Devadas

Massachusetts Institute of Technology

Page 2: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Cases for Physical Security

• Applications on untrusted hosts with untrusted owners– Digital Rights Management (DRM), Software licensing– Distributed computation on Internet– Mobile agents

• New challenges– Untrusted OS – Physical attacks

Make Illegal Copies Incorrect Results;

Break the System

Music/Movie

Software

Program

Distributed Computing,Peer-to-Peer Network

Page 3: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Conventional Tamper-Proof Packages

• Processing system in a tamper-proof package (IBM 4758)– Expensive: many detecting sensors– Needs to be continuously powered: battery-backed RAM

$2,690in 2001

Memory

99MHz 486

Source: IBM website

Page 4: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Single-Chip Secure Processors

Trusted Environment

Memory

I/O

Check Integrity,Encrypt

• Only trust a single chip: tamper-resistant– Off-chip memory: verify the integrity and encrypt– Untrusted OS: identify a core part or protect against OS attacks

• Cheap, Flexible, High Performance

Identify orProtect against

UntrustedOS

Page 5: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Related Research

• XOM (eXecution Only Memory): David Lie et al– Stated goal: Protect integrity and privacy of code and data– Operating system is completed untrusted– Memory integrity checking does not prevent replay attacks– Privacy is expensive but not necessary for all applications

• Palladium/NGSCB: Microsoft– Stated goal: Protect from software attacks– Combination of hardware and software mechanisms– Adds "curtained" memory to avoid DMA attacks– Uses a security kernel (Nexus)– Memory integrity and privacy are assumed (only software attacks).

Page 6: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

L C S

AEGIS: High-Level Architecture

Page 7: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Secure Execution Environments

• Tamper-Evident (TE) environment – Guarantees a valid execution and the identity of a program; no

privacy– Any software or physical tampering to alter the program behavior

should be detected

• Private Tamper-Resistant (PTR) environment– TE environment + privacy– Encrypt instructions and data– Assume programs do not leak information via memory access

patterns

• Implementation– Either have a trusted part of the OS or completely untrust the OS– Secure context manager, encryption and integrity verification

Page 8: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Secure Context Manager (SCM)

• A specialized module in the processor

• Assign a secure process ID(SPID) for each secure process

• Implements new instructions– enter_aegis– set_aegis_mode– random– sign_msg

• Maintains a secure table– Even operating system

cannot modify

Standard Processor SCM

L1Instruction

cache

On-Chip L2Cache

Processor Core

L1Datacache

Regs

…SPID

Off-Chip Memory

Page 9: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

SCM: Program Start-Up

• ‘enter_aegis’: TE mode– Start protecting the

integrity of a program – Compute and store the

hash of the stub code: H(Prog)

Tampering of a program results in a different hash

– Stub code verifies the rest of the code and data

• ‘set_aegis_mode’– Start PTR mode on top of

the TE mode

.textenter_aegisEKey1 = 0xA4523BC2E435D;EKey2 = 0xB034D2C654F32;E1Msg = …Secret=GetSecret(Challenge);Key1=Decrypt(EKey1, Secret);Key2=Decrypt(EKey2, Secret);CheckMAC(Key1, Key2, MAC);Msg = Decrypt(E1Msg, Key1);E2Msg = Encrypt(Msg, Key2);Output(E2Msg);

Secret=GetSecret(Challenge);Key1=Decrypt(EKey1, Secret);Key2=Decrypt(EKey2, Secret);CheckMAC(Key1, Key2, MAC);Msg = Decrypt(E1Msg, Key1);E2Msg = Encrypt(Msg, Key2);Output(E2Msg);

enter_aegis code_end

H(Prog)

Protected Table

SHA-1

Stub Segment

Program

Page 10: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

SCM: On-Chip Protection

• Registers on interrupts– SCM saves Regs on

interrupts, and restore on resume

• On-chip caches– Need to protect against

software attacks– Use SPID tags and virtual

memory address – Allow accesses from the

cache only if both SPID and the virtual address match

Standard Processor

L1Instruction

cache

On-Chip L2Cache

Processor Core

L1Datacache

Regs

…Regs

…H(Prog)

…SPIDSPID

Tags

SPID Tags

SPID Tags

Interrupt

Resume

SCM

Off-Chip Memory

Page 11: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Memory Encryption

Untrusted RAM

TrustedState

Processor

ENCRYPT

DECRYPT

Programwrite

read

• Encrypt on an L2 cache block granularity– Use symmetric key algorithms with CBC mode– Randomize initial vectors

Page 12: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Integrity Verification

Untrusted RAM

TrustedState

Processor

ENCRYPT

DECRYPT

Program

VERIFY

E(124), MAC(0x45, 124)

Address 0x45

E(120), MAC(0x45, 120)IGNORE

write

read

Cannot simply MAC on writes and check the MAC on readsReplay attacks

Hash trees for integrity verification

Page 13: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Hash Trees

Processor

V1 V3 V4

L2 block

Data Values

Logarithmic overhead for every cache miss

Low performance

Cached hash trees

MISS V2READ

VERIFY

h1=h(V1.V2) h2=h(V3.V4)

root = h(h1.h2)

VERIFY

Untrusted Memory

Page 14: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Cached Hash Trees (HPCA’03)

Processor

V1 V2 V3 V4

Cache hashes in L2

L2 is trustedStop checking earlier

Less overheadIn L2MISS

In L2

h1=h(V1.V2) h2=h(V3.V4)

root = h(h1.h2)

VERIFY

VERIFY

MISS

VERIFY

DONE!!!

Untrusted Memory

Page 15: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Message Authentication

• Processor Other systems– The processor signs a message for a program

sign_msg M: {H(Prog), M}SKproc– Unique for each program because H(Prog) is always included

• Other systems Processor– Embed the user’s public key in a program– Incoming messages are signed with the user’s private key

Program with Puser

{Message}Suser

{H(Prog), Message}Sproc

Page 16: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

L C S

Applications

Page 17: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Certified Execution

• Execution certified by the secure processor– Dispatcher provides a program and data– Processor returns the results with the signature

• Requires the TE environment

Job Dispatcher

Processor’s Private Key

Secure Processor

RESULT

RESULT

enter_aegis

Execute

Get results

Verify results

- H(Prog)

- signature

Program,Data

Processor’s Public Key

Page 18: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Digital Rights Management

• Protects digital contents from illegal copying– Trusted software (player) on untrusted host– Content provider only gives contents to the trusted player

• Requires the PTR environment

Processor’s Private Key

Authenticated & Encrypted Channel (SSL)

Player

Random nonceSigned nonce

Verify

- H(Player)- nonce- signature

Run Player

- enter_aegis- enter PTR

Content

Processor’s Public Key

Content Provider Secure Processor

Page 19: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

L C S

Performance

Page 20: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Performance Implication: TE processing

• Major performance degradation is from off-chip integrity checking– Start-up and context switches are infrequent– no performance overhead for on-chip tagging

gcc gzip mcf twolf vortex vpr applu art swim 0

0.2

0.4

0.6

0.8

1

1.2

(a) 64B

Nor

mal

ized

IPC

256KB1MB 4MB

Worst case 50% degradationMost cases < 25% degradation

L2 Cacheswith 64B blocks

Page 21: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Performance Implication: PTR processing

• Major performance degradation is from off-chip integrity checking and encryption

gcc gzip mcf twolf vortex vpr applu art swim 0

0.2

0.4

0.6

0.8

1

1.2

Nor

mal

ized

IPC

256KB1MB 4MB

Worst case 60% degradationMost cases < 40% degradation

L2 Cacheswith 64B blocks

Page 22: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Summary

• Physical attacks are becoming more prevalent– DRM, software licensing, distributed computing, etc.

• Single-chip secure processors provide trusted execution environments with acceptable overhead– Tamper-Evident environment, Private Tamper-Resistant

environment– Simulation results show 25-50% overhead for TE, 40-60%

overhead for PTR processing– New mechanisms can reduce the overhead to 5-15% for TE,

and 10-25% for PTR processing (CSG Memo 465)

• Significant development effort underway– FPGA/ASIC implementation of AEGIS processor

Page 23: AEGIS - Cornell Universitysuh/slides/ics03_slides.pdf · SCM: On-Chip Protection • Registers on interrupts – SCM saves Regs on interrupts, and restore on resume • On-chip caches

International Conference on Supercomputing — June 23-26, 2003G. Edward Suh — MIT Lab for Computer Science

Questions?

More Information at www.csg.lcs.mit.edu