Virtual CPU Validation
Nadav Amit, Dan Tsafrir, Assaf Schuster Ahmad Ayoub, Eran Shlomo
Virtual CPU Validation Nadav Amit, Dan Tsafrir, Assaf Schuster - - PowerPoint PPT Presentation
Virtual CPU Validation Nadav Amit, Dan Tsafrir, Assaf Schuster Ahmad Ayoub, Eran Shlomo Question Your video server freezes once a month. Why? OS, drivers, BIOS CPU, hardware Virus / Hack Cosmic rays / Power Anything else?
Nadav Amit, Dan Tsafrir, Assaf Schuster Ahmad Ayoub, Eran Shlomo
Your video server freezes
Anything else?
0% 20% 40% 60% 80% 2011 2012 2013 2014 2015
Virtualized Workloads Year
but SW is still there
its bugs have the greatest impact
application OS CPU hypervisor
Micro-hypervisors [Steinberg’10] Reduced trusted-computing base, not hypervisor code Formal Verification [Leinenbach’09] No formal model of CPU Fuzzing [Martigonini’12] No knowledge of CPU semantics
tools
should be able to find bugs in virtual CPUs
VCPUs
Generator
Test Initialization Random code & Test templates Completion
Loader Generator SUT CPU
Test Test Res. Debug Tools
virtualization features
Unit v3
Generator
Test
Vloader SUT CPU Test Res. Debug Tools
hypervisor monitor protocol
I/O instructions
instruction emulator 62%
7% local APIC 6% model specific registers 7% task switch 4% reset 5% debug 9%
Emulating instructions that access emulated devices
Restricted guest; shadow page tables
Migration between AMD and Intel
following specifications
be improved
not following specifications 78% coding errors 15% unclear documentation 7%
vCPU0 (4) Emulate “buggy” instruction “MOV R8, [HPET]” (1) Execute MMIO instruction hypervisor “SYSENTER” vCPU1 “SYSENTER” (3) write a “buggy” instruction (2) VM-exit “SYSENTER”
Exploiting CVE-2015-0239 – potential privilege escalation
freeze
Both cannot be kept
New Problem in Real-Mode: FIP = (FCS << 4) | FIP
FCS FIP FIP 32-bit 64-bit FCS FIP 64-bit CPU 16-bit
assumed