SPECTRES, VIRTUAL GHOSTS, AND HARDWARE SUPPORT
Xiaowan Dong University of Rochester Zhuojia Shen University of Rochester John Criswell University of Rochester Alan Cox Rice University Sandhya Dwarkadas University of Rochester
SPECTRES, VIRTUAL GHOSTS, AND HARDWARE SUPPORT Xiaowan Dong - - PowerPoint PPT Presentation
SPECTRES, VIRTUAL GHOSTS, AND HARDWARE SUPPORT Xiaowan Dong University of Rochester Zhuojia Shen University of Rochester John Criswell University of Rochester
Xiaowan Dong University of Rochester Zhuojia Shen University of Rochester John Criswell University of Rochester Alan Cox Rice University Sandhya Dwarkadas University of Rochester
Analyze the impact of speculation side channel mitigation on mechanisms that protect user data from compromised OS kernels.
2
3
side channels
read and exposed via cache side channels
if (x < array1_size) y = array2[array1[x] * 256];
4
5
6
SVA-OS Processor OS Kernel
7
User Space Secure User Space Virtual Ghost Space Kernel Space
Virtual address space
vulnerable to bounds check bypass
reads data before the check completes
If ((addr < SECURE_MEM_START) OR (addr > SECURE_MEM_END)) access_memory(addr);
8
Goal: Defend against bounds check bypass (Spectre variant 1) directly launched by the kernel on secure user and virtual ghost space
9
10
protected memory regions
between the SFI code and the memory load
speculation Check must complete before memory load is performed
User Space Secure User Space Virtual Ghost VM Memory Kernel Space
11
Addr
mov POINTER_ADDR_HIGH_ORDER_BITS, %R1 cmp PROT_MEM_HIGH_ORDER_BITS, %R1 sete %R2 sign-extend and left shift %R2
mov (%R2), %R1
12
13
264-1
User Space Secure User Space Virtual Ghost Space Kernel Space User Space Secure User Space Virtual Ghost Space Kernel Space
264-1 (264-1) - gstart
[1] Xiaowan Dong, Zhuojia Shen, John Criswell, Alan Cox, and Sandhya Dwarkadas. Shielding Software From Privileged Side- Channel Attacks. To appear in the 27th USENIX Security Symposium, 2018.
mov %R1, %R2 sub GHOST_MEM_START_ADDR, %R2 bndcl %R2, %bnd0 lfence mov (%R1), %R1
instructions following bounds check
between the bounds check and the memory load
All subsequent instructions are stalled until the bounds check commits
14
Bit-Masking SFI
Bounds_check(addr) Access(addr) Instr1 Instr2
MPX SFI with lfence
Bounds_check(addr) lfence Access(addr) Instr1 Instr2
15
Data Dependence
16
17
User Space Secure User Space Virtual Ghost Space Virtual Ghost VM Trampolines Kernel Space Virtual Ghost and application root-level page table pages Virtual address space Kernel root-level page table page User Space Secure User Space Virtual Ghost Space Virtual Ghost VM Trampolines Kernel Space User Space Virtual Ghost VM Trampolines Kernel Space
VirtualGhost-AddrSpace
18
Bit-Masking SFI
load and store
dependence MPX SFI with lfence
load and store
stall
19
Separate Address Spaces
very expensive
Virtual Ghost can be frequent
20
21
22
23
The best performance lfence is very expensive The best performance
24
25
SSH Server File Transfer Bandwidth
26
SSH Server File Transfer Bandwidth
27
SSH Server File Transfer Bandwidth
28
SSH Server File Transfer Bandwidth
29
improvements to MPX
bounds check and memory load
is out-of-bounds and check the flag later
bndcl MULTI_BOUNDS, %R1 /* cmp is used to emulate new bndcl */ sete %R2 sign-extend %R2
mov (%R1), %R1
30
31
LMBench Libc Compilation
The enhanced MPX-SFI does not outperform Bit-masking SFI
32
The enhanced MPX-SFI does not outperform Bit-masking SFI
space switch
33