skip to main content
10.1145/2976749.2978356acmconferencesArticle/Chapter ViewAbstractPublication PagesccsConference Proceedingsconference-collections
research-article

Prefetch Side-Channel Attacks: Bypassing SMAP and Kernel ASLR

Published: 24 October 2016 Publication History

Abstract

Modern operating systems use hardware support to protect against control-flow hijacking attacks such as code-injection attacks. Typically, write access to executable pages is prevented and kernel mode execution is restricted to kernel code pages only. However, current CPUs provide no protection against code-reuse attacks like ROP. ASLR is used to prevent these attacks by making all addresses unpredictable for an attacker. Hence, the kernel security relies fundamentally on preventing access to address information. We introduce Prefetch Side-Channel Attacks, a new class of generic attacks exploiting major weaknesses in prefetch instructions. This allows unprivileged attackers to obtain address information and thus compromise the entire system by defeating SMAP, SMEP, and kernel ASLR. Prefetch can fetch inaccessible privileged memory into various caches on Intel x86. It also leaks the translation-level for virtual addresses on both Intel x86 and ARMv8-A. We build three attacks exploiting these properties. Our first attack retrieves an exact image of the full paging hierarchy of a process, defeating both user space and kernel space ASLR. Our second attack resolves virtual to physical addresses to bypass SMAP on 64-bit Linux systems, enabling ret2dir attacks. We demonstrate this from unprivileged user programs on Linux and inside Amazon EC2 virtual machines. Finally, we demonstrate how to defeat kernel ASLR on Windows 10, enabling ROP attacks on kernel and driver binary code. We propose a new form of strong kernel isolation to protect commodity systems incuring an overhead of only 0.06-5.09%.

References

[1]
ARM Limited. ARM Architecture Reference Manual ARMv8. ARM Limited, 2013.
[2]
A. Barresi, K. Razavi, M. Payer, and T. R. Gross. CAIN: silently breaking ASLR in the cloud. In WOOT'15, 2015.
[3]
D. J. Bernstein. Cache-Timing Attacks on AES. http://cr.yp.to/antiforgery/cachetiming-20050414.pdf, 2004.
[4]
S. Bhattacharya, C. Rebeiro, and D. Mukhopadhyay. Hardware prefetchers leak : A revisit of SVF for cache-timing attacks. In 45th International Symposium on Microarchitecture Workshops (MICRO'12), 2012.
[5]
Y. Chen, Z. Wang, D. Whalley, and L. Lu. Remix: On-demand live randomization. In 6th ACM Conference on Data and Application Security and Privacy, 2016.
[6]
M. Chiappetta, E. Savas, and C. Yilmaz. Real time detection of cache-based side-channel attacks using hardware performance counters. Cryptology ePrint Archive, Report 2015/1034, 2015.
[7]
S. Crane, C. Liebchen, A. Homescu, L. Davi, P. Larsen, A. Sadeghi, S. Brunthaler, and M. Franz. Readactor: Practical code randomization resilient to memory disclosure. In S&P'15, pages 763--780, 2015.
[8]
D. Evtyushkin, D. Ponomarev, and N. Abu-Ghazaleh. Jump Over ASLR: Attacking Branch Predictors to Bypass ASLR. In IEEE/ACM International Symposium on Microarchitecture (MICRO), 2016 (to appear).
[9]
A. Fuchs and R. B. Lee. Disruptive Prefetching: Impact on Side-Channel Attacks and Cache Designs. In Proceedings of the 8th ACM International Systems and Storage Conference (SYSTOR'15), 2015.
[10]
D. Gruss, C. Maurice, and S. Mangard. Rowhammer.js: A Remote Software-Induced Fault Attack in JavaScript. In DIMVA'16, 2016.
[11]
D. Gruss, C. Maurice, K. Wagner, and S. Mangard. Flush+Flush: A Fast and Stealthy Cache Attack. In DIMVA'16, 2016.
[12]
D. Gruss, R. Spreitzer, and S. Mangard. Cache Template Attacks: Automating Attacks on Inclusive Last-Level Caches. In USENIX Security Symposium, 2015.
[13]
D. Gullasch, E. Bangerter, and S. Krenn. Cache Games -- Bringing Access-Based Cache Attacks on AES to Practice. In S&P'11, 2011.
[14]
B. Gülmezoglu, M. S. Inci, T. Eisenbarth, and B. Sunar. A Faster and More Realistic Flush+Reload Attack on AES. In Constructive Side-Channel Analysis and Secure Design (COSADE), 2015.
[15]
N. Herath and A. Fogh. These are Not Your Grand Daddys CPU Performance Counters -- CPU Hardware Performance Counters for Security. In Black Hat 2015 Briefings, 2015.
[16]
R. Hund, T. Holz, and F. C. Freiling. Return-oriented rootkits: Bypassing kernel code integrity protection mechanisms. In USENIX Security Symposium, 2009.
[17]
R. Hund, C. Willems, and T. Holz. Practical Timing Side Channel Attacks against Kernel Space ASLR. In S&P'13, 2013.
[18]
Intel. How to Benchmark Code Execution Times on Intel IA-32 and IA-64 Instruction Set Architectures White Paper, 2010.
[19]
Intel. Intel® 64 and IA-32 Architectures Optimization Reference Manual. 2014.
[20]
Intel. Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 2 (2A, 2B & 2C): Instruction Set Reference, A-Z. 253665, 2014.
[21]
Intel. Intel® 64 and IA-32 Architectures Software Developer's Manual, Volume 3 (3A, 3B & 3C): System Programming Guide. 253665, 2014.
[22]
G. Irazoqui, T. Eisenbarth, and B. Sunar. SA: A Shared Cache Attack that Works Across Cores and Defies VM Sandboxing -- and its Application to AES. In S&P'15, 2015.
[23]
G. Irazoqui, M. S. Inci, T. Eisenbarth, and B. Sunar. Know thy neighbor: Crypto library detection in cloud. Proceedings on Privacy Enhancing Technologies, 1(1):25--40, 2015.
[24]
G. Irazoqui, M. S. Inci, T. Eisenbarth, and B. Sunar. Lucky 13 strikes back. In AsiaCCS'15, 2015.
[25]
Y. Jang, S. Lee, and T. Kim. Breaking Kernel Address Space Layout Randomization with Intel TSX. In CCS'16, 2016 (to appear).
[26]
J. Kelsey, B. Schneier, D. Wagner, and C. Hall. Side Channel Cryptanalysis of Product Ciphers. Journal of Computer Security, 8(2/3):141--158, 2000.
[27]
V. P. Kemerlis, M. Polychronakis, and A. D. Keromytis. ret2dir: Rethinking kernel isolation. In USENIX Security Symposium, pages 957--972, 2014.
[28]
kernel.org. Virtual memory map with 4 level page tables (x86_64). https://www.kernel.org/doc/Documentation/x86/x86_64/mm.txt, May 2009.
[29]
Y. Kim, R. Daly, J. Kim, C. Fallin, J. H. Lee, D. Lee, C. Wilkerson, K. Lai, and O. Mutlu. Flipping bits in memory without accessing them: An experimental study of DRAM disturbance errors. In ISCA'14, 2014.
[30]
Kirill A. Shutemov. Pagemap: Do Not Leak Physical Addresses to Non-Privileged Userspace. https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ab676b7d6fbf4b294bf198fb27ade5b0e865c7ce, Mar. 2015. Retrieved on November 10, 2015.
[31]
P. C. Kocher. Timing Attacks on Implementations of Diffe-Hellman, RSA, DSS, and Other Systems. In Crypto'96, pages 104--113, 1996.
[32]
J. Levin. Mac OS X and IOS Internals: To the Apple's Core. John Wiley & Sons, 2012.
[33]
M. Lipp, D. Gruss, R. Spreitzer, C. Maurice, and S. Mangard. ARMageddon: Last-Level Cache Attacks on Mobile Devices. In USENIX Security Symposium, 2016.
[34]
F. Liu, Y. Yarom, Q. Ge, G. Heiser, and R. B. Lee. Last-Level Cache Side-Channel Attacks are Practical. In S&P'15, 2015.
[35]
C. Maurice, C. Neumann, O. Heen, and A. Francillon. C5: Cross-Cores Cache Covert Channel. In DIMVA'15, 2015.
[36]
Y. Oren, V. P. Kemerlis, S. Sethumadhavan, and A. D. Keromytis. The Spy in the Sandbox: Practical Cache Attacks in JavaScript and their Implications. In CCS'15, 2015.
[37]
D. A. Osvik, A. Shamir, and E. Tromer. Cache Attacks and Countermeasures: the Case of AES. In CT-RSA 2006, 2006.
[38]
D. Page. Theoretical use of cache memory as a cryptanalytic side-channel. Cryptology ePrint Archive, Report 2002/169, 2002.
[39]
PaX Team. Address space layout randomization (aslr). http://pax.grsecurity.net/docs/aslr.txt, 2003.
[40]
M. Payer. HexPADS: a platform to detect "stealth" attacks. In ESSoS'16, 2016.
[41]
C. Percival. Cache missing for fun and profit. In Proceedings of BSDCan, 2005.
[42]
P. Pessl, D. Gruss, C. Maurice, and S. Mangard. Reverse engineering intel DRAM addressing and exploitation. In USENIX Security Symposium, 2016.
[43]
M. E. Russinovich, D. A. Solomon, and A. Ionescu. Windows internals. Pearson Education, 2012.
[44]
M. Seaborn. Exploiting the DRAM rowhammer bug to gain kernel privileges. http://googleprojectzero.blogspot.com/2015/03/exploiting-dram-rowhammer-bug-to-gain.html, March 2015. Retrieved on June 26, 2015.
[45]
M. Seaborn and T. Dullien. Exploiting the DRAM rowhammer bug to gain kernel privileges. In Black Hat 2015 Briefings, 2015.
[46]
H. Shacham, M. Page, B. Pfaff, E. Goh, N. Modadugu, and D. Boneh. On the effectiveness of address-space randomization. In CCS'04, 2004.
[47]
K. Z. Snow, F. Monrose, L. Davi, A. Dmitrienko, C. Liebchen, and A. R. Sadeghi. Just-in-time code reuse: On the effectiveness of fine-grained address space layout randomization. In S&P'13, 2013.
[48]
Y. Tsunoo, T. Saito, and T. Suzaki. Cryptanalysis of DES implemented on computers with cache. In CHES'03, pages 62--76, 2003.
[49]
xenbits.xen.org. page.h source code. http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;hb=refs/heads/stable-4.3;f=xen/include/asm-x86/x86_64/page.h, Mar. 2009.
[50]
Y. Yarom and K. Falkner. Flush+Reload: a High Resolution, Low Noise, L3 Cache Side-Channel Attack. In USENIX Security Symposium, 2014.
[51]
Y. Zhang, A. Juels, M. K. Reiter, and T. Ristenpart. Cross-Tenant Side-Channel Attacks in PaaS Clouds. In CCS'14, 2014.

Cited By

View all
  • (2025)A Container Security Survey: Exploits, Attacks, and DefensesACM Computing Surveys10.1145/371500157:7(1-36)Online publication date: 20-Feb-2025
  • (2024)InSpectre gadgetProceedings of the 33rd USENIX Conference on Security Symposium10.5555/3698900.3698933(577-594)Online publication date: 14-Aug-2024
  • (2024)Chaos: Function Granularity Runtime Address Layout Space Randomization for Kernel ModuleProceedings of the 15th ACM SIGOPS Asia-Pacific Workshop on Systems10.1145/3678015.3680476(23-30)Online publication date: 4-Sep-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
CCS '16: Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security
October 2016
1924 pages
ISBN:9781450341394
DOI:10.1145/2976749
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 24 October 2016

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. ASLR
  2. kernel vulnerabilities
  3. timing attacks

Qualifiers

  • Research-article

Funding Sources

  • EU FP7 programme
  • EU Horizon 2020 programme

Conference

CCS'16
Sponsor:

Acceptance Rates

CCS '16 Paper Acceptance Rate 137 of 831 submissions, 16%;
Overall Acceptance Rate 1,261 of 6,999 submissions, 18%

Upcoming Conference

CCS '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)178
  • Downloads (Last 6 weeks)14
Reflects downloads up to 05 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2025)A Container Security Survey: Exploits, Attacks, and DefensesACM Computing Surveys10.1145/371500157:7(1-36)Online publication date: 20-Feb-2025
  • (2024)InSpectre gadgetProceedings of the 33rd USENIX Conference on Security Symposium10.5555/3698900.3698933(577-594)Online publication date: 14-Aug-2024
  • (2024)Chaos: Function Granularity Runtime Address Layout Space Randomization for Kernel ModuleProceedings of the 15th ACM SIGOPS Asia-Pacific Workshop on Systems10.1145/3678015.3680476(23-30)Online publication date: 4-Sep-2024
  • (2024)SysBumps: Exploiting Speculative Execution in System Calls for Breaking KASLR in macOS for Apple SiliconProceedings of the 2024 on ACM SIGSAC Conference on Computer and Communications Security10.1145/3658644.3690189(64-78)Online publication date: 2-Dec-2024
  • (2024)On Kernel's Safety in the Spectre Era (And KASLR is Formally Dead)Proceedings of the 2024 on ACM SIGSAC Conference on Computer and Communications Security10.1145/3658644.3670332(1091-1105)Online publication date: 2-Dec-2024
  • (2024)ThermalScope: A Practical Interrupt Side Channel Attack Based on Thermal Event InterruptsProceedings of the 61st ACM/IEEE Design Automation Conference10.1145/3649329.3656525(1-6)Online publication date: 23-Jun-2024
  • (2024)Timing Side-Channel Attacks and Countermeasures in CPU MicroarchitecturesACM Computing Surveys10.1145/3645109Online publication date: 7-Feb-2024
  • (2024)SCAFinder: Formal Verification of Cache Fine-Grained Features for Side Channel DetectionIEEE Transactions on Information Forensics and Security10.1109/TIFS.2024.345200219(8079-8093)Online publication date: 2024
  • (2024)Leaky Address Masking: Exploiting Unmasked Spectre Gadgets with Noncanonical Address Translation2024 IEEE Symposium on Security and Privacy (SP)10.1109/SP54263.2024.00158(3773-3788)Online publication date: 19-May-2024
  • (2024)Decoding Attack Behaviors by Analyzing Patterns in Instruction-Based Attacks using gem52024 International Workshop on Rapid System Prototyping (RSP)10.1109/RSP64122.2024.10871078(1-6)Online publication date: 3-Oct-2024
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media