SlideShare une entreprise Scribd logo
1  sur  13
Télécharger pour lire hors ligne
INTEL RESTRICTED SECRET1 SSG System Software Division
Introduction to SGX (Software Guard
Extensions) and SGX Virtualization
Kai Huang, Jun Nakajima (Speaker)
July 12, 2017
INTEL RESTRICTED SECRET2 SSG System Software Division
Agenda
• SGX Introduction
• Xen SGX Virtualization Support
• Backup
INTEL RESTRICTED SECRET3 SSG System Software Division
SGX: Reduce TCB to “HW + Enclave”
App App App
OS
VMM
Hardware
App
OS
VMM
Hardware
Enclave
Attack Surface Today Attack Surface with Enclave
Enclave:
• A protected container in App’s address space (ring 3).
• Even privileged SW cannot access enclave directly.
• Reduce TCB to “HW + Enclave”
è App gets its own capability of protection
INTEL RESTRICTED SECRET4 SSG System Software Division
SGX: Prevent Memory Snooping Attacks
• Security perimeter is the CPU
package boundary
• Data and code unencrypted inside
CPU package
• Data outside CPU package is
encrypted and/or integrity checked
• External memory reads and bus
snooping only see encrypted data
CPU
MEE12345678 jco3lks937w
Snoop
Snoop
Memory Bus
System
Memory
*MEE: SGX Memory Encryption Engine
INTEL RESTRICTED SECRET5 SSG System Software Division
SGX Enclave
• Enclave
– Trusted Execution Environment embedded in application
– Provides confidentiality and/or integrity
– With it’s own code/data.
– With controlled entry points
– Multiple threads supported
• EPC (Enclave Page Cache)
– Trusted Memory to commit enclave (via page table)
– With additional access check
– Typically reserved by BIOS as Processor Reserved Memory
– Along with EPCM with limited size (ex, 32M, 64M, 128M)
• New SGX instructions to manage/access Enclave
– ENCLS, ENCLU.
OS
Enclave
APP stack
APP code
Enclave stack
Enclave heap
Enclave code
Memory EPC
Page table
mapping
EPCM
* EPCM (Enclave Page Cache Map) :
Used by HW to track EPC status (not-visible to SW)
INTEL RESTRICTED SECRET6 SSG System Software Division
Instruction Behavior Changes in Enclave
• Invalid Instructions
• Behavior Changes
– RDTSC, RDTSCP: Only legal when SGX2 is available.
– RDRAND, RDSEED, PAUSE: May cause VMEXIT
– INVD: #UD in enclave
– INT3
INTEL RESTRICTED SECRET7 SSG System Software Division
SGX Application Flow
2. Create enclave
3. CallTrusted ()
4. Process
secrets
5. Return
6. Cont
Untrusted part
Trusted part
(Enclave)
Call Bridge1. Define and partition App to untrusted
and trusted part.
2. App creates enclave
3. Trusted function is called;
4. Code in enclave process secrets.
5. Trusted function returns.
6. App continues normal execution.
1. Partition SGX App
OS, VMM, BIOS, SMM,…
INTEL RESTRICTED SECRET8 SSG System Software Division
Agenda
• SGX Introduction
• Xen SGX Virtualization Support
• Backup
INTEL RESTRICTED SECRET9 SSG System Software Division
Virtualizing SGX
• General Enabling – Pretty Straightforward
– Discover SGX and Manage EPC in Hypervisor
– Expose part of the host EPC to guest
– Size: configurable from user
– Base: calculated internally
– SGX CPUID/MSR emulation
– Setup EPT mapping for guest EPC and host EPC.
– ENCLS and ENCLU runs perfectly in non-root mode.
• EPC Virtualization Approaches
– Static Partitioning
– Oversubscription
– Ballooning
INTEL RESTRICTED SECRET10 SSG System Software Division
SGX Interaction with VMX
• New ENCLS VMEXIT
– New bit in secondary exec control to enable ENCLS VMEXIT
– New 64-bit bitmap to control which ENCLS leaves will trigger VMEXIT
• New bits to indicate whether VMEXIT (any) is from Enclave
– Bit 27 in exit_reason
– Bit 4 in GUEST_INTERRUPTBILITY_INFO.
INTEL RESTRICTED SECRET11 SSG System Software Division
Enclave
SGX App
ACPI/CPUID/MSR
EPT mapping
Xen
SGX App
Notify
- EPC base
- EPC size
Enclave
Xen SGX Virtualization Support
Guest EPC
SGX driver
* EPT
Violation
* ENCLS
Emulation
Dom0 HVM
XL Tools
memory = 1024
epc = 64M
…
Kernel
EPT Violation
handler
ENCLS Emulation
handler
Host EPCEPC Management
Exposing EPCPopulate EPC
* ENCLS emulation & EPT violation may not needed, depending on implementation of EPC virtualization
Hypervisor Changes
INTEL RESTRICTED SECRET12 SSG System Software Division
EPC Virtualization Approaches (3)
Pros Cons
Static Partitioning • Easy implementation (no ENCLS
trapping/emulation, No EPT violation)
• No hypervisor overhead
Potential inefficient use of EPC
Ballooning • Pros of “static partitioning”
• More efficient use of EPC
Require ballooning driver in guest
Oversubscription More efficient use of EPC • Complicated implementation
• Higher hypervisor overhead
• We have preliminary patches on github with “static partitioning” implemented.
• Oversubscription vs Ballooning?
INTEL RESTRICTED SECRET13 SSG System Software Division
Questions?

Contenu connexe

Tendances

BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
Brendan Gregg
 

Tendances (20)

BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)
 
Linux Integrity Mechanisms - Protecting Container Runtime as an example
Linux Integrity Mechanisms - Protecting Container Runtime as an exampleLinux Integrity Mechanisms - Protecting Container Runtime as an example
Linux Integrity Mechanisms - Protecting Container Runtime as an example
 
Prerequisite knowledge for shared memory concurrency
Prerequisite knowledge for shared memory concurrencyPrerequisite knowledge for shared memory concurrency
Prerequisite knowledge for shared memory concurrency
 
Performance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedPerformance Wins with BPF: Getting Started
Performance Wins with BPF: Getting Started
 
TCLSH and Macro Ping Test on Cisco Routers and Switches
TCLSH and Macro Ping Test on Cisco Routers and SwitchesTCLSH and Macro Ping Test on Cisco Routers and Switches
TCLSH and Macro Ping Test on Cisco Routers and Switches
 
Writing Metasploit Plugins
Writing Metasploit PluginsWriting Metasploit Plugins
Writing Metasploit Plugins
 
Fast Userspace OVS with AF_XDP, OVS CONF 2018
Fast Userspace OVS with AF_XDP, OVS CONF 2018Fast Userspace OVS with AF_XDP, OVS CONF 2018
Fast Userspace OVS with AF_XDP, OVS CONF 2018
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
 
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all startedKernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
 
Introduction to DPDK
Introduction to DPDKIntroduction to DPDK
Introduction to DPDK
 
7 hands on
7 hands on7 hands on
7 hands on
 
LISA2019 Linux Systems Performance
LISA2019 Linux Systems PerformanceLISA2019 Linux Systems Performance
LISA2019 Linux Systems Performance
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance Analysis
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
 
Poll mode driver integration into dpdk
Poll mode driver integration into dpdkPoll mode driver integration into dpdk
Poll mode driver integration into dpdk
 
Ch 5: Introduction to heap overflows
Ch 5: Introduction to heap overflowsCh 5: Introduction to heap overflows
Ch 5: Introduction to heap overflows
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at Netflix
 
Systems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting StartedSystems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting Started
 
Intel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsIntel DPDK Step by Step instructions
Intel DPDK Step by Step instructions
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
 

Similaire à XPDDS17: Introduction to Intel SGX and SGX Virtualization - Kai Huang, Intel

Softcore processor.pptxSoftcore processor.pptxSoftcore processor.pptx
Softcore processor.pptxSoftcore processor.pptxSoftcore processor.pptxSoftcore processor.pptxSoftcore processor.pptxSoftcore processor.pptx
Softcore processor.pptxSoftcore processor.pptxSoftcore processor.pptx
SnehaLatha68
 
Your House is My House: Use of Offensive Enclaves In Adversarial Operations
Your House is My House: Use of Offensive Enclaves In Adversarial OperationsYour House is My House: Use of Offensive Enclaves In Adversarial Operations
Your House is My House: Use of Offensive Enclaves In Adversarial Operations
Dimitry Snezhkov
 

Similaire à XPDDS17: Introduction to Intel SGX and SGX Virtualization - Kai Huang, Intel (20)

SnakeGX (short version)
SnakeGX (short version)SnakeGX (short version)
SnakeGX (short version)
 
SnakeGX (full version)
SnakeGX (full version) SnakeGX (full version)
SnakeGX (full version)
 
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
 
Tos tutorial
Tos tutorialTos tutorial
Tos tutorial
 
blockchain-and-trusted-computing
blockchain-and-trusted-computingblockchain-and-trusted-computing
blockchain-and-trusted-computing
 
Secure Containers with EPT Isolation
Secure Containers with EPT IsolationSecure Containers with EPT Isolation
Secure Containers with EPT Isolation
 
Hardening Linux and introducing Securix Linux
Hardening Linux and introducing Securix LinuxHardening Linux and introducing Securix Linux
Hardening Linux and introducing Securix Linux
 
Linux Security Overview
Linux Security OverviewLinux Security Overview
Linux Security Overview
 
OffensiveCon2022: Case Studies of Fuzzing with Xen
OffensiveCon2022: Case Studies of Fuzzing with XenOffensiveCon2022: Case Studies of Fuzzing with Xen
OffensiveCon2022: Case Studies of Fuzzing with Xen
 
Spectre meltdown performance_tests - v0.3
Spectre meltdown performance_tests - v0.3Spectre meltdown performance_tests - v0.3
Spectre meltdown performance_tests - v0.3
 
Fuzzing_with_Xen.pdf
Fuzzing_with_Xen.pdfFuzzing_with_Xen.pdf
Fuzzing_with_Xen.pdf
 
I hear you like meshes, here’s a mesh to connect your meshes
I hear you like meshes, here’s a mesh to connect your meshesI hear you like meshes, here’s a mesh to connect your meshes
I hear you like meshes, here’s a mesh to connect your meshes
 
Review of Hardware based solutions for trusted cloud computing.pptx
Review of Hardware based solutions for trusted cloud computing.pptxReview of Hardware based solutions for trusted cloud computing.pptx
Review of Hardware based solutions for trusted cloud computing.pptx
 
Softcore processor.pptxSoftcore processor.pptxSoftcore processor.pptx
Softcore processor.pptxSoftcore processor.pptxSoftcore processor.pptxSoftcore processor.pptxSoftcore processor.pptxSoftcore processor.pptx
Softcore processor.pptxSoftcore processor.pptxSoftcore processor.pptx
 
Advanced performance troubleshooting using esxtop
Advanced performance troubleshooting using esxtopAdvanced performance troubleshooting using esxtop
Advanced performance troubleshooting using esxtop
 
My First 100 days with an Exadata (PPT)
My First 100 days with an Exadata (PPT)My First 100 days with an Exadata (PPT)
My First 100 days with an Exadata (PPT)
 
Wintel Hell: průvodce devíti kruhy Dantova technologického pekla / MARTIN HRO...
Wintel Hell: průvodce devíti kruhy Dantova technologického pekla / MARTIN HRO...Wintel Hell: průvodce devíti kruhy Dantova technologického pekla / MARTIN HRO...
Wintel Hell: průvodce devíti kruhy Dantova technologického pekla / MARTIN HRO...
 
High end security for low-end microcontrollers
High end security for low-end microcontrollersHigh end security for low-end microcontrollers
High end security for low-end microcontrollers
 
Your House is My House: Use of Offensive Enclaves In Adversarial Operations
Your House is My House: Use of Offensive Enclaves In Adversarial OperationsYour House is My House: Use of Offensive Enclaves In Adversarial Operations
Your House is My House: Use of Offensive Enclaves In Adversarial Operations
 
DevDay: Managing Private Algorithms in SGX Enclaves, University of Oxford
DevDay: Managing Private Algorithms in SGX Enclaves, University of OxfordDevDay: Managing Private Algorithms in SGX Enclaves, University of Oxford
DevDay: Managing Private Algorithms in SGX Enclaves, University of Oxford
 

Plus de The Linux Foundation

Plus de The Linux Foundation (20)

ELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made SimpleELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made Simple
 
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
 
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
 
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
 
XPDDS19 Keynote: Unikraft Weather Report
XPDDS19 Keynote:  Unikraft Weather ReportXPDDS19 Keynote:  Unikraft Weather Report
XPDDS19 Keynote: Unikraft Weather Report
 
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
 
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, XilinxXPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
 
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
 
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, BitdefenderXPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
 
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
 
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
 OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making... OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
 
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, CitrixXPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
 
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltdXPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
 
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
 
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&DXPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
 
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM SystemsXPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
 
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
 
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
 
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
 
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSEXPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

XPDDS17: Introduction to Intel SGX and SGX Virtualization - Kai Huang, Intel

  • 1. INTEL RESTRICTED SECRET1 SSG System Software Division Introduction to SGX (Software Guard Extensions) and SGX Virtualization Kai Huang, Jun Nakajima (Speaker) July 12, 2017
  • 2. INTEL RESTRICTED SECRET2 SSG System Software Division Agenda • SGX Introduction • Xen SGX Virtualization Support • Backup
  • 3. INTEL RESTRICTED SECRET3 SSG System Software Division SGX: Reduce TCB to “HW + Enclave” App App App OS VMM Hardware App OS VMM Hardware Enclave Attack Surface Today Attack Surface with Enclave Enclave: • A protected container in App’s address space (ring 3). • Even privileged SW cannot access enclave directly. • Reduce TCB to “HW + Enclave” è App gets its own capability of protection
  • 4. INTEL RESTRICTED SECRET4 SSG System Software Division SGX: Prevent Memory Snooping Attacks • Security perimeter is the CPU package boundary • Data and code unencrypted inside CPU package • Data outside CPU package is encrypted and/or integrity checked • External memory reads and bus snooping only see encrypted data CPU MEE12345678 jco3lks937w Snoop Snoop Memory Bus System Memory *MEE: SGX Memory Encryption Engine
  • 5. INTEL RESTRICTED SECRET5 SSG System Software Division SGX Enclave • Enclave – Trusted Execution Environment embedded in application – Provides confidentiality and/or integrity – With it’s own code/data. – With controlled entry points – Multiple threads supported • EPC (Enclave Page Cache) – Trusted Memory to commit enclave (via page table) – With additional access check – Typically reserved by BIOS as Processor Reserved Memory – Along with EPCM with limited size (ex, 32M, 64M, 128M) • New SGX instructions to manage/access Enclave – ENCLS, ENCLU. OS Enclave APP stack APP code Enclave stack Enclave heap Enclave code Memory EPC Page table mapping EPCM * EPCM (Enclave Page Cache Map) : Used by HW to track EPC status (not-visible to SW)
  • 6. INTEL RESTRICTED SECRET6 SSG System Software Division Instruction Behavior Changes in Enclave • Invalid Instructions • Behavior Changes – RDTSC, RDTSCP: Only legal when SGX2 is available. – RDRAND, RDSEED, PAUSE: May cause VMEXIT – INVD: #UD in enclave – INT3
  • 7. INTEL RESTRICTED SECRET7 SSG System Software Division SGX Application Flow 2. Create enclave 3. CallTrusted () 4. Process secrets 5. Return 6. Cont Untrusted part Trusted part (Enclave) Call Bridge1. Define and partition App to untrusted and trusted part. 2. App creates enclave 3. Trusted function is called; 4. Code in enclave process secrets. 5. Trusted function returns. 6. App continues normal execution. 1. Partition SGX App OS, VMM, BIOS, SMM,…
  • 8. INTEL RESTRICTED SECRET8 SSG System Software Division Agenda • SGX Introduction • Xen SGX Virtualization Support • Backup
  • 9. INTEL RESTRICTED SECRET9 SSG System Software Division Virtualizing SGX • General Enabling – Pretty Straightforward – Discover SGX and Manage EPC in Hypervisor – Expose part of the host EPC to guest – Size: configurable from user – Base: calculated internally – SGX CPUID/MSR emulation – Setup EPT mapping for guest EPC and host EPC. – ENCLS and ENCLU runs perfectly in non-root mode. • EPC Virtualization Approaches – Static Partitioning – Oversubscription – Ballooning
  • 10. INTEL RESTRICTED SECRET10 SSG System Software Division SGX Interaction with VMX • New ENCLS VMEXIT – New bit in secondary exec control to enable ENCLS VMEXIT – New 64-bit bitmap to control which ENCLS leaves will trigger VMEXIT • New bits to indicate whether VMEXIT (any) is from Enclave – Bit 27 in exit_reason – Bit 4 in GUEST_INTERRUPTBILITY_INFO.
  • 11. INTEL RESTRICTED SECRET11 SSG System Software Division Enclave SGX App ACPI/CPUID/MSR EPT mapping Xen SGX App Notify - EPC base - EPC size Enclave Xen SGX Virtualization Support Guest EPC SGX driver * EPT Violation * ENCLS Emulation Dom0 HVM XL Tools memory = 1024 epc = 64M … Kernel EPT Violation handler ENCLS Emulation handler Host EPCEPC Management Exposing EPCPopulate EPC * ENCLS emulation & EPT violation may not needed, depending on implementation of EPC virtualization Hypervisor Changes
  • 12. INTEL RESTRICTED SECRET12 SSG System Software Division EPC Virtualization Approaches (3) Pros Cons Static Partitioning • Easy implementation (no ENCLS trapping/emulation, No EPT violation) • No hypervisor overhead Potential inefficient use of EPC Ballooning • Pros of “static partitioning” • More efficient use of EPC Require ballooning driver in guest Oversubscription More efficient use of EPC • Complicated implementation • Higher hypervisor overhead • We have preliminary patches on github with “static partitioning” implemented. • Oversubscription vs Ballooning?
  • 13. INTEL RESTRICTED SECRET13 SSG System Software Division Questions?