SlideShare a Scribd company logo
Memory Deduplication
                   as a Threat to the Guest OS

                          Kuniyasu Suzaki, Kengo Iijima,
                            Toshiki Yagi, Cyrille Artho



           Research Center for Information Security



EuroSec 2011 at Salzburg, April 10
Background 1/2
• IaaS (Infrastructure as a Service) type cloud
  computing hosts many virtual machines.
   – Examples: Amazon EC2, Rackspace, ...
   – Physical resources (Memory/Storage) are very important.
• Image of guest OS are provided by IaaS venders.
   – Most contents are same.
• Deduplication technique is utilized to share same
  contents and reduces consumption of physical
  resources.
Background 2/2
• Unfortunately memory deduplication has access time
  difference between non-deduplicated pages and
  deduplicated pages, caused by Copy-On-Write.
• Attacker can use this phenomena for memory
  disclosure attack .
• Our paper presents real attack to a Guest OS
  (Windows and Linux).
Contents
1) Background
2) Memory deduplication
3) Memory disclosure attack
4) Experiments
5) Discussion and Conclusion
Memory Deduplication 1/2
• Memory deduplication is a technique to share same
  contents page.
   – Mainly used for virtual machines.
   – Very effective when same guest OS runs on several virtual
     machines.
• Many virtual machine monitors include deduplication
• Implementations may differ
                             Guest Pseudo Memory
                       VM1           VM2              VM(n)




                               Real Physical Memory
Memory Deduplication 2/2
• Content-aware deduplication
  – Transparent Page Sharing on Disco [OSDI97]
  – Satori on Xen[USENIX09]
• Periodical memory-scan dedpulication
  – Content-Based Page Sharing on VMWare ESX [SOSP02]
  – Differential Engine on Xen[OSDI08]
  – KSM (Kernel Samepage Merging) [LinuxSymp09]
     • General-purpose memory deduplication for Linux.
     • Used mainly for KVM.


• Our paper uses KSM with KVM virtual machine.
KSM: Kernel Samepage Merging
• KSM has 3 states for pages.
   – Volatile : contents change frequently (not to be candidate)
   – Unshared: candidate pages for deduplication
   – Shared: deduplicated pages
• Pages are scanned (default: 20msec)
   – All pages are not scanned at a time.
   – The maximum is 25% of the available memory.
   – The time to be deduplicated depends on the situation.
• Write accesses to deduplicated pages are managed
  by Copy-On-Write.
Copy-On-Write (COW)
• When a write access is issued to a deduplicated page, a
  fresh copy is created, which accepts write access.
• Write access time difference between deduplicateted
  and non-deduplicated pages due to copying.
• A kind of Covert Channel of COW

       Guest Pseudo Memory
            VM1              VM2          Write Access   VM1        VM2
            (victim)         (attacker)                  (victim)   (attacker)




        Real Physical Memory                                              Re-created page cases
                                                                          access time difference
Memory Disclosure Attack
• Attacker can use write access time difference to guess
  memory contents on a victim’s VM.

 Basic idea for memory disclosure attack
   • Allocate same contents pages on memory of
      attacker’s VM.
   • Wait to be deduplicaed
   • Issue write access to the pages. When the pages
      are deduplicated, the write access time is longer
      than normal.

• Used to detect a process or an open file on victim’s VM
Implementation detail 1/2
(1) Get memory image of victim VM
  – To detect a process
     • An executable binary file is used, because a loader (ex. ld-
       linux.so) loads most parts of binary file without change.
     • The last page which is less than 4KB is not target of
       matching, because the tail of 4KB may include arbitrary
       contents on the memory.
  – To detect an opened file
     • Normal file is used. It is saved in page cache without change.
Implementation detail 2/2
(2) Compare time difference
• Write one byte on each target page and measure the access
  time.
• Compare the time with the access time measured already
  – zero-cleared (dedupicated) and random data (non-deduplicated).


• Length of waiting time
   – Depends on size of memory for memory scan type.
Problems on implementation
• Memory disclosure attack for memory deduplication
  looks simple, but there are some problems.
  – 4KB Alignment problem
     • Caused by memory allocation strategy
  – Self-reflection problem
     • Caused by memory management on cache and heap
  – Run time modification problem
     • Caused by ASLR, swap-out, etc
4KB alignment problem
• On victim’s VM
  – A binary file is loaded with 4KB alignment.
  – Opened file is cached with 4KB alignment.
• On Attacker’s VM
  – Attacker loads the matching contents on his heap memory.
  – The contents MUST be loaded on 4KB alignment.
     • Attacker can use posix_memalign() to get aligned memory region.
Self-reflection problem 1/2
• Contents of opened file by attacker’s program are stored
  on page cache memory by Linux kernel.
• Attacker loads the matching contents on his heap memory.
• The heap memory contents is deduplicated to the page
  cache memory contents on a VM! [self-reflection problem]
                  attacker’s program              memory on attacker’s VM
  matching
                                                Un-control by
  target file      …                         attacker’s program     page
                   open();                                          cache
                                           Contents stored
                   …                       on page cache
                   posix_memalign();
                   read();                                          heap    Same contents
                                          Contents stored
                   …                      on heap memory
                                                                            are deduplicated
                                                                            on self memory
                   gettimeofday();
                   # write data to heap
                                          access time is delayed with
                   gettimeofday();        self memory deduplication
Self-reflection problem 2/2
• Image on heap and page cache must be different.
• We gzipped the target file and expand it at run time.
   – The contents on page cache is gzipped image.



                    attacker’s program            memory on attacker’s VM
 matching target
                                                Un-control by
 file with gziped   …                        attacker’s program   page
                    gzopen();                                     cache
                                           Contents stored
                    …                      on page cache
                    posix_memalign();
                                                                            different contents
                    gzread();                                     heap
                                           Contents stored
                    …                      on heap memory
                    gettimeofday();                                       Deduplicated with
                    # write data to heap                                  memory on other VM
                    gettimeofday();
Run time modification problem
• Some parts of code are modified at run time, and cause
   – False-negative
      • ASLR (Address Space Layout Randomization)
          – Modern kernel has this security function. (after Linux2.6.12, after
            Windows VISTA)
          – Most text parts are not changed. Even if the pages are scattered, the unit is
            4KB. The memory disclosure attack does not care ASLR.
      • Swap-out
      • Self modification code
          – Not used by normal applications.
   – False-positive
      • Pre-load mechanism
      • Common 4KB Code
Summary of memory disclosure attack
• The memory disclosure attack is 4KB aligned exact
  matching.
• Limitation
   – Attacker can know
      • existence of process.
      • opened or downloaded file.
   – Attacker doesn’t know
      • termination of process because of un-cleared page cache.
      • which virtual machine has the contents.
   – Noises cause false-negative and false-positive.
      • Include timing of deduplication
Experiments
• The memory disclosure attack runs on KSM with
  KVM(0.12.4). The host linux kernel is 2.6.33.5.
• Victim’s VM
   – Guest OS: Debian GNU Linux and WindowsXP
   – Target applications
      • apache2 and sshd on Debian GNU Linux
      • Internet Explore6 and FireFox on WindowsXP
• Attacker’s VM
   – Guest OS: Debian GNU Linux
   – Assume to know invocation of application
   – Wait 5 minutes after target application is invoked
Attack for Apache2 and sshd on Linux
                                     Average (us)          zero   Random   Apache2
Apache2 ELF file 365,308B (89*4KB)   Before invocation     6.45   0.37     0.53
                                     After invocation      6.24   0.40     7.56




          Before invocation                         After invocation
                                     Average (us)          zero   random    sshd
sshd ELF file 438,852B (107*4KB)     Before invocation     6.60   0.55      0.45
                                     After invocation      6.51   0.42      7.50


                                      Non-deduplicated
                                     Timimng? swap-out?
                                      Code modification?




          Before invocation                         After invocation
Attack for Firefox and IE6 on WindowsXP
                                                 Average (us)        zero   random   Firefox
Firefox binary file 912,334B (222*4KB)           Before invocation   6.45   0.43     1.92
                                                 After invocation    6.49   0.37     7.68


             Deduplicated
           Common 4KB Code?
              Pre-load?




            Before invocation                                 After invocation
                                                Average (us)         zero   random    IE6
                                                Before invocation    6.59   0.27      5.68
IE6 binary file 93,184B (22*4KB)                After invocation     6.32   0.68      7.00


                                   IE6 has special
                                    optimization?




            Before invocation                                 After invocation
Detect downloaded file

• The memory disclosure attack can also be applied to
  find an opened file on a victim’s VM.
• We confirm that the “Google logo” file can be
  detected if page caching is enabled on Firefox.
• This disclosure attack is dangerous, because it detects
  a view of Home Page, even if the network is
  encrypted by TLS/SSL.
Countermeasure
• Satori[USENIX ATC’09] has a mechanism to refuse
  memory deduplication for each page.
   – Applications have to control its memory.
• Overshadow [ASPLOS’08] and SP3 [Vee’08] encrypt
  memory.
   – Unfortunately it ruins effect of memory deduplication.


• We plan to develop memory deduplication for read-only
  pages.
   – It requires to monitor page table of Guest OS.
Discussion
• Security function (memory sanitization) on Guest OS
  helps the memory disclosure attack
   – Because it tells termination of process.
• The memory disclosure attack can be used for security
  education.
   – Detect hidden process.
   – Data life time is longer than we expect [USENIX Security’05
     and ATC’06].
• The memory disclosure attack does not violate any SLA
  on cloud computing. It just measure access time.
Related Work
• Cross VM Side Channel Attack, “Hey, you, get off of
  my cloud” [CCS’09]
   – Monitor the behavior of a physically shared cache of multi-
     cores (hyper threads)
• Cold-boot attack [USENIX Security’08]
   – a kind of physical side channel attack, which freezes physical
     memory and scans the data.
Conclusion
• We presented memory disclose attack on memory
  deduplication which use write access time difference on
  Copy-On-Write.
• Experiments detected
   – Existence of apache2 and sshd on Linux,
   – IE6 and Firefox on WindowsXP,
   – downloaded file in the Firefox browser.
• Countermeasures and applicable usage are mentioned.

More Related Content

PDF
Reinforcement Learning 1. Introduction
PDF
Reinforcement Learning 4. Dynamic Programming
PPTX
Artificial neural network
PPTX
MySQL Optimizer Overview
PDF
Reinforcement Learning 8: Planning and Learning with Tabular Methods
PDF
Inverse Reinforcement Learning Algorithms
PDF
Introduction of Deep Reinforcement Learning
PDF
ClickHouse materialized views - a secret weapon for high performance analytic...
Reinforcement Learning 1. Introduction
Reinforcement Learning 4. Dynamic Programming
Artificial neural network
MySQL Optimizer Overview
Reinforcement Learning 8: Planning and Learning with Tabular Methods
Inverse Reinforcement Learning Algorithms
Introduction of Deep Reinforcement Learning
ClickHouse materialized views - a secret weapon for high performance analytic...

What's hot (17)

PPT
Concetti di base (per iniziare)
PDF
강화학습 기초부터 DQN까지 (Reinforcement Learning from Basics to DQN)
DOCX
How to plant indoor plants in containers
PDF
강화 학습 기초 Reinforcement Learning an introduction
PPTX
Artificial neural network
PDF
Advanced Apache Spark Meetup Project Tungsten Nov 12 2015
PDF
Deep Reinforcement Learning: Q-Learning
PPTX
Neural network for machine learning
PPT
Magical Number Seven, by George Miller
PDF
Cs231n 2017 lecture9 CNN Architecture
PPTX
Artificial neural network
PPTX
Batch normalization presentation
PDF
Lecture 1: Deep Learning for Computer Vision
PDF
“Deploying PyTorch Models for Real-time Inference On the Edge,” a Presentatio...
PPTX
Artificial neural network
PDF
Recurrent Neural Networks
PDF
알아두면 쓸데있는 신기한 강화학습 NAVER 2017
Concetti di base (per iniziare)
강화학습 기초부터 DQN까지 (Reinforcement Learning from Basics to DQN)
How to plant indoor plants in containers
강화 학습 기초 Reinforcement Learning an introduction
Artificial neural network
Advanced Apache Spark Meetup Project Tungsten Nov 12 2015
Deep Reinforcement Learning: Q-Learning
Neural network for machine learning
Magical Number Seven, by George Miller
Cs231n 2017 lecture9 CNN Architecture
Artificial neural network
Batch normalization presentation
Lecture 1: Deep Learning for Computer Vision
“Deploying PyTorch Models for Real-time Inference On the Edge,” a Presentatio...
Artificial neural network
Recurrent Neural Networks
알아두면 쓸데있는 신기한 강화학습 NAVER 2017
Ad

Similar to EuroSec2011 Slide "Memory Deduplication as a Threat to the Guest OS" by Kuniyasu Suzaki (20)

PDF
EuroSec2012 "Effects of Memory Randomization, Sanitization and Page Cache on ...
PDF
Vmreport
PDF
Usenix security10-rump session-suzaki
PDF
Usenix security10-rump session-suzaki
PDF
Linux Memory Analysis with Volatility
PDF
Controlling Memory Footprint at All Layers: Linux Kernel, Applications, Libra...
PDF
ASPLOS2011 workshop RESoLVE "Effect of Disk Prefetching of Guest OS "
PDF
Hot sec10 slide-suzaki
PDF
Manipulating Memory for Fun & Profit
PDF
Manipulating Memory for Fun and Profit
PDF
Manipulating memory for fun and profit
PDF
Manipulating memory for fun and profit
PDF
You Can Run but You Can’t Read: Preventing Disclosure Exploits in Executable ...
PDF
You suck at Memory Analysis
PDF
Virtual memory 20070222-en
PPTX
Windows memory management
PPTX
File System Implementation & Linux Security
PPT
Software security
PPT
Mac Memory Analysis with Volatility
PPT
Nachos 2
EuroSec2012 "Effects of Memory Randomization, Sanitization and Page Cache on ...
Vmreport
Usenix security10-rump session-suzaki
Usenix security10-rump session-suzaki
Linux Memory Analysis with Volatility
Controlling Memory Footprint at All Layers: Linux Kernel, Applications, Libra...
ASPLOS2011 workshop RESoLVE "Effect of Disk Prefetching of Guest OS "
Hot sec10 slide-suzaki
Manipulating Memory for Fun & Profit
Manipulating Memory for Fun and Profit
Manipulating memory for fun and profit
Manipulating memory for fun and profit
You Can Run but You Can’t Read: Preventing Disclosure Exploits in Executable ...
You suck at Memory Analysis
Virtual memory 20070222-en
Windows memory management
File System Implementation & Linux Security
Software security
Mac Memory Analysis with Volatility
Nachos 2
Ad

More from Kuniyasu Suzaki (20)

PDF
RISC-Vのセキュリティ技術(TEE, Root of Trust, Remote Attestation)
PDF
遠隔デバイスとの信頼を築くための技術とその標準(TEEP RATS)
PDF
IETF111 RATS: Remote Attestation ProcedureS 報告
PDF
Slide presented at FIT 2021 Top Conference (Reboot Oriented IoT, ACSAC2021)
PDF
ACSAC2020 "Return-Oriented IoT" by Kuniyasu Suzaki
PDF
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
PDF
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)
PDF
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
PDF
RISC-V-Day-Tokyo2018-suzaki
PDF
BMC: Bare Metal Container @Open Source Summit Japan 2017
PDF
USENIX NSDI17 Memory Disaggregation
PDF
Io t security-suzki-20170224
PDF
”Bare-Metal Container" presented at HPCC2016
PDF
Kernel Memory Protection by an Insertable Hypervisor which has VM Introspec...
PDF
Report for S4x14 (SCADA Security Scientific Symposium 2014)
PDF
Slide used at ACM-SAC 2014 by Suzaki
PDF
OSセキュリティチュートリアル
PDF
Nested Virtual Machines and Proxies
PDF
Bitvisorをベースとした既存Windowsのドライバメモリ保護
PDF
Security on cloud storage and IaaS (NSC: Taiwan - JST: Japan workshop)
RISC-Vのセキュリティ技術(TEE, Root of Trust, Remote Attestation)
遠隔デバイスとの信頼を築くための技術とその標準(TEEP RATS)
IETF111 RATS: Remote Attestation ProcedureS 報告
Slide presented at FIT 2021 Top Conference (Reboot Oriented IoT, ACSAC2021)
ACSAC2020 "Return-Oriented IoT" by Kuniyasu Suzaki
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
RISC-V-Day-Tokyo2018-suzaki
BMC: Bare Metal Container @Open Source Summit Japan 2017
USENIX NSDI17 Memory Disaggregation
Io t security-suzki-20170224
”Bare-Metal Container" presented at HPCC2016
Kernel Memory Protection by an Insertable Hypervisor which has VM Introspec...
Report for S4x14 (SCADA Security Scientific Symposium 2014)
Slide used at ACM-SAC 2014 by Suzaki
OSセキュリティチュートリアル
Nested Virtual Machines and Proxies
Bitvisorをベースとした既存Windowsのドライバメモリ保護
Security on cloud storage and IaaS (NSC: Taiwan - JST: Japan workshop)

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Empathic Computing: Creating Shared Understanding
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Electronic commerce courselecture one. Pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation theory and applications.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
A Presentation on Artificial Intelligence
Encapsulation_ Review paper, used for researhc scholars
MYSQL Presentation for SQL database connectivity
Digital-Transformation-Roadmap-for-Companies.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Reach Out and Touch Someone: Haptics and Empathic Computing
Network Security Unit 5.pdf for BCA BBA.
Review of recent advances in non-invasive hemoglobin estimation
Empathic Computing: Creating Shared Understanding
The Rise and Fall of 3GPP – Time for a Sabbatical?
Per capita expenditure prediction using model stacking based on satellite ima...
Electronic commerce courselecture one. Pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Understanding_Digital_Forensics_Presentation.pptx
Machine learning based COVID-19 study performance prediction
Encapsulation theory and applications.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Agricultural_Statistics_at_a_Glance_2022_0.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
cuic standard and advanced reporting.pdf
A Presentation on Artificial Intelligence

EuroSec2011 Slide "Memory Deduplication as a Threat to the Guest OS" by Kuniyasu Suzaki

  • 1. Memory Deduplication as a Threat to the Guest OS Kuniyasu Suzaki, Kengo Iijima, Toshiki Yagi, Cyrille Artho Research Center for Information Security EuroSec 2011 at Salzburg, April 10
  • 2. Background 1/2 • IaaS (Infrastructure as a Service) type cloud computing hosts many virtual machines. – Examples: Amazon EC2, Rackspace, ... – Physical resources (Memory/Storage) are very important. • Image of guest OS are provided by IaaS venders. – Most contents are same. • Deduplication technique is utilized to share same contents and reduces consumption of physical resources.
  • 3. Background 2/2 • Unfortunately memory deduplication has access time difference between non-deduplicated pages and deduplicated pages, caused by Copy-On-Write. • Attacker can use this phenomena for memory disclosure attack . • Our paper presents real attack to a Guest OS (Windows and Linux).
  • 4. Contents 1) Background 2) Memory deduplication 3) Memory disclosure attack 4) Experiments 5) Discussion and Conclusion
  • 5. Memory Deduplication 1/2 • Memory deduplication is a technique to share same contents page. – Mainly used for virtual machines. – Very effective when same guest OS runs on several virtual machines. • Many virtual machine monitors include deduplication • Implementations may differ Guest Pseudo Memory VM1 VM2 VM(n) Real Physical Memory
  • 6. Memory Deduplication 2/2 • Content-aware deduplication – Transparent Page Sharing on Disco [OSDI97] – Satori on Xen[USENIX09] • Periodical memory-scan dedpulication – Content-Based Page Sharing on VMWare ESX [SOSP02] – Differential Engine on Xen[OSDI08] – KSM (Kernel Samepage Merging) [LinuxSymp09] • General-purpose memory deduplication for Linux. • Used mainly for KVM. • Our paper uses KSM with KVM virtual machine.
  • 7. KSM: Kernel Samepage Merging • KSM has 3 states for pages. – Volatile : contents change frequently (not to be candidate) – Unshared: candidate pages for deduplication – Shared: deduplicated pages • Pages are scanned (default: 20msec) – All pages are not scanned at a time. – The maximum is 25% of the available memory. – The time to be deduplicated depends on the situation. • Write accesses to deduplicated pages are managed by Copy-On-Write.
  • 8. Copy-On-Write (COW) • When a write access is issued to a deduplicated page, a fresh copy is created, which accepts write access. • Write access time difference between deduplicateted and non-deduplicated pages due to copying. • A kind of Covert Channel of COW Guest Pseudo Memory VM1 VM2 Write Access VM1 VM2 (victim) (attacker) (victim) (attacker) Real Physical Memory Re-created page cases access time difference
  • 9. Memory Disclosure Attack • Attacker can use write access time difference to guess memory contents on a victim’s VM. Basic idea for memory disclosure attack • Allocate same contents pages on memory of attacker’s VM. • Wait to be deduplicaed • Issue write access to the pages. When the pages are deduplicated, the write access time is longer than normal. • Used to detect a process or an open file on victim’s VM
  • 10. Implementation detail 1/2 (1) Get memory image of victim VM – To detect a process • An executable binary file is used, because a loader (ex. ld- linux.so) loads most parts of binary file without change. • The last page which is less than 4KB is not target of matching, because the tail of 4KB may include arbitrary contents on the memory. – To detect an opened file • Normal file is used. It is saved in page cache without change.
  • 11. Implementation detail 2/2 (2) Compare time difference • Write one byte on each target page and measure the access time. • Compare the time with the access time measured already – zero-cleared (dedupicated) and random data (non-deduplicated). • Length of waiting time – Depends on size of memory for memory scan type.
  • 12. Problems on implementation • Memory disclosure attack for memory deduplication looks simple, but there are some problems. – 4KB Alignment problem • Caused by memory allocation strategy – Self-reflection problem • Caused by memory management on cache and heap – Run time modification problem • Caused by ASLR, swap-out, etc
  • 13. 4KB alignment problem • On victim’s VM – A binary file is loaded with 4KB alignment. – Opened file is cached with 4KB alignment. • On Attacker’s VM – Attacker loads the matching contents on his heap memory. – The contents MUST be loaded on 4KB alignment. • Attacker can use posix_memalign() to get aligned memory region.
  • 14. Self-reflection problem 1/2 • Contents of opened file by attacker’s program are stored on page cache memory by Linux kernel. • Attacker loads the matching contents on his heap memory. • The heap memory contents is deduplicated to the page cache memory contents on a VM! [self-reflection problem] attacker’s program memory on attacker’s VM matching Un-control by target file … attacker’s program page open(); cache Contents stored … on page cache posix_memalign(); read(); heap Same contents Contents stored … on heap memory are deduplicated on self memory gettimeofday(); # write data to heap access time is delayed with gettimeofday(); self memory deduplication
  • 15. Self-reflection problem 2/2 • Image on heap and page cache must be different. • We gzipped the target file and expand it at run time. – The contents on page cache is gzipped image. attacker’s program memory on attacker’s VM matching target Un-control by file with gziped … attacker’s program page gzopen(); cache Contents stored … on page cache posix_memalign(); different contents gzread(); heap Contents stored … on heap memory gettimeofday(); Deduplicated with # write data to heap memory on other VM gettimeofday();
  • 16. Run time modification problem • Some parts of code are modified at run time, and cause – False-negative • ASLR (Address Space Layout Randomization) – Modern kernel has this security function. (after Linux2.6.12, after Windows VISTA) – Most text parts are not changed. Even if the pages are scattered, the unit is 4KB. The memory disclosure attack does not care ASLR. • Swap-out • Self modification code – Not used by normal applications. – False-positive • Pre-load mechanism • Common 4KB Code
  • 17. Summary of memory disclosure attack • The memory disclosure attack is 4KB aligned exact matching. • Limitation – Attacker can know • existence of process. • opened or downloaded file. – Attacker doesn’t know • termination of process because of un-cleared page cache. • which virtual machine has the contents. – Noises cause false-negative and false-positive. • Include timing of deduplication
  • 18. Experiments • The memory disclosure attack runs on KSM with KVM(0.12.4). The host linux kernel is 2.6.33.5. • Victim’s VM – Guest OS: Debian GNU Linux and WindowsXP – Target applications • apache2 and sshd on Debian GNU Linux • Internet Explore6 and FireFox on WindowsXP • Attacker’s VM – Guest OS: Debian GNU Linux – Assume to know invocation of application – Wait 5 minutes after target application is invoked
  • 19. Attack for Apache2 and sshd on Linux Average (us) zero Random Apache2 Apache2 ELF file 365,308B (89*4KB) Before invocation 6.45 0.37 0.53 After invocation 6.24 0.40 7.56 Before invocation After invocation Average (us) zero random sshd sshd ELF file 438,852B (107*4KB) Before invocation 6.60 0.55 0.45 After invocation 6.51 0.42 7.50 Non-deduplicated Timimng? swap-out? Code modification? Before invocation After invocation
  • 20. Attack for Firefox and IE6 on WindowsXP Average (us) zero random Firefox Firefox binary file 912,334B (222*4KB) Before invocation 6.45 0.43 1.92 After invocation 6.49 0.37 7.68 Deduplicated Common 4KB Code? Pre-load? Before invocation After invocation Average (us) zero random IE6 Before invocation 6.59 0.27 5.68 IE6 binary file 93,184B (22*4KB) After invocation 6.32 0.68 7.00 IE6 has special optimization? Before invocation After invocation
  • 21. Detect downloaded file • The memory disclosure attack can also be applied to find an opened file on a victim’s VM. • We confirm that the “Google logo” file can be detected if page caching is enabled on Firefox. • This disclosure attack is dangerous, because it detects a view of Home Page, even if the network is encrypted by TLS/SSL.
  • 22. Countermeasure • Satori[USENIX ATC’09] has a mechanism to refuse memory deduplication for each page. – Applications have to control its memory. • Overshadow [ASPLOS’08] and SP3 [Vee’08] encrypt memory. – Unfortunately it ruins effect of memory deduplication. • We plan to develop memory deduplication for read-only pages. – It requires to monitor page table of Guest OS.
  • 23. Discussion • Security function (memory sanitization) on Guest OS helps the memory disclosure attack – Because it tells termination of process. • The memory disclosure attack can be used for security education. – Detect hidden process. – Data life time is longer than we expect [USENIX Security’05 and ATC’06]. • The memory disclosure attack does not violate any SLA on cloud computing. It just measure access time.
  • 24. Related Work • Cross VM Side Channel Attack, “Hey, you, get off of my cloud” [CCS’09] – Monitor the behavior of a physically shared cache of multi- cores (hyper threads) • Cold-boot attack [USENIX Security’08] – a kind of physical side channel attack, which freezes physical memory and scans the data.
  • 25. Conclusion • We presented memory disclose attack on memory deduplication which use write access time difference on Copy-On-Write. • Experiments detected – Existence of apache2 and sshd on Linux, – IE6 and Firefox on WindowsXP, – downloaded file in the Firefox browser. • Countermeasures and applicable usage are mentioned.