Reset-Atomicity in Xen Benita Bose Adam Everspaugh VM-Reset - - PowerPoint PPT Presentation
Reset-Atomicity in Xen Benita Bose Adam Everspaugh VM-Reset - - PowerPoint PPT Presentation
Reset-Atomicity in Xen Benita Bose Adam Everspaugh VM-Reset Security Vulnerability App generates a random number VMM takes a snapshot 198764, 845920,0 Each time VM restored 349581 from snapshot - same random number used
VM-Reset Security Vulnerability
- App generates a random
number
- VMM takes a snapshot
- Each time VM restored
from snapshot - same random number used
198764, 845920,0 349581
1) Allow applications to detect VM-resets 2) Use transactional memory (TM) to add atomicity
Solution - VM-Reset Atomicity
RC = reset counter
Hypervisor Guest VM App 1 App 2 RC
sc_get_rc() hc_get_rc()
Results Summary
It works! Guarantees atomicity across VM resets. Adds ~50% overhead to typical cryptographic operations
2010: researchers broke Firefox and Apache Compromised Apache server's private key!
VM-Reset Security Vulnerabilities
Motivation Background Design Results Conclusion
One-time Use Values
Motivation Background Design Results Conclusion counter
void encryptSign() { fread("/dev/urandom", &iv, IV_SIZE); fread("/dev/urandom", &seed, SEED_SIZE); /* ... */ AES_encrypt(message, key, iv, &ciphertext); DSA_sign(ciphertext, dkey, seed, &signature); }
EncryptSign
Motivation Background Design Results Conclusion
Detecting Resets
Hypervisor Guest VM App 1 App 2 RC
sc_get_rc() hc_get_rc()
Motivation Background Design Results Conclusion
- Track resets with a counter
- Hypercall to retrieve counter
- System call to retrieve counter
Transactional Memory
- Borrowed from database
transaction
- Guarantees Consistency
and Atomicity
- Supports speculative
execution and rollback
- Transaction either commits
- r aborts
Motivation Background Design Results Conclusion
How TM Works
- Makes private copy of shared data
- Updates private copy
- If shared data is unchanged:
Updates original copy with private copy
- Else detects conflict : discards
private copy
Motivation Background Design Results Conclusion
Compiler Support
- TM support in GCC 4.7
- Flags : fgnu-tm
- transaction_atomic
- transaction_pure
- transaction_safe
- transaction_cancel
Motivation Background Design Results Conclusion
Wrapper Pseudocode
bool commit = false; while (!commit) { transaction_atomic { int my_rc = sys_get_rc(); func(); if (my_rc != sys_get_rc()) transaction_cancel; else commit = true; } }
Motivation Background Design Results Conclusion
Without TM
START counter: 0 END counter: 100 START counter: 100 END counter: 200 START counter: 200 END counter: 300 START counter: 300 END counter: 400
VS
With TM
START counter: 0 END counter: 100 START counter: 100 END counter: 200 START counter: 200 END counter: 300 START counter: 200 END counter: 300
Verification
VM RESET VM RESET Motivation Background Design Results Conclusion
Transactional Memory Overhead
Motivation Background Design Results Conclusion
Transactional Memory Overhead
Motivation Background Design Results Conclusion
Conclusion
- Working solution for
VM reset security vulnerability
- ~50% performance overhead
- HW TM support could improve
performance
Motivation Background Design Results Conclusion