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 · DOI

Abstract

ARM TrustZone is widely deployed on commercial-off-the-shelf mobile devices for secure execution. However, many Apps cannot enjoy this feature because it brings many constraints to App developers. Previous works have been proposed to build a secure execution environment for developers on top of TrustZone. Unfortunately, these works are still not fully-fledged solutions for mobile Apps, especially for emerging intelligent Apps. To this end, we propose LEAP, which is a lightweight developer-friendly TEE solution for mobile Apps. LEAP enables isolated codes to execute in parallel and access peripheral (e.g., mobile GPUs) with ease, flexibly manages system resources upon different workloads, and offers the auto DevOps tool to help developers prepare the codes running on it. We implement the LEAP prototype on the off-the-shelf ARM platform and conduct extensive experiments on it. The experimental results show that Apps can be adapted to run with LEAP easily and efficiently. Compared to the state-of-the-art work along this research line, LEAP can achieve an average 3.57x speedup in supporting intelligent Apps using mobile GPU acceleration.

Introduction

Modern mobile applications, particularly those leveraging Deep Learning (DL), face a significant security-performance trade-off. While ARM TrustZone provides a hardware-backed Trusted Execution Environment (TEE), its rigid constraints—such as limited memory, lack of GPU access, and single-threaded execution—hinder the development of "intelligent" apps. Developers often need to protect proprietary models without sacrificing the performance gains of hardware acceleration.

The Problem: Constraints of Traditional TEEs

Traditional TEEs like OP-TEE are primarily designed for hardware vendors rather than app developers. They impose severe restrictions: memory is often capped at 16MB, and there is no native support for multi-core processing or peripheral access (e.g., GPUs). Existing research solutions often rely on heavy hypervisors that introduce significant performance overhead or fail to provide the resource flexibility required by modern AI workloads.

Comparison of LEAP with existing TEE solutions across key developer-centric features.

As shown in Figure 1, previous works like TrustICE, PrivateZone, and SANCTUARY fail to simultaneously provide parallel environments, lightweight execution, secure I/O, and flexible resource management. LEAP is designed to bridge these gaps by repurposing virtualization hardware for isolation rather than abstraction.

Methods: The LEAP Architecture

LEAP introduces a lightweight, developer-friendly TEE that provides hardware-guaranteed isolation within the "Normal World" (the environment where the primary OS, like Android, resides).

Hypervisor-less Isolation

Unlike virtualization-based solutions that use a full hypervisor, LEAP utilizes ARM’s Stage-2 page tables to create isolated "sandboxes." This approach allows code to run at near-native speeds on bare metal while preventing the Rich OS (ROS) from accessing the sandbox's memory.

LEAP architecture leveraging Stage-2 paging for isolated sandboxes in the Normal World.

Key Technical Innovations

  • Exclusive Peripheral Management: LEAP allows sandboxes to "borrow" hardware like the GPU or WiFi by unmapping the peripheral's Memory-Mapped I/O (MMIO) addresses from the ROS and mapping them exclusively into the sandbox.
  • Dynamic Resource Adjustment: Using Linux’s CPU hotplugging and the Contiguous Memory Allocator (CMA), LEAP can scale CPU cores and memory on the fly to meet workload demands.
  • Automated App Adapter: To lower the barrier to entry, LEAP includes a DevOps tool that uses static program analysis (via the Soot framework) to automatically extract and repackage DL models and inference code into secure sandboxes without requiring source code.

Evaluation and Key Results

The LEAP prototype was evaluated on a Hikey960 development board (Kirin 960 SoC, Mali-G71 GPU) using eight popular CNN models, including MobileNetv2, ResNet, and Inceptionv4.

  • Performance Speedup: LEAP achieved an average 3.57x speedup for GPU-accelerated DL inference compared to the state-of-the-art solution, SANCTUARY.
  • Minimal Overhead: The performance cost of Stage-2 translation is negligible, with a maximum overhead of only 2% on system calls compared to native execution.
  • Efficiency and Usability: LEAP improved memory utilization by 21.74% through dynamic allocation. The App Adapter successfully converted a complex app with 210,000 lines of code in just 11 seconds, requiring minimal manual configuration.

Discussion and Future Work

LEAP demonstrates that virtualization hardware can be used purely for isolation without the "virtualization tax" of a full hypervisor. By focusing on parallelism and peripheral access, it addresses the practical needs of modern mobile developers.

Future work will focus on expanding peripheral support (e.g., complex USB controllers), mitigating the brief GUI freezes that occur during GPU switching, and extending the App Adapter to support native C/C++ libraries.

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