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
Solution - VM-Reset Atomicity App 2 App 1 sc_get_rc() Guest VM hc_get_rc() RC Hypervisor RC = reset counter 1) Allow applications to detect VM-resets 2) Use transactional memory (TM) to add atomicity
Results Summary It works! Guarantees atomicity across VM resets. Adds ~50% overhead to typical cryptographic operations
VM-Reset Security Vulnerabilities 2010: researchers broke Firefox and Apache Compromised Apache server's private key! Motivation Background Design Results Conclusion
One-time Use Values counter Motivation Background Design Results Conclusion
EncryptSign 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); } Motivation Background Design Results Conclusion
Detecting Resets App 2 App 1 sc_get_rc() Guest VM hc_get_rc() RC Hypervisor ● Track resets with a counter ● Hypercall to retrieve counter ● System call to retrieve counter Motivation Background Design Results Conclusion
Transactional Memory ● Borrowed from database transaction ● Guarantees Consistency and Atomicity ● Supports speculative execution and rollback ● Transaction either commits or 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
Verification With TM Without TM START counter: 0 START counter: 0 END counter: 100 END counter: 100 START counter: 100 START counter: 100 END counter: 200 END counter: 200 VS START counter: 200 START counter: 200 VM RESET VM RESET END counter: 300 END counter: 300 START counter: 200 START counter: 300 END counter: 300 END counter: 400 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
Thank you QUESTIONS?
Recommend
More recommend