LEAP: TrustZone Based Developer-Friendly TEE for Intelligent Mobile Apps

Lizhi Sun, Shuocheng Wang, Hao Wu, Yuhang Gong, Fengyuan Xu, Yunxin Liu, Hao Han, Sheng Zhong

TL;DR

This paper introduces LEAP, a developer-friendly Trusted Execution Environment (TEE) for mobile apps that leverages ARM TrustZone. LEAP makes it easier for developers to secure their intelligent mobile applications, particularly those using GPUs, by offering parallel execution, flexible resource management, and an automated tool for adapting existing apps.

What Problem Does This Paper Address?

Mobile devices are increasingly running sophisticated applications, especially those involving AI and deep learning (DL). These applications often handle sensitive data or proprietary models, making them targets for theft or manipulation. ARM's TrustZone technology offers a hardware-backed secure execution environment, but it's notoriously difficult for third-party app developers to use. This is due to its vendor-centric design, high development effort, limited resources within the secure world, and a lack of support for modern mobile app needs like parallel processing and easy peripheral access (e.g., GPUs). Existing solutions built on TrustZone also fall short, often sacrificing performance, flexibility, or ease of adoption. This gap leaves many intelligent mobile apps vulnerable.

Methods

LEAP tackles these challenges by introducing several key developer-friendly features:

  • Lightweight App Sandbox (APP ENV): LEAP uses a novel approach to enforce isolation without full hardware virtualization. It leverages ARM's stage-2 page tables to isolate sandboxed code, minimizing the Trusted Computing Base (TCB) and avoiding hypervisor overhead.
  • Parallel Isolated Environments (U1): LEAP allows multiple sandboxes to run concurrently, enabling parallel processing for demanding tasks.
  • Exclusive Peripheral Access (S2): LEAP provides a mechanism for sandboxed applications to securely access peripherals like GPUs and Wi-Fi. It uses stage-2 page tables to ensure that only one process (either the main OS or a sandbox) can access a peripheral at a time, preventing snooping. For GPUs, which are often in constant use by the main OS, LEAP employs a "suspend" mechanism instead of full unloading to allow secure computation without crashing the system.
  • Flexible Resource Management (U2): LEAP allows sandboxes to dynamically adjust their CPU core and memory allocation based on workload demands, optimizing resource utilization and preventing waste.
  • Automatic App Adapter (DevOps Tool): To simplify adoption, LEAP includes a tool that automatically converts existing DL apps into LEAP-compatible applications. This involves splitting the app into a normal part (pAPP) and a security-critical part (sc-pAPP) containing the DL model and inference code, which then runs in the isolated sandbox.

Datasets

The paper does not explicitly mention training datasets. For evaluation, they used several popular Deep Learning (DL) models: MobileNetv2, GoogleNet, AlexNet, ResNet18, ResNet50, ResNet101, ResNet152, and Inceptionv4. These models were used to benchmark runtime performance for tasks like image classification and encryption.

Key Insights and Ideas

  • Stage-2 Page Tables are Powerful: The paper demonstrates that ARM's stage-2 page tables, typically used for virtualization, can be effectively repurposed for robust isolation and peripheral access control in a TEE context without requiring a full hypervisor.
  • GPU Acceleration in TEE is Achievable: LEAP shows that securing GPU-intensive DL tasks within a TEE is feasible, offering significant performance improvements over solutions that cannot leverage the GPU securely.
  • Developer Experience is Key: The success of TEE solutions hinges on ease of adoption. LEAP's automatic app adapter and focus on familiar development paradigms (like reusing Linux drivers) are crucial for broader adoption.
  • Balancing Security and Usability: LEAP strikes a good balance by providing strong hardware-backed isolation while offering flexible resource management and peripheral access, which are often sacrificed in other TEE solutions.

Key Results

  • Performance Speedup: LEAP achieved an average of 3.57x speedup in supporting intelligent apps using mobile GPU acceleration compared to state-of-the-art solutions.
  • Peripheral Access: LEAP demonstrated significantly better performance than SANCTUARY when accessing the GPU securely, showing 3.91x to 5.01x improvement.
  • Resource Utilization: LEAP achieved 92.13% resource utilization, outperforming SANCTUARY by 1.44x in efficiency for similar resource utilization.
  • Overhead: The overhead introduced by stage-2 translation was negligible, around 2% on average.
  • App Adaptation: The automatic app adapter tool took only 11 seconds to adapt a large DL application.
  • Booting Time: LEAP's booting time was competitive, around 532ms, and lighter than KVM/ARM.

Limitations and Future Work

  • Peripheral Support: LEAP currently has limitations in supporting all types of peripherals, particularly those with complex drivers or shared dependencies (e.g., USB devices). Future work aims to expand support for more devices and enable parallel peripheral sharing.
  • DevOps Tool Generality: The current automatic DevOps tool is primarily designed for DL apps written in Java. Extending it to support other app types, languages (like C/C++), and more complex Android system services is a future goal.
  • Sandbox Density: The exclusive CPU design limits the maximum number of parallel sandboxes. Future work plans to increase sandbox density.
  • Malicious Drivers: The system assumes drivers within the LEAP sandbox are benign. Future work may explore mechanisms to mitigate risks from malicious drivers.

Summary updated

BibTeX
@article{sun2023leap,
  author = {Lizhi Sun and Shuocheng Wang and Hao Wu and Yuhang Gong and Fengyuan Xu and Yunxin Liu and Hao Han and Sheng Zhong},
  title = {{LEAP: TrustZone Based Developer-Friendly TEE for Intelligent Mobile Apps}},
  journal = {IEEE Trans. Mobile Computing},
  year = {2023},
  doi = {10.1109/tmc.2022.3207745},
}
Figure