Top Banner
Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley
27

Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

Mar 27, 2015

Download

Documents

Brian Gonzales
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

Architectural Support for Software-Based Protection

Mihai Budiu Úlfar Erlingsson Martín Abadi

ASID Workshop, Oct 21, 2006

Silicon Valley

Page 2: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

Summary

CFI XFI

Enforce control flow to prevent software attacks

[CCS 05] [ICFEM 05]

Protect modules within a single address space

[OSDI 06]

2

This work: add hardware supportThis work: add hardware support

Page 3: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

Outline

• Control-Flow Integrity

• XFI: Protecting Modules• Conclusions

3

Page 4: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

CFI Motivation

4

Control flow

Anatomy of many software attacks

Page 5: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

CFI Idea

5

Executable Control-Flow Graph

+ =

Self-checking program

Page 6: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

CFI Security Benefits

• Enforces CFG against attacker that controlswhole data memory

• Defends against a large class of attacks– Buffer overflows– Stack smashing– Jump-to-libc– Pointer subterfuge

• Validated experimentally

6

Code

Data

Stack

Page 7: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

Embedding a CFG Edge

7

jmpc r1, 50......

cfilabel 60….cfilabel 50.....

jmp r1......

dest:.....

?

Traditional indirect jump New ISA: checked jump and label

Page 8: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

Semantics

8

jmpc r1, L cfilabel L

cfi_register = L;jmp r1

if (cfi_register == L) cfi_register = 0

before any instructionexcept cfilabel

if (cfi_register != 0) cfi_exception()

Page 9: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

Evaluation

9

Binary

Squeeze++binary rewriter

instrumentationalgorithm

Sim-alphasimulator

Alpha CC

Spec2k Sources

Instrumentedbinary

Performancedata

Linux

Page 10: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

CFI Execution Overhead

Page 11: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

Outline

• Control-Flow Integrity• XFI: Protecting Modules

• Conclusions11

Page 12: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

XFI Motivation

12

OS Kernel Driver Driver

Ring 0 (high privilege)Single address space

Kernel heap

Shareddata structure

Page 13: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

XFI Address Spaces

13

Host system XFI Module

Data R/OData

R/WData

Stacks

CodeCode

Entry points

Fastpathregion

A B Slowpathregion

Host heap

Page 14: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

Memory Bounds Checks

14

Host system XFI Module

Data R/OData

R/WDataCodeCode

A B

Host heap

*(int*)x = 2;

if (x < A + 0) goto SlowpathCheck; if (B – sizeof(int) < x) goto SlowpathCheck;retfromSlowCheck: *(int*)x = 2;

2x

Page 15: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

ISA Support for XFI

15

mrguard $r, L, H

If ($r < $a + L) XFI_exception()if ($b – H < $r) XFI_exception()

[$r – L, $r + H) [$a, $b)

A B

$rL H

Page 16: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

Evaluation

16

Assembly

Sim-alphasimulator

Alpha CC

Mediabench Sources

Instrumentedbinary

Performancedata

Linux

HandinstrumentKernel

LinkObject files

Page 17: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

Bounds Checks Overhead

17

Page 18: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

Advantages of ISA SupportCompared with software solutions:• Reduce executable size• Reduce pressure on fetch structures

(I-cache, trace cache, br. predictors)• Decrease register pressure

(no intermediate results)• Do not pollute condition flags• Do not pollute the data cache

to fetch code label [CFI only]

18

Page 19: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

Conclusions

• ISA support is very simple• ISA support does not stretch

critical hw resources

• ISA support can reduce the cost of CFI and XFI enforcement

19

Page 20: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

Backup Slides 20

Page 21: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

21

MSR Silicon Valley

Page 22: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

22

Our Neighbors

GoogleNASA AMESMicrosoft SVC

Page 23: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

23

We’re Going Into Architecture

Page 24: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

We’re Hiring Computer Architects

24

• Exciting research opportunities• A chance to influence industry• A lot of creative freedom• A great interdisciplinary team• A brand new research group• A great location

research.microsoft.com/aboutmsr/labs/siliconvalley

Page 25: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

CFI & XFI Toolchain

25

Compiler

Executable

Debugginginformation

ProgramBinary

rewriter

Safe executable

Unsafecode

Execution

Safecode

Verifier

Instrumentationalgorithm

Trusted computing base

Page 26: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

CFI Software Implementation

26

jmpc r1, 50......

cfilabel 50.....

if (*r1 != 50) then goto error;goto r1+4;….

.data 50….

Page 27: Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.

CFI Binary Size Increase

27