Abstract
Despite the ubiquity of the ARM Memory Protection Unit (MPU) as a hardware security feature, its adoption in production embedded systems remains remarkably low. This paper investigates the technical and architectural barriers preventing its widespread use. Through a comprehensive study of RTOS support, architectural constraints, and security vulnerabilities in existing implementations, we demonstrate that the MPU's rigid design—characterized by strict alignment rules, limited region counts, and high performance overhead—often outweighs its security benefits. We conclude that while the motive for hardware-based isolation is sound, the current ARMv7-M MPU design is fundamentally flawed for modern IoT requirements.
Introduction
As Internet of Things (IoT) devices move from isolated environments to the open internet, they face increasing threats from remote attacks. Most embedded software is written in memory-unsafe languages like C/C++, making memory corruption vulnerabilities a significant risk. ARM introduced the Memory Protection Unit (MPU) as a lightweight alternative to the Memory Management Unit (MMU) found in larger processors, aiming to provide hardware-based isolation. However, a paradox exists: while the hardware is present in nearly every modern microcontroller, it is rarely enabled in production.
Methods and Market Adoption
To understand this adoption gap, we conducted a multi-faceted investigation involving a market survey of ten popular Real-Time Operating Systems (RTOSs), an architectural analysis of the ARMv7-M/R programming model, and performance benchmarking on an FPGA-based ARM Cortex-M implementation.
As shown in the table above, only two out of ten surveyed RTOSs (ARM Mbed and Nucleus 3.X) make MPU usage mandatory. For others, like FreeRTOS, it remains optional and is often bypassed by developers. Even major stakeholders like AWS continue to integrate libraries into non-MPU versions of FreeRTOS by default, highlighting a significant industry-wide reluctance to adopt the feature.
Architectural Constraints: The Alignment Nightmare
The primary technical hurdle lies in the ARMv7-M/R MPU programming model. The architecture imposes strict memory alignment rules: regions must be a power of two in size (minimum 32 bytes) and must be aligned to their own size.
This configuration, illustrated in the table above, reveals several critical issues:
- Resource Scarcity: Most current MCUs support only 8 MPU regions. After the OS allocates regions for code, kernel data, and stacks, very few regions remain for application-specific protection.
- Inflexible Protection: Protecting a non-power-of-two buffer (e.g., 5KB) requires either wasting memory to round up to 8KB or using multiple overlapping regions, which quickly exhausts the limited region count.
- Peripheral Exposure: Standard peripherals often have memory maps that do not align with the 32-byte minimum, leading many developers to leave them unprotected by default.
Security and Performance Trade-offs
Beyond architectural rigidity, the software implementations of MPU support often introduce new vulnerabilities. In MPU-enabled FreeRTOS, user-mode tasks must call a specific function (xPortRaisePrivilege) to access kernel APIs. We demonstrated that an attacker who gains control of the program counter can jump directly to this function, gaining full system privileges and rendering the MPU's isolation moot.
Furthermore, the performance "tax" is significant. Our benchmarks on a 25MHz CPU showed that 1,000 privilege switches take approximately 3.5ms. In high-responsiveness real-time systems, this latency is often unacceptable, leading developers to prioritize performance over security.
Conclusion
The ARM MPU suffers from a "good motive, bad design" syndrome. While ARMv8-M addresses some of these issues by increasing region counts and removing power-of-two alignment restrictions, these chips are not yet the industry standard. Until hardware undergoes more radical redesigns, the MPU is likely to remain an underutilized "outcast" in the IoT ecosystem.
Summary updated