Skip to main content

GuardION: Practical Mitigation of DMA-Based Rowhammer Attacks on ARM

Part of the Lecture Notes in Computer Science book series (LNSC,volume 10885)

Abstract

Over the last two years, the Rowhammer bug transformed from a hard-to-exploit DRAM disturbance error into a fully weaponized attack vector. Researchers demonstrated exploits not only against desktop computers, but also used single bit flips to compromise the cloud and mobile devices, all without relying on any software vulnerability.

Since hardware-level mitigations cannot be backported, a search for software defenses is pressing. Proposals made by both academia and industry, however, are either impractical to deploy, or insufficient in stopping all attacks: we present rampage, a set of DMA-based Rowhammer attacks against the latest Android OS, consisting of (1) a root exploit, and (2) a series of app-to-app exploit scenarios that bypass all defenses.

To mitigate Rowhammer exploitation on ARM, we propose guardion, a lightweight defense that prevents DMA-based attacks—the main attack vector on mobile devices—by isolating DMA buffers with guard rows. We evaluate guardion on 22 benchmark apps and show that it has a negligible memory overhead (2.2 MB on average). We further show that we can improve system performance by re-enabling higher order allocations after Google disabled these as a reaction to previous attacks.

This is a preview of subscription content, access via your institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • DOI: 10.1007/978-3-319-93411-2_5
  • Chapter length: 22 pages
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
eBook
USD   59.99
Price excludes VAT (USA)
  • ISBN: 978-3-319-93411-2
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
Softcover Book
USD   79.99
Price excludes VAT (USA)
Fig. 1.
Fig. 2.
Fig. 3.
Fig. 4.
Fig. 5.
Fig. 6.

References

  1. Low-Memory Shrinker API, October 2013. http://www.phonesdevelopers.info/1815288. Accessed 5 May 2017

  2. cookie-butter: Python Script for Making Graphics Performance Charts for an Android App (2016). https://github.com/Turnsole/cookie-butter

  3. Drammer: Native Binary for Testing Android Phones for the Rowhammer Bug (2016). https://github.com/vusec/drammer

  4. Aweke, Z.B., Yitbarek, S.F., Qiao, R., Das, R., Hicks, M., Oren, Y., Austin, T.: ANVIL: software-based protection against next-generation Rowhammer attacks. In: Proceedings of ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2016)

    Google Scholar 

  5. Bosman, E., Razavi, K., Bos, H., Giuffrida, C.: Dedup Est Machina: memory deduplication as an advanced exploitation vector. In: Proceedings of IEEE Symposium on Security and Privacy (S&P) (2016)

    Google Scholar 

  6. Brasser, F., Davi, L., Gens, D., Liebchen, C., Sadeghi, A.R.: CAn’t touch this: practical and generic software-only defenses against Rowhammer attacks, November 2016. arXiv:1611.08396 [cs.CR]

  7. Brasser, F., Davi, L., Gens, D., Liebchen, C., Sadeghi, A.R.: Can’t touch this: practical and generic software-only defenses against Rowhammer attacks. In: Proceedings of USENIX Security Symposium (2017)

    Google Scholar 

  8. Cai, Y., Ghose, S., Luo, Y., Mai, K., Mutlu, O., Haratsch, E.F.: Vulnerabilities in MLC NAND flash memory programming: experimental analysis, exploits, and mitigation techniques. In: Proceedings of International Symposium on High-Performance Computer Architecture (HPCA) (2017)

    Google Scholar 

  9. Cheng, Y., Zhang, Z., Nepal, S.: Still hammerable and exploitable: on the effectiveness of software-only physical kernel isolation, February 2018. arXiv:1802.07060 [cs.CR]

  10. Corbet, J.: Contiguous Memory Allocation for Drivers, July 2010. https://lwn.net/Articles/396702/

  11. Corbet, J.: A Reworked Contiguous Memory Allocator, June 2011. https://lwn.net/Articles/447405/

  12. Frigo, P., Giuffrida, C., Bos, H., Razavi, K.: Grand Pwning unit: accelerating microarchitectural attacks with the GPU. In: Proceedings of IEEE Symposium on Security and Privacy (S&P) (2018)

    Google Scholar 

  13. Google: Testing UI Performance. https://developer.android.com/training/testing/performance.html

  14. Google: ion: Disable ION_HEAP_TYPE_SYSTEM_CONTIG, November 2016. https://android.googlesource.com/device/google/marlin-kernel/

  15. Gorman, M.: Understanding the Linux Virtual Memory Manager. Prentice Hall PTR, Upper Saddle River (2007)

    Google Scholar 

  16. Gruss, D., Maurice, C., Mangard, S.: Rowhammer.js: a remote software-induced fault attack in JavaScript. In: Proceedings of Conference on Detection of Intrusions and Malware & Vulnerability Assessment (DIMVA) (2016)

    Google Scholar 

  17. JEDEC Solid State Technology Association: DDR3 SDRAM Specification. JESD79-3F (2012)

    Google Scholar 

  18. JEDEC Solid State Technology Association: Low Power Double Data 4 (LPDDR4). JESD209-4A (2015)

    Google Scholar 

  19. Kim, Y., Daly, R., Kim, J., Fallin, C., Lee, J.H., Lee, D., Wilkerson, C., Lai, K., Mutlu, O.: Flipping bits in memory without accessing them: an experimental study of DRAM disturbance errors. In: Proceedings of International Symposium on Computer Architecture (ISCA) (2014)

    Google Scholar 

  20. Lanteigne, M.: How Rowhammer Could Be Used to Exploit Weaknesses in Computer Hardware, March 2016. http://www.thirdio.com/rowhammer.pdf

  21. Nazarewicz, M.: A Deep Dive into CMA, March 2012. https://lwn.net/Articles/486301/

  22. Pessl, P., Gruss, D., Maurice, C., Schwarz, M., Mangard, S.: DRAMA: exploiting DRAM addressing for cross-CPU attacks. In: Proceedings of USENIX Security Symposium (2016)

    Google Scholar 

  23. Qiao, R., Seaborn, M.: A new approach for Rowhammer attacks. In: Proceedings of IEEE International Symposium on Hardware Oriented Security and Trust (HOST) (2016)

    Google Scholar 

  24. Razavi, K., Gras, B., Bosman, E., Preneel, B., Giuffrida, C., Bos, H.: Flip Feng Shui: hammering a needle in the software stack. In: Proceedings of USENIX Security Symposium (2016)

    Google Scholar 

  25. Schaller, A., Xiong, W., Salee, M.U., Anagnostopoulos, N.A., Katzenbeisser, S., Szefer, J.: Intrinsic rowhammer PUFs: leveraging the Rowhammer effect for improved security. In: Proceedings of IEEE International Symposium on Hardware Oriented Security and Trust (HOST) (2017)

    Google Scholar 

  26. Seaborn, M., Dullien, T.: Exploiting the DRAM Rowhammer bug to gain kernel privileges. In: Black Hat USA (BH-US) (2015)

    Google Scholar 

  27. Aga, M.T., Aweke, Z.B., Austin, T.: When good protections go bad: exploiting anti-DoS measures to accelerate Rowhammer attacks. In: Proceedings of IEEE International Symposium on Hardware Oriented Security and Trust (HOST) (2017)

    Google Scholar 

  28. van der Veen, V., Fratantonio, Y., Lindorfer, M., Gruss, D., Maurice, C., Vigna, G., Bos, H., Razavi, K., Giuffrida, C.: Drammer: deterministic Rowhammer attacks on mobile platforms. In: Proceedings of ACM Conference on Computer and Communications Security (CCS) (2016)

    Google Scholar 

  29. Vorontsov, A.: Android Low Memory Killer vs. Memory Pressure Notifications, December 2011. https://lkml.org/lkml/2011/12/18/173

  30. Xiao, Y., Zhang, X., Zhang, Y., Teodorescu, M.R.: One bit flips, one cloud flops: cross-VM Rowhammer attacks and privilege escalation. In: Proceedings of USENIX Security Symposium (2016)

    Google Scholar 

  31. Zeng, T.M.: The Android ION Memory Allocator, February 2012. https://lwn.net/Articles/480055

Download references

Acknowledgments

We thank the anonymous reviewers for their valuable comments and input to improve the paper, as well as Pietro Frigo for his help on understanding GLitch.

This work was supported by the Netherlands Organisation for Scientific Research through grants NWO CSI-DHS 628.001.021, by the European Commission through project H2020 ICT-32-2014 “SHARCS” under Grant Agreement No. 644571, the NSF under Award No. CNS-1408632, the ONR under Award No. N00014-17-1-2897, DARPA under agreement number FA8750-15-2-0084, and a Security, Privacy and Anti-Abuse award from Google. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. Any opinions, findings, and conclusions or recommendations expressed in this publication are those of the authors and do not necessarily reflect the views, position, official policies, or endorsements, either expressed or implied, of the U.S. Government, DARPA, ONR, NSF, or Google.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Victor van der Veen .

Editor information

Editors and Affiliations

A RAMpage Attack Details

A RAMpage Attack Details

This section provides additional details on rampage variant r0, our end-to-end exploit that bypasses Google’s deployed defenses against Drammer. We rely on primitives and steps discussed in Sect. 5: how to exhaust the system heap, how to shrink the cache pool, and how to trigger the Low Memory Killer (LMK). We now discuss the remaining steps: how to find exploitable chunks, how to land a page table in the vulnerable page, and how to obtain root access.

With the help of the primitives defined in Sect. 5, we can allocate memory chunks directly from the buddy allocator. We exploit the deterministic behavior of buddy to obtain large contiguous chunks of memory that we then template for exploitable bit flips. Typically, Android ARMv8 devices are configured to use 3 levels of translation tables with 4 KB pages, resulting in 39 bits that are available for virtual addressing. Page table entries are 64  bits wide, but since most devices are shipped with only 4 GB of RAM or less, half of those bits are never used. We thus ignore those during the templating phase.

The exploitation steps for rampage  r0 now involve the following sequence:

  1. 1.

    Exhaust ION memory page pools.

  2. 2.

    Monitor /proc/pagetypeinfo and allocate chunks using ION’s SYSTEM heap with large orders that span at least 3 or more physical rows, e.g., chunks of at least 256 KB if the row size is 64 KB. As soon as ION’s internal pools are drained, we will see each of these large order allocations immediately affecting pagetypeinfo. From this point, each subsequent request for (large) ION chunks is likely to be contiguous as they are being served by buddy directly.

  3. 3.

    Optionally, to confirm that allocated chunks are contiguous, we could either (1) perform double-sided Rowhammer to check if there are any flips, or (2) use the bank-conflict side-channel [12].

  4. 4.

    Template the memory using double-sided Rowhammer to find an exploitable page.

  5. 5.

    Perform Phys Feng Shui so that the large chunk that contains the vulnerable page is split in multiple smaller chunks (of the row size) that we can release individually [28].

  6. 6.

    Confirm that the aggressor rows are still accessible by performing a second templating round.

  7. 7.

    Release the vulnerable row. This will give it back to the ION cache.

  8. 8.

    Perform a cache pool shrink operation. This will release memory from all registered shrinkers—including the ION cache—back to buddy.

  9. 9.

    Perform page table spraying while monitoring /proc/pagetypeinfo until the first chunk of the row size is touched.

  10. 10.

    Allocate page tables until all chunks of the row size are used.

Once page tables using row size chunks are allocated, we could set those page tables with values that point it back to itself when hammered. Once we are able to get access to the page table, we scan the kernel memory for struct cred bytes and overwrite the UID’s to that of root.

Rights and permissions

Reprints and Permissions

Copyright information

© 2018 Springer International Publishing AG, part of Springer Nature

About this paper

Verify currency and authenticity via CrossMark

Cite this paper

van der Veen, V. et al. (2018). GuardION: Practical Mitigation of DMA-Based Rowhammer Attacks on ARM. In: Giuffrida, C., Bardin, S., Blanc, G. (eds) Detection of Intrusions and Malware, and Vulnerability Assessment. DIMVA 2018. Lecture Notes in Computer Science(), vol 10885. Springer, Cham. https://doi.org/10.1007/978-3-319-93411-2_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-93411-2_5

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-93410-5

  • Online ISBN: 978-3-319-93411-2

  • eBook Packages: Computer ScienceComputer Science (R0)