Android Hardware Reverse Engineering

Demystifying PMIC Fault Injection: A Deep Dive into Android Hardware Attack Vectors

Google AdSense Native Placement - Horizontal Top-Post banner

Introduction: The Unseen Power Orchestrator

In the intricate architecture of modern Android devices, the Power Management Integrated Circuit (PMIC) stands as an unsung hero, meticulously orchestrating power delivery to nearly every component. From the SoC to peripherals, the PMIC ensures stable voltage rails, manages battery charging, and handles power state transitions. This critical role, however, also positions the PMIC as a prime target for advanced hardware attacks, specifically fault injection. By subtly manipulating PMIC registers, attackers can induce transient voltage anomalies, leading to powerful hardware-level exploits that might bypass software-based security mechanisms.

This article delves into the principles of PMIC fault injection, exploring how an attacker can leverage register manipulation to induce power glitches and compromise Android device security. We will cover the fundamentals of PMICs, their interaction with the Android kernel, practical attack methodologies, and potential impacts.

Understanding the Power Management Integrated Circuit (PMIC)

A PMIC is a highly integrated chip responsible for controlling and monitoring the power requirements of an electronic system. In Android smartphones, PMICs typically perform a multitude of functions:

  • Voltage Regulation: Generating various voltage rails (e.g., 0.8V for CPU core, 1.8V for I/O, 3.3V for peripherals) using Buck (DC-DC) converters and Low-Dropout (LDO) regulators.
  • Power Sequencing: Ensuring components power up and down in a specific order to prevent damage or instability.
  • Battery Management: Charging, monitoring battery health, and protecting against over-current/over-voltage conditions.
  • Power State Management: Handling sleep, deep sleep, and wake-up events to optimize power consumption.
  • Real-Time Clock (RTC): Providing accurate timekeeping even when the main system is off.

The PMIC communicates with the main System-on-Chip (SoC) typically via an I2C or SPI bus. Through this bus, the SoC (specifically, the kernel and its drivers) can configure the PMIC’s operating parameters, read status registers, and trigger power state changes. This communication channel is the primary attack surface for PMIC fault injection.

Android’s Interaction with the PMIC

On an Android device, the Linux kernel includes drivers specific to the PMIC hardware. These drivers expose interfaces (often through sysfs or dedicated character devices like /dev/i2c-*) that allow higher-level software to interact with the PMIC. Key interactions include:

  • Setting CPU operating frequencies and corresponding voltages (DVFS – Dynamic Voltage and Frequency Scaling).
  • Enabling or disabling power rails for peripherals.
  • Reading battery statistics.
  • Controlling charging parameters.

These interactions are mediated by PMIC-specific registers, which dictate the behavior of its internal voltage regulators, switches, and other modules. An attacker’s goal is to gain control over these registers, either directly or indirectly.

The Principles of Power Fault Injection

Fault injection is a technique used to introduce errors into a system’s execution to uncover vulnerabilities. Power fault injection specifically targets the device’s power supply, aiming to induce transient voltage drops or spikes. When a critical component, like the CPU, experiences a momentary power anomaly, it can misexecute an instruction, skip an instruction, or corrupt data. This can be exploited to:

  • Bypass security checks (e.g., bootloader signature verification).
  • Elevate privileges.
  • Force arbitrary code execution.
  • Corrupt data in memory or storage.

PMIC register manipulation offers a highly granular way to achieve power fault injection. Instead of external hardware requiring precise timing and physical access, register manipulation allows software (often with root privileges or a kernel vulnerability) to trigger internal PMIC events, causing controlled power glitches.

Targeting PMIC Registers for Faults

The most promising targets for fault injection are registers controlling voltage regulators for critical components. For instance:

  • CPU Core Voltage Rails: Temporarily lowering or toggling the voltage for the CPU can induce instruction skips or data corruption during sensitive operations.
  • Memory (RAM) Voltage Rails: Glitching memory voltage can corrupt data in flight or stored in registers, potentially altering program flow.
  • Peripheral Voltage Rails: While less direct for core execution, disrupting power to secure elements or I/O controllers can create side channels or unlock features.

Practical Attack Methodology: PMIC Register Manipulation

Performing PMIC fault injection through register manipulation typically involves several stages:

1. Prerequisites and Reconnaissance

  • Rooted Android Device: Essential for accessing kernel interfaces or loading custom kernel modules.
  • PMIC Datasheet/Documentation: Crucial for understanding register maps, their functions, and default values. Without this, reverse engineering is required.
  • Device Tree Blob (DTB) Analysis: The DTB often contains information about the PMIC, its I2C address, and how it’s connected. You can often extract this from the boot partition.
  • Kernel Driver Analysis: Examining PMIC-related kernel modules (e.g., qcom_pmic for Qualcomm) reveals how the kernel interacts with the hardware.

To identify the PMIC on a device, you might look at dmesg output for PMIC probe messages, or physically inspect the PCB for markings on large power management chips.

adb shell dmesg | grep -i pmic

2. Locating PMIC Interfaces

Most PMICs communicate via I2C. You can identify the I2C bus connected to your PMIC:

adb shell ls -l /dev/i2c-*

This might show several I2C buses. You’ll need to determine which one the PMIC is on, often by checking device tree files or kernel logs for I2C device registrations.

3. Identifying Target Registers and Values

This is the most challenging step without a datasheet. If you have the datasheet, you’d look for registers controlling output voltage, enable/disable switches, or power modes for specific regulators. For example, a CPU core regulator might have a register to set its output voltage.

Let’s assume a hypothetical PMIC where register 0x30 controls the CPU core voltage, and writing 0x00 to it momentarily disables the rail, while 0x01 re-enables it. Or, perhaps, a register 0x31 allows fine-tuning voltage levels from 0.7V to 1.0V.

4. Performing the Injection (Conceptual Example)

With root access, you could use i2c-tools (if available on the device or cross-compiled) to directly write to PMIC registers. This is typically done through the i2cset command.

Suppose the PMIC is on /dev/i2c-2 and its I2C address is 0x48. To momentarily glitch a voltage rail controlled by register 0x30:

# Disable the rail (hypothetical command)adb shell i2cset -f -y 2 0x48 0x30 0x00# Wait for a very short duration (e.g., a few microseconds to milliseconds)# This timing is critical and often requires precise control, like a custom kernel module# Re-enable the rail (hypothetical command)adb shell i2cset -f -y 2 0x48 0x30 0x01

More sophisticated attacks would involve writing a custom kernel module or exploiting a vulnerability to achieve precise timing and avoid issues with user-space latency. A conceptual kernel module might look like this:

#include #include #include #include static struct i2c_client *pmic_client;static int __init pmic_glitch_init(void){    struct i2c_adapter *adapter;    // Assume PMIC is on i2c-2 with address 0x48    adapter = i2c_get_adapter(2);    if (!adapter) {        pr_err(

Android Mobile Specs & Compare Directory

Are you researching mobile hardware properties, processor SoCs, GPU chipsets, or RAM configurations? Access our complete specs catalog to compare up to 5 devices side-by-side!

Compare Devices Specs →
Google AdSense Inline Placement - Content Footer banner