The ability to emulate isolated code parts in binary low-level system code such as an operating system’s kernel is often both necessary and beneficial from the security analysis point of view, as it significantly reduces the search space to more interesting parts, and also because complete kernel images are very difficult or often impossible to emulate as a whole using existing emulators. In this paper, we consider this problem of emulating isolated code compartments for Android binary kernel images. To this end, we present a framework that allows emulation of device drivers directly from binary Android kernel images by “borrowing” emulated execution context from a running stock Linux kernel. It works by injecting the Android kernel under test into the same memory space as the stock Linux kernel, logically unlinking specific isolated parts from its original kernel, and reattaching them to the stock Linux kernel. We evaluate the correctness of our approach on a set of 56 drivers from 10 different kernels, for which it was successful in borrowing the execution context in all cases. By further extending it with coverage-based fuzzing, we fuzzed a set of 23 IOCTL drivers and discovered 4 zero-day vulnerabilities (some high-severity) which were confirmed by Google’s security team.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Emulating Android Device Drivers via Borrowed Execution Context

  • Alex Le Blanc,
  • Ivan Pustogarov

摘要

The ability to emulate isolated code parts in binary low-level system code such as an operating system’s kernel is often both necessary and beneficial from the security analysis point of view, as it significantly reduces the search space to more interesting parts, and also because complete kernel images are very difficult or often impossible to emulate as a whole using existing emulators. In this paper, we consider this problem of emulating isolated code compartments for Android binary kernel images. To this end, we present a framework that allows emulation of device drivers directly from binary Android kernel images by “borrowing” emulated execution context from a running stock Linux kernel. It works by injecting the Android kernel under test into the same memory space as the stock Linux kernel, logically unlinking specific isolated parts from its original kernel, and reattaching them to the stock Linux kernel. We evaluate the correctness of our approach on a set of 56 drivers from 10 different kernels, for which it was successful in borrowing the execution context in all cases. By further extending it with coverage-based fuzzing, we fuzzed a set of 23 IOCTL drivers and discovered 4 zero-day vulnerabilities (some high-severity) which were confirmed by Google’s security team.