Periscope: an Effective Probing and Fuzzing Framework for the Hardware-OS Boundary

Periscope: an Effective Probing and Fuzzing Framework for the Hardware-OS Boundary

PeriScope: An Effective Probing and Fuzzing Framework for the Hardware-OS Boundary Dokyung Song∗, Felicitas Hetzelty, Dipanjan Dasz, Chad Spenskyz, Yeoul Na∗, Stijn Volckaert∗x, Giovanni Vignaz, Christopher Kruegelz, Jean-Pierre Seiferty, Michael Franz∗ ∗Department of Computer Science, University of California, Irvine ySecurity in Telecommunications, Technische Universitat¨ Berlin zDepartment of Computer Science, University of California, Santa Barbara xDepartment of Computer Science, KU Leuven Abstract—The OS kernel is an attractive target for remote a number of peripheral devices such as a touchscreen display, attackers. If compromised, the kernel gives adversaries full system camera modules, and chipsets supporting various networking access, including the ability to install rootkits, extract sensitive protocols (cellular, Wi-Fi, Bluetooth, NFC, etc.). Peripheral information, and perform other malicious actions, all while devices by different manufacturers have different inner work- evading detection. Most of the kernel’s attack surface is situated ings, which are often proprietary. Device drivers bridge the along the system call boundary. Ongoing kernel protection efforts gap between stable and well-documented operating system have focused primarily on securing this boundary; several capable analysis and fuzzing frameworks have been developed for this interfaces on one side and peripheral devices on the other, purpose. and make the devices available to the rest of the system. However, there are additional paths to kernel compromise Device drivers are privileged kernel components that exe- that do not involve system calls, as demonstrated by several cute along two different trust boundaries of the system. One recent exploits. For example, by compromising the firmware of of these boundaries is the system call interface, which exposes a peripheral device such as a Wi-Fi chipset and subsequently kernel-space drivers to user-space adversaries. The hardware- sending malicious inputs from the Wi-Fi chipset to the Wi-Fi OS interface should also be considered a trust boundary, driver, adversaries have been able to gain control over the kernel without invoking a single system call. Unfortunately, there are however, since it exposes drivers to potentially compromised currently no practical probing and fuzzing frameworks that can peripheral hardware. These peripherals should not be trusted, help developers find and fix such vulnerabilities occurring along because they may provide a remote attack vector (e.g., network the hardware-OS boundary. devices may receive malicious packets over the air), and they typically lack basic defense mechanisms. Consequently, We present PERISCOPE, a Linux kernel based probing peripheral devices have frequently fallen victim to remote ex- framework that enables fine-grained analysis of device-driver ploitation [16], [21], [23], [28], [36], [77]. Thus, a device driver interactions. PERISCOPE hooks into the kernel’s page fault handling mechanism to either passively monitor and log traffic must robustly enforce the hardware-OS boundary, but pro- between device drivers and their corresponding hardware, or gramming errors do occur. Several recently published attacks mutate the data stream on-the-fly using a fuzzing component, demonstrated that peripheral compromise can be turned into PERIFUZZ, thus mimicking an active adversarial attack. PER- full system compromise (i.e., remote kernel code execution) by IFUZZ accurately models the capabilities of an attacker on coaxing a compromised device into generating specific outputs, peripheral devices, to expose different classes of bugs including, which in turn trigger a vulnerability when processed as an input but not limited to, memory corruption bugs and double-fetch in a device driver [22], [24]. bugs. To demonstrate the risk that peripheral devices pose, as well as the value of our framework, we have evaluated PERIFUZZ The trust boundary that separates peripheral subsystems on the Wi-Fi drivers of two popular chipset vendors, where we from kernel drivers is therefore of great interest to security discovered 15 unique vulnerabilities, 9 of which were previously researchers. In this paper, we present PERISCOPE, which to unknown. our knowledge is the first generic framework that facilitates the exploration of this boundary. PERISCOPE focuses on I. INTRODUCTION two popular device-driver interaction mechanisms: memory- Modern electronics often include subsystems manufactured mapped I/O (MMIO) and direct memory access (DMA). The by a variety of different vendors. For example, in a modern key idea is to monitor MMIO or DMA mappings set up by cellphone, besides the main application processor running a the driver, and then dynamically trap the driver’s accesses smartphone operating system such as Android, one might find to such memory regions. PERISCOPE allows developers to register hooks that it calls upon each trapped access, thereby enabling them to conduct a fine-grained analysis of device- driver interactions. For example, one can implement hooks that Network and Distributed Systems Security (NDSS) Symposium 2019 24-27 February 2019, San Diego, CA, USA record and/or mutate device-driver interactions in support of ISBN 1-891562-55-X reverse engineering, record-and-replay, fuzzing, etc. https://dx.doi.org/10.14722/ndss.2019.23176 www.ndss-symposium.org To demonstrate the risk that peripheral devices pose, as well as to showcase versatility of the PERISCOPE framework, Memory Accesses we created PERIFUZZ, a driver fuzzer that simulates attacks originating in untrusted, compromised peripherals. PERIFUZZ Virtual Address Virtual Address traps the driver’s read accesses to MMIO and DMA map- pings, and fuzzes the values being read by the driver. With MMU a compromised device, these values should be considered to Bus Address Physical Address be under an attacker’s control; the attacker can freely modify these values at any time, even in between the driver’s reads. If Physical Main Processor the driver reads the same memory location multiple times (i.e., Registers Memory overlapping fetches [79]) while the data can still be modified by the device, double-fetch bugs may be present [45], [68]. Physical Address PERIFUZZ accurately models this adversarial capability by fuzzing not only the values being read from different memory IOMMU locations, but also ones being read from the same location I/O Virtual Address multiple times. PERIFUZZ also tracks and logs all overlapping Peripheral Device fetches and warns about ones that occurred before a driver Memory-mapped I/O Direct Memory Access Interrupts crash to help identify potential double-fetch bugs. (MMIO) (DMA) Existing work on analyzing device-driver interactions typ- ically runs the entire system including device drivers in a Fig. 1. Hardware-OS interaction mechanisms controlled environment [32], [44], [47], [49], [54], [60], [62], [66], such as QEMU [20] or S2E [33]. Enabling analysis in such an environment often requires developer efforts tailored • A fuzzing framework: We extended PERISCOPE to specific drivers or devices, e.g., implementing a virtual to build PERIFUZZ, a vulnerability discovery tool device or annotating driver code to keep symbolic execution tailored to detect driver vulnerabilities occurring along tractable. In contrast, PERISCOPE uses a page fault based in- the hardware-OS boundary. The tool demonstrates the kernel monitoring mechanism, which works with all devices power of the PERISCOPE framework, and it system- and drivers in their existing testing environment. As long as atizes the exploration of the hardware-OS boundary. the kernel gets recompiled with our framework, PERISCOPE • An overlapping fetch fuzzer: PERIFUZZ fuzzes over- and PERIFUZZ can analyze device-driver interactions with lapping fetches in addition to non-overlapping fetches, relative ease, regardless of whether the underlying device is and warns about overlapping fetches that occurred virtual or physical, and regardless of the type of the device. before a driver crash. A warning observed before a Extending our framework is also straightforward; for example, driver crash may indicate the presence of double-fetch PERIFUZZ accepts any user-space fuzzer, e.g., AFL, as a plug- bugs. in, which significantly reduces the engineering effort required to implement proven fuzzing strategies [25], [26], [30], [31], • Discovered vulnerabilities: As part of our evaluation, [37]. we discovered previously known and unknown vulner- We validated our system by running experiments on the abilities in the Wi-Fi drivers of two of the most promi- software stacks shipping with the Google Pixel 2 and the nent vendors in the market. We responsibly disclosed Samsung Galaxy S6, two popular smartphones on the market at relevant details to the corresponding vendors. the time of development. To simulate remote attacks that would • An open-source tool: We open-sourced our tool1, in occur over the air in a real-world scenario, we focused on the order to facilitate further research exploration of the Wi-Fi drivers of these phones in evaluating our framework. hardware-OS boundary. The Google Pixel 2 and Samsung Galaxy S6 are equipped with Qualcomm and Broadcom chipsets, respectively. These two are arguably the most popular Wi-Fi chipset manufacturers II. BACKGROUND at the time of our experiments. In our experiments, our system identified 15 unique vulnerabilities in two device drivers, out In this section, we provide the technical background nec- of which 9 vulnerabilities were

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    15 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us