CS 773 Paper Presentation
Record-Replay Architecture as a General Security Framework
Sahil Jain
ArchMages
180050089@iitb.ac.in
1
2
Inflexible
Imprecise
Intrusive
Hardware security
Security Requirements
3
Precision: False positives/negatives are not acceptable
Intrusive: Less intrusive the hardware, less the cost
Flexibility: Attacks evolve, so must defense
Can we get security that is precise, cheap and flexible?
4
Yes! RnR-Safe
Outline
5
A general
framework
RnR-Safe
Example threat
Limitations
Prior work
RnR-Safe & ROP
RnR-Safe
6
Record and (Deterministic) Replay - RnR
7
RnR-Safe
8
RnR-Safe Organization
http://iacoma.cs.uiuc.edu/iacoma-papers/hpca18.pdf
Applications of RnR-Safe
9
Attack | Alarm Trigger | Possible First Detection Technique | Role of Replay |
Return Oriented Programming (ROP) | RAS misprediction | Manage a Multithreaded RAS, use a whitelist | Execute a kernel compatible shadow stack algorithm |
Jump Oriented Programming (JOP) | Stray indirect branch or call | Table of begin and end addresses of the most common functions | Verify if the target is one of the less common functions |
Denial of Service (DOS) | Kernel scheduler inactivity | Counter of number of context switches | Identify reason for low switching frequency |
Example Threat : (Kernel) ROP
10
Stack Smashing
11
void func(char* input){
char array[32];
// overflow
strcpy(array, input);
return;
}
input = "attack_code; address_to_attack"
array
ret
attack_code
ret
Injecting malware by attacking stack
W xor X
12
void func(char* input){
char array[32];
// overflow
strcpy(array, input);
return;
}
input = "attack_code; address_to_attack"
array
ret
attack_code
ret
Not executable
Return-Oriented Programming
13
adr 1: instr 1
ret
….
adr 2: instr 2
ret
….
adr 3: instr 3
ret
Program
input = "data1; adr2; data2; adr3; data3"
data1
adr2
data2
adr3
data3
Attacker wants to execute:
instr1 data1
instr2 data2
instr3 data3
Assume PC is at adr1
Voila! Attacked w/o executing stack!
Gadget
Prior Work
14
Prior Work & Limitations
15
SmashGuard & SRAS
Instrumentation-based CFI enforcing solutions
Randomizing code location (ASLR)
RnR-Safe against ROP
16
Return Address Stack(RAS)
17
RAS
Program
call func
PC
call func2
func:
ret
func2:
ret
PC
PC
PC
PC
PC
ret
Stack
ret
No Mispredictions!
ROP in presence of RAS
18
RAS
Program
call func
PC
func:
vuln
ret
pop rax
ret
gadget1:
PC
PC
PC
Stack
gadget1
gadget2
gadget2
Misprediction!
RAS & ROP detection
19
Reducing False Positives
20
Multi-threaded Environment
Solution :
21
Multi-threaded Environment
22
Non-procedural Returns
Solution :
23
push addr
ret
Code
Stack
addr
PC
PC
PC =
addr
Underflows
Solution :
24
Imperfect Nesting
Solution :
25
Checkpointing Replayer
26
Alarm Replayer
27
Experimental Evaluation
28
http://iacoma.cs.uiuc.edu/iacoma-papers/hpca18.pdf
Recording Setups
29
ROP False Alarms
30
Checkpointing Replay
31
Alarm Replay for ROP Attacks
32
Conclusion
33
34
Thank You!
35