taming transactions towards hardware assisted control
play

Taming Transactions: Towards Hardware-Assisted Control Flow - PowerPoint PPT Presentation

The 19th International Symposium on Research in Attacks, Intrusions and Defenses (RAID 2016) Taming Transactions: Towards Hardware-Assisted Control Flow Integrity using Transactional Memory Marius Muench, Fabio Pagani, Yan Shoshitaishvili,


  1. The 19th International Symposium on Research in Attacks, Intrusions and Defenses (RAID 2016) Taming Transactions: Towards Hardware-Assisted Control Flow Integrity using Transactional Memory Marius Muench, Fabio Pagani, Yan Shoshitaishvili, Christopher Kruegel, Giovanni Vigna, and Davide Balzarotti

  2. Outline 0100100001100101 0110110001101100 0110111101010111 0110111101110010 0110110001100100

  3. Control Flow Integrity Abadi et al ., ‘05 -

  4. + ? Hardware-Assisted CFI Architectural Support Commodity Features  CFImon (Xia et al., ’12)  HAFIX (Dave et al., ’15)  PathArmor (van der Veen et  SOFIA (de Clarq et al., ’ 16) al., ‘15)  CCFI (Mashtizadeh et al, ’15)  HCFI (Christoulakis et al., ’ 16)

  5. Transactional Memory Herlihy & Moss: “Transactional Memory: Architectural Support for Lock-Free Data Structures” (1993)

  6. Transactions Serializability Atomicity COMMIT ABORT

  7. Transactional Synchronization eXtensions XBEGIN XACQUIRE XTEST XABORT XRELEASE XEND Restricted Transactional Hardware Lock Memory Elision

  8. Hardware Lock Elision  Elides Hardware Locks  Prefix Based XACQUIRE LOCK ADD [rax], 1 ;execute critical section • XACQUIRE , XRELEASE • Used instead of LOCK -prefix • Backwards compatible  Failed Transaction • Rollback of changed memory • Re-execution with traditional XRELEASE LOCK SUB [rax], 1 locking

  9. Restricted Transactional Memory  Marks Code Regions as Transactional XBEGIN __fall_back_path  Instruction Based ;execute critical section • XBEGIN , XEND , XABORT • Not backwards compatible  Failed Transaction • Rollback of changed memory • Execution of fall-back path XEND • Reason of failure stored in RAX

  10. Transactional Aborts  Conflicts on shared data • Different value of elided lock (HLE)  Instruction based aborts • Imperative – XABORT, CPUID, PAUSE • Implementation dependent → Context switch sensitivity  Transactional Nesting Limit ABORT COMMIT -

  11. TSX-based CFI Can we leverage Intel’s TSX to enforce CFI? 16/09/2016 -

  12. TSX-based CFI  Enclose every control-flow transfer with a transaction  Use fall-back paths to verify integrity  Focus on label-based approaches

  13. TSX-based CFI RTM HLE  No labels  Elided Lock Value as Label  Clobbered RAX in Fall-  Virtual Fall-back path back Path required  XEND outside of transaction yields SEGFAULT

  14. TSX-based CFI: Example

  15. TSX-based CFI: Example Enter Transaction

  16. TSX-based CFI: Example Leave Transaction Enter Transaction

  17. TSX-based CFI: Example Verify Presence of XEND Instruction Leave Transaction Enter Transaction

  18. TSX-based CFI: Example Verify Presence of XEND Instruction Leave Transaction Enter Transaction Continue Normal Execution

  19. TSX-based CFI: Example Verify Presence of XEND Instruction Leave Transaction Terminate Program Enter Transaction Continue Normal Execution

  20. Prototype Implementation

  21. Evaluation

  22. Conclusion  Can we leverage Intel’s TSX to enforce CFI? • Yes! • We proposed two methods for CFI enforcement: • RTM-based • HLE-based  Interesting side-effects  Mediocre performance (for now)  Implementation will be released on github:  https://github.com/eurecom-s3/tsxcfi

  23. Intel’s Control Flow Enforcement Technology  Preview released in June 2016  Backward-Edges: Shadow Stack  Forward-Edges: ENDBRANCH Instruction • Indirect branch forces CPU to enter WAIT_FOR_ENDBRANCH state • Similar to RTM-based CFI • No hardware available yet!

  24. This Slide is Intentionally Left Blank

  25. Bonus-Example: TSX-based CFI (HLE) Test for Transactional Execution Terminate Program Enter Transaction Store Label Verify Presence of Label Leave Transaction 18/09/2016 - - p 24

Recommend


More recommend