CRA Compliance Helped by Firmware Partitioning

By Ralph Moore · November 30, 2026 · SecureSMX

The Cyber Resiliency Act does not require you to patch every vulnerability in your IoT or embedded device firmware. That would be impractical. Most devices have hundreds of vulnerabilities, commonly known as Common Vulnerabilities and Exposures (CVEs), and some devices have over a thousand CVEs [Ref 1]. Instead, the CRA requires you to fix CVEs that have resulted in actual breaches of your device. This is where partitioning your firmware can help you[1].

Partitions

As shown in the above diagram, vulnerable code is placed in unprivileged mode (umode) partitions. Each partition is hardware-isolated from all other partitions by a Memory Protection Unit (MPU). An MPU permits code in a partition to access only code and data for that partition. It also controls how the code or data is accessed (e.g. execute-never for data).

Mission-critical code, the RTOS, security code, and other system code is placed below the pmode barrier, which is also hardware-enforced. This code runs in privileged mode (pmode) or handler mode, (hmode). umode code can access pmode or hmode code and data only via the SuperVisor Exception (SVC), which is triggered by the svc n instruction. The SVC Handler, invoked by the SVC exception, limits what system functions can be called from umode. Those that might damage the system (e.g. TaskDelete()) are not permitted.

The resulting structure is illustrated in the above diagram. Notice that mission-critical code accesses sensors, actuators, and other hardware directly, as usual. This code is doubly-hardware protected by umode partition boundaries and by the pmode barrier. Hence, even though it may contain numerous CVEs it is difficult for hackers to access it and thus may escape the need to be patched for a long time, possibly forever.

That is important because mission-critical firmware often has been painfully developed over long time periods and is not likely to be compliant with current coding standards. Often it is not well-understood by the current security team, and it and management are both loath to change it. Modifying finely-tuned code often causes it to stop working, thus taking days to find to fix what is wrong. Worse, inadequate testing, caused by pressure to fix CVEs quickly (per the CRA), can result in new bugs getting out to the field causing even worse problems than breaches.

Partition Portals

Partitions communicate with each other via portals to which they send protected messages[2] (pmsgs). For example, file system service calls are converted into pmsgs via shell functions in a client’s partition or in a common region (ucom_code) shared between clients. The file server is in an isolated partition of its own and pmsgs are sent to the file server portal, where they wait in priority-order to be serviced.

When a pmsg is serviced, the portal task assumes the pmsg priority, its region is loaded into a spare MPU slot, a switch statement converts it to a file system service call, executes the call and returns the result to the client. The portal remains open until the full operation has completed, including multi-block transfers. Then the portal is closed and the next pmsg is serviced. As with mutexes, priority promotion is implemented to avoid unbounded priority inversions

An important aspect of portal-only communication is that partitions cannot see the code inside of other partitions. Hence, they have no knowledge of the addresses in other partitions. This has important advantages:

  1. A breached partition can be shut down and replaced with a backup partition.
  2. A patched partition can be loaded and can replace the backup partition without shutting the system down.
  3. Fixes can be triaged by partition importance.
  4. CVEs known to be actively attacked elsewhere can be proactively fixed before they arrive.

The first advantage means that when a Memory Manage Fault (MMF) or other security violation is detected, the breached partition can be shut down immediately and replaced by a backup partition designed to keep the system running safely. This is the kind of resiliency that the CRA encourages. It is possible because a portal consists of a message exchange and a portal task. The message exchange hides the identity of the portal task from client tasks. Clients do not know what server task they are actually communicating with. Hence, to swap partitions, all that is required is to stop the portal task of the current partition and to start the portal task of the replacement partition. (See the diagram in [Ref 2].) The partitions need not be in the same location because clients know only the address of the portal exchange at which the portal task waits.

If the device is able to continue performing its main functions, the security team has time to create good, thoroughly tested fixes. This takes pressure off of everyone and helps to avoid new problems getting out to the field due to inadequate design or testing. Despite this, if a bad patch does get out to the field, the partition can be shut down just as if it were breached by malware.

The second advantage means that a patched partition can be installed while the device continues running. This is important in situations where shutting down the device may be costly. For example, the device may be controlling an assembly line that runs 24/7 and shutting the device down means stopping production. In cases like this, patches are often delayed for months or even never installed, thus leaving systems vulnerable, contrary to CRA objectives.

Triaging fixes becomes necessary when bad actors attack via multiple CVEs, at once, in order to increase the chances successful breaches. Or it becomes necessary when two or more bad actors are attacking different products in a product line via different CVEs. In these scenarios, a security team can triage fixes depending upon the relative importance of the partitions being breached.

That would not be the case without partitioning, because a breach anywhere would allow access to everywhere within a device. In that case, all breaches can cause equal damage and thus are of equal importance. Therefore, triaging them is not possible and all must be fixed quickly. This can put a security team under great pressure causing burn-outs, mistakes, and resignations.

Finally, a security team may know of CVEs in their device that are being breached in the devices of competitors. Partitioning enables security teams to proactively fix and install fixes before their device is attacked. Not having to shut down installed devices makes proactive patching more feasible, which helps to increase a company’s reputation vs. its competitors who are experiencing breaches.

Breaches

In a properly partitioned system, breaches are most likely to occur in isolated umode partitions because they are most vulnerable. The diagram below illustrates how a networking partition operates.

Note that the entire device driver, except the interrupt service routine (ISR) is inside of the network partition along with the TCP/IP and portal tasks. Unfortunately ISRs must run in handler mode (hmode), which is the worst possible place for them. A breach of an ISR allows malware to turn off the MPU and to gain access to all code and data in a device. Therefore, ISRs must be very short and have no CVEs.

Code that normally would be in an ISR is moved into a link service routine (LSR). LSRs are invoked by ISRs and operate like lightweight tasks. They run after all ISRs are done and before any tasks resume. Hence they have a higher effective priority than any task. Also, they are not subject to preemption by tasks nor to priority inversions. LSRs are also interruptible, thus they do not increase interrupt latency, and they can make all non-wait RTOS and system calls. Shown in the diagram is a umode LSR (uLSR) that runs in the network partition. If it is breached, the malware is contained in the partition the same as if any other code in the partition were breached.

Note that the TCP/IP task gets system services via the SVC handler and that the portal task communicates with other partitions via the network portal. All tasks and LSRs in the same partition share regions from a single memory protection template, which may have more regions than the MPU. In this diagram, the LSR shares regions with the tasks in the network partition. This enables it to communicate and share data with them.

Conclusion

Partitioning device firmware has many benefits that will make complying with the CRA easier and less painful. SecureSMX implements all of the security features described above. It is available under a dual GPLv2/commercial license. Full source code is available at www.github.com/Micro-Digital/SecureSMX.

References

  1. “Supply Chain Visibility & Risk Study”, NetRise, July 2024.
  2. “RTOS Messaging”, LinkedIn, Ralph Moore, October 2025.

Notes

[1] The following discussion is specific to the Cortex-M architecture.

[2] A protected message, pmsg, is one that carries its own region with it. When the pmsg is received by the portal task, the pmsg’s region is plugged into the MPU so the task can access the message data.

My LinkedIn Profile

Search

Categories

Recent posts

November 30, 2026
CRA Compliance Helped by Firmware Partitioning
November 14, 2026
Why You Need An RTOS
October 15, 2026
Tokens Improve IoT Security
September 28, 2026
Task Runtime Limits
August 22, 2026
RTOS Pitfalls