Securing Real-Time Microcontroller Systems through Customized Memory View Switching

Chung Hwan Kim, Taegyu Kim, Hongjun Choi, Zhongshu Gu, Byoungyoung Lee, Xiangyu Zhang, Dongyan XuNDSS 2018

Abstract

Real-time microcontroller systems (MCS) are critical to modern infrastructure, yet they often lack robust memory isolation due to strict timing requirements. This paper introduces MINION, a security architecture that leverages hardware Memory Protection Units (MPUs) and static analysis to provide per-process memory isolation. By running both the RTOS and applications in unprivileged mode and using a customized "View Switcher," MINION reduces the memory attack surface by over 75% with a negligible 2% average performance overhead, ensuring all real-time deadlines are met.

The Challenge: Monolithic Memory in Real-Time Systems

Real-time microcontrollers power a vast array of devices, from autonomous drones to medical equipment. Unlike general-purpose computers, these systems typically lack a Memory Management Unit (MMU) for virtual memory. Instead, they rely on a monolithic memory layout where the operating system, drivers, and applications share a single privileged address space.

This lack of isolation creates a significant security risk: a single vulnerability in a non-critical library can grant an attacker full control over safety-critical actuators. While some Real-Time Operating Systems (RTOS) offer optional isolation, the overhead of privilege switching during system calls often causes the system to miss critical real-time deadlines, making such protections impractical for production use.

The MINION Architecture

MINION addresses these challenges through a three-stage process designed to minimize runtime overhead while maximizing isolation:

  1. Firmware Analysis: Using LLVM-based static analysis, MINION identifies the specific memory regions (code, data, and peripherals) required for each process.
  2. Memory View Tailoring: Since hardware MPUs have limited slots (typically 8 or 16), MINION uses a k-means clustering algorithm to group fragmented memory requirements into a set of rules that fit within hardware constraints.
  3. Customized View Switching: MINION introduces a privileged "View Switcher" that reconfigures the MPU only during context switches. By running the RTOS and applications in unprivileged mode, the system avoids the costly privilege-mode transitions usually required for I/O and system calls.
The MINION architecture enforces memory boundaries by running the RTOS and processes in unprivileged mode, managed by a privileged View Switcher.

Evaluation and Key Results

The researchers evaluated MINION using a 3DR IRIS+ quad-copter UAV running the Pixhawk flight controller. The system was tested against eight realistic attack scenarios based on four newly discovered memory corruption bugs in the ArduPilot/NuttX stack.

Security Impact

MINION successfully detected and blocked 100% of the tested attack cases, including buffer overflows and non-control data attacks. On hardware with an 8-region MPU limit (like the Cortex-M4), MINION reduced the accessible memory space for any single process by an average of 76%.

Performance and Real-Time Constraints

Across 31 real-time tasks, the average latency overhead was only 2%. Crucially, the system maintained its real-time integrity, with all tasks continuing to meet their strict deadlines despite the added security layers.

Performance evaluation showing that while memory isolation adds latency, tasks remain within their required real-time deadlines.

Conclusion and Future Work

MINION demonstrates that robust memory isolation is achievable in real-time systems without sacrificing performance. While the system currently relies on conservative static analysis—which may leave small windows of memory accessible—and requires source code access, it represents a significant step forward. As microcontroller hardware continues to evolve with more MPU slots, the granularity and effectiveness of MINION’s protection are expected to improve further.

Summary updated

BibTeX
@inproceedings{kim2018securing,
  author = {Chung Hwan Kim and Taegyu Kim and Hongjun Choi and Zhongshu Gu and Byoungyoung Lee and Xiangyu Zhang and Dongyan Xu},
  title = {{Securing Real-Time Microcontroller Systems through Customized Memory View Switching}},
  booktitle = {NDSS},
  year = {2018},
}
Figure