RetSpill: Igniting User-Controlled Data to Burn Away Linux Kernel Protections
Open Access
- 15 November 2023
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 3093-3107
Abstract
Leveraging a control flow hijacking primitive (CFHP) to gain root privileges is critical to attackers striving to exploit Linux kernel vulnerabilities. Such attack has become increasingly elusive as security researchers propose capable kernel security mitigations, leading to the development of complex (and, as a trade-off, brittle and unreliable) attack techniques to regain it. In this paper, we obviate the need for complexity by proposing RetSpill, a powerful yet elegant exploitation technique that employs user space data already present on the kernel stack for privilege escalation. RetSpill exploits the common practice of temporarily storing data on the kernel stack, such as when preserving user space register values during a switch from the user space to the kernel space. We perform a systematic study and identify four common practices that spill user space data to the kernel stack. Although this practice is perfectly within the kernel's security specification, it introduces a new exploitation path when paired with a control flow hijacking (CFH) vulnerability, enabling RetSpill to turn such vulnerabilities directly into privilege escalation reliably. Moreover, RetSpill can bypass many defenses currently deployed in the Linux kernels. To demonstrate the severity of this problem, we collected 22 real-world kernel vulnerabilities and built a semi-automated tool that abuses intentionally-stored, on-stack user space data for kernel exploitation in a semi-automated fashion. Our tool generated end-to-end privilege escalation exploits for 20 out of 22 CFH vulnerabilities. Finally, we propose a new mechanism to defend against the attack.Keywords
Funding Information
- Defense Advanced Research Projects Agency (HR001118C0060, FA8750-19C-0003, N66001-22-C-4026)
- National Science Foundation (CNS-2000792)
- Google (2023 Google PhD Fellowship Program)
This publication has 21 references indexed in Scilit:
- KASLR is Dead: Long Live KASLR2017
- Pure-Call Oriented Programming (PCOP): chaining the gadgets using call instructionsJournal of Computer Virology and Hacking Techniques, 2017
- kR^X2017
- PT-Rand: Practical Mitigation of Data-only Attacks against Page Tables2017
- Unleashing Use-Before-Initialization Vulnerabilities in the Linux Kernel Using Targeted Stack Spraying2017
- UniSan2016
- Fine-Grained Control-Flow Integrity for Kernel Software2016
- Just-In-Time Code Reuse: On the Effectiveness of Fine-Grained Address Space Layout Randomization2013
- Why nothing mattersACM SIGPLAN Notices, 2011
- Jump-oriented programming2011