leaky processors stealing your secrets with foreshadow
play

Leaky Processors: Stealing Your Secrets with Foreshadow Jo Van Bulck - PowerPoint PPT Presentation

Leaky Processors: Stealing Your Secrets with Foreshadow Jo Van Bulck imec-DistriNet, KU Leuven jo.vanbulck@cs.kuleuven.be jovanbulck OWASP BeNeLux-Days, November 30, 2018 A primer on software security Secure program: convert all input


  1. Leaky Processors: Stealing Your Secrets with Foreshadow Jo Van Bulck ↸ imec-DistriNet, KU Leuven � jo.vanbulck@cs.kuleuven.be � jovanbulck OWASP BeNeLux-Days, November 30, 2018

  2. A primer on software security Secure program: convert all input to expected output INPUT OUTPUT 1 / 20

  3. A primer on software security Buffer overflow vulnerabilities: trigger unexpected behavior INPUT OUTPUT 1 / 20

  4. A primer on software security Safe languages & formal verification: preserve expected behavior INPUT OUTPUT 1 / 20

  5. A primer on software security Side-channels: observe side-effects of the computation INPUT OUTPUT 1 / 20

  6. Evolution of “side-channel attack” occurrences in Google Scholar 4000 3000 2000 DO WE JUST SUCK AT... COMPUTERS? YUP. ESPECIALLY SHARED ONES. 1000 1990 1994 1998 2002 2006 2010 2014 2018 Based on github.com/Pold87/academic-keyword-occurrence and xkcd.com/1938/ 2 / 20

  7. CPU cache timing side-channel Cache principle: CPU speed ≫ DRAM latency → cache code/data while true do maccess(&a); endwh CPU + cache DRAM memory 3 / 20

  8. CPU cache timing side-channel Cache miss: Request data from (slow) DRAM upon first use cache miss while true do a maccess(&a); endwh CPU + cache DRAM memory 3 / 20

  9. CPU cache timing side-channel Cache hit: No DRAM access required for subsequent uses cache hit while true do a maccess(&a); endwh CPU + cache DRAM memory 3 / 20

  10. Cache timing attacks in practice: Flush+Reload if secret do maccess(&a); else maccess(&b); endif a flush(&a); CPU + cache DRAM memory start_timer maccess(&a); end_timer 4 / 20

  11. Cache timing attacks in practice: Flush+Reload if secret do secret=1, load 'a' into cache maccess(&a); else maccess(&b); cache miss endif a flush(&a); CPU + cache DRAM memory start_timer maccess(&a); end_timer 4 / 20

  12. Cache timing attacks in practice: Flush+Reload if secret do maccess(&a); else maccess(&b); endif cache hit a flush(&a); CPU + cache DRAM memory start_timer maccess(&a); fast access(&a) → secret=1 end_timer 4 / 20

  13. Cache timing attacks in practice: Flush+Reload if secret do maccess(&a); else maccess(&b); cache miss endif cache miss b flush(&a); CPU + cache DRAM memory start_timer maccess(&b); slow access(&b) → secret=1 end_timer 4 / 20

  14. A primer on software security (revisited) Side-channels: observe side-effects of the computation INPUT OUTPUT 5 / 20

  15. A primer on software security (revisited) Constant-time code: eliminate secret-dependent side-effects INPUT OUTPUT 5 / 20

  16. A primer on software security (revisited) Transient execution: HW optimizations do not respect SW abstractions (!) INPUT OUTPUT 5 / 20

  17. Out-of-order and speculative execution Key discrepancy: Programmers write sequential instructions 6 / 20

  18. Out-of-order and speculative execution Key discrepancy: Programmers write sequential instructions Modern CPUs are inherently parallel ⇒ Speculatively execute instructions ahead of time 6 / 20

  19. Out-of-order and speculative execution Key discrepancy: Programmers write sequential instructions Modern CPUs are inherently parallel Over fl ow ⇒ Speculatively execute instructions ahead of time Roll-back exception Best-effort: What if triangle fails? → Commit in-order, roll-back square . . . But side-channels may leave traces (!) 6 / 20

  20. Transient execution attacks: Welcome to the world of fun! CPU executes ahead of time in transient world Success → commit results to normal world � Fail → discard results, compute again in normal world � 7 / 20

  21. Transient execution attacks: Welcome to the world of fun! CPU executes ahead of time in transient world Success → commit results to normal world � Fail → discard results, compute again in normal world � Transient world (microarchitecture) may temp bypass architectural software intentions: Control flow prediction Delayed exception handling 7 / 20

  22. Transient execution attacks: Welcome to the world of fun! Key finding of 2018 ⇒ Transmit secrets from transient to normal world Transient world (microarchitecture) may temp bypass architectural software intentions: Control flow prediction Delayed exception handling 7 / 20

  23. Transient execution attacks: Welcome to the world of fun! Key finding of 2018 ⇒ Transmit secrets from transient to normal world Transient world (microarchitecture) may temp bypass architectural software intentions: Speculative buffer overflow/ROP CPU access control bypass 7 / 20

  24. Meltdown: Transiently encoding unauthorized memory Unauthorized access 8 / 20

  25. Meltdown: Transiently encoding unauthorized memory Unauthorized access Transient out-of-order window oracle array secret idx 8 / 20

  26. Meltdown: Transiently encoding unauthorized memory Unauthorized access Transient out-of-order window Exception (discard architectural state) 8 / 20

  27. Meltdown: Transiently encoding unauthorized memory Unauthorized access Transient out-of-order window Exception handler oracle array cache hit 8 / 20

  28. Mitigating Meltdown: Unmap kernel addresses from user space OS software fix for faulty hardware ( ↔ future CPUs) 9 / 20

  29. Mitigating Meltdown: Unmap kernel addresses from user space OS software fix for faulty hardware ( ↔ future CPUs) Unmap kernel from user virtual address space → Unauthorized physical addresses out-of-reach (˜cookie jar) user unmapped context switch user switch address space kernel context switch SMAP+SMEP kernel Gruss et al. “KASLR is dead: Long live KASLR”, ESSoS 2017 [GLS + 17] 9 / 20

  30. Rumors: Meltdown immunity for SGX enclaves? “[enclaves] remain protected and completely secure” — International Business Times, February 2018 “[enclave memory accesses] redirected to an abort page, which has no value” — Anjuna Security, Inc., March 2018 10 / 20

  31. Rumors: Meltdown immunity for SGX enclaves? https://wired.com and https://arstechnica.com 10 / 20

  32. Enclaved execution attack surface: TCB reduction https://informationisbeautiful.net/visualizations/million-lines-of-code/ 11 / 20

  33. Enclaved execution attack surface: TCB reduction App App App App OS kernel Hypervisor TPM CPU Mem HDD Trusted Untrusted 11 / 20

  34. Enclaved execution attack surface: TCB reduction App App Enclave app OS kernel Hypervisor TPM CPU Mem HDD Intel SGX promise: hardware-level isolation and attestation 11 / 20

  35. Enclaved execution attack surface: TCB reduction App App Enclave app OS kernel Hypervisor TPM CPU Mem HDD Trusted CPU → exploit microarchitectural bugs/design flaws Van Bulck et al. “Foreshadow: Extracting the Keys to the Intel SGX Kingdom with Transient Out-of-Order Execution”, USENIX 2018 [VBMW + 18] 11 / 20

  36. Building Foreshadow 12 / 20

  37. Building Foreshadow L1 terminal fault challenges Foreshadow can read unmapped physical addresses from the cache (!) 12 / 20

  38. Foreshadow-NG: Breaking the virtual memory abstraction CPU micro-architecture L1D T ag? vadrs padrs PT walk? L1 cache design: Virtually-indexed, physically-tagged 13 / 20

  39. Foreshadow-NG: Breaking the virtual memory abstraction CPU micro-architecture L1D T ag? vadrs padrs PT walk? Page fault: Early-out address translation 13 / 20

  40. Foreshadow-NG: Breaking the virtual memory abstraction CPU micro-architecture Tag? L1D Pass to out-of-order padrs vadrs PT walk? L1-Terminal Fault: match unmapped physical address (!) 13 / 20

  41. Foreshadow-NG: Breaking the virtual memory abstraction CPU micro-architecture Tag? L1D Pass to out-of-order padrs vadrs PT SGX? walk? Foreshadow-SGX: bypass enclave isolation 13 / 20

  42. Foreshadow-NG: Breaking the virtual memory abstraction CPU micro-architecture Tag? L1D Pass to out-of-order host guest padrs vadrs padrs PT EPT SGX? walk? walk? Foreshadow-VMM: bypass virtual machine isolation 13 / 20

  43. Mitigating Foreshadow 14 / 20

  44. Mitigating Foreshadow Future CPUs (silicon-based changes) https://newsroom.intel.com/editorials/advancing-security-silicon-level/ 14 / 20

  45. Mitigating Foreshadow OS kernel updates (sanitize page frame bits) https://wiki.ubuntu.com/SecurityTeam/KnowledgeBase/L1TF 14 / 20

  46. Mitigating Foreshadow Intel microcode updates ⇒ Flush L1 cache on enclave/VMM exit + disable HyperThreading https://software.intel.com/security-software-guidance/software-guidance/l1-terminal-fault 14 / 20

  47. Mitigating Foreshadow/L1TF: Hardware-software cooperation 15 / 20

  48. Some good news? https://www.technologyreview.com/the-download/611879/intels-foreshadow-flaws-are-the-latest-sign-of-the-chipocalypse/ https://www.intel.com/content/www/us/en/architecture-and-technology/l1tf.html 16 / 20

  49. Some good news? https://www.zdnet.com/article/azure-confidential-computing-microsoft-boosts-security-for-cloud-data/ 16 / 20

  50. Some good news? ↔ https://www.zdnet.com/article/azure-confidential-computing-microsoft-boosts-security-for-cloud-data/ 16 / 20

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend