270 likes | 424 Views
Architectural Support for Software-Based Protection. Mihai Budiu Úlfar Erlingsson Martín Abadi. Silicon Valley. ASID Workshop, Oct 21, 2006. Summary. Enforce control flow to prevent software attacks [CCS 05] [ICFEM 05]. Protect modules within a single address space [OSDI 06].
E N D
Architectural Support for Software-Based Protection Mihai BudiuÚlfar ErlingssonMartín Abadi Silicon Valley ASID Workshop, Oct 21, 2006
Summary Enforce control flow to prevent software attacks [CCS 05] [ICFEM 05] Protect modules within a single address space [OSDI 06] This work: add hardware support CFI XFI
Outline • Control-Flow Integrity • XFI: Protecting Modules • Conclusions
CFI Motivation Control flow Anatomy of many software attacks
CFI Idea + = Executable Control-Flow Graph Self-checking program
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 Code Data Stack
Embedding a CFG Edge ? jmp r1 ...... dest:..... jmpc r1, 50...... cfilabel 60 …. cfilabel 50 ..... Traditional indirect jump New ISA: checked jump and label
Semantics 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()
Evaluation Spec2k Sources Squeeze++binary rewriter Sim-alpha simulator Binary Instrumentedbinary Performancedata Alpha CC instrumentationalgorithm Linux
Outline • Control-Flow Integrity • XFI: Protecting Modules • Conclusions
XFI Motivation Shareddata structure OS Kernel Driver Driver Kernel heap Ring 0 (high privilege) Single address space
XFI Address Spaces Entry points Code Data Code R/OData R/WData Host system XFI Module Stacks Host heap A B Fastpath region Slowpath region
Memory Bounds Checks if (x < A + 0) goto SlowpathCheck; if (B – sizeof(int) < x) goto SlowpathCheck; retfromSlowCheck: *(int*)x = 2; *(int*)x = 2; Code Data Code R/OData R/WData Host system XFI Module Host heap 2 x A B
ISA Support for XFI mrguard $r, L, H If ($r < $a + L) XFI_exception()if ($b – H < $r) XFI_exception() $r L H A B [$r – L, $r + H) [$a, $b)
Evaluation Mediabench Sources Handinstrument Kernel Sim-alpha simulator Assembly Instrumentedbinary Performancedata Alpha CC Link Object files Linux
Advantages of ISA Support Compared 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]
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
Our Neighbors Google NASA AMES Microsoft SVC
We’re Hiring Computer Architects • 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
CFI & XFI Toolchain Unsafe code Executable Compiler Binaryrewriter Safe executable Verifier Program Safe code Debugginginformation Execution Trusted computing base Instrumentationalgorithm
CFI Software Implementation jmpc r1, 50...... cfilabel 50 ..... if (*r1 != 50) then goto error; goto r1+4; …. .data 50 ….