Question
How should a VM §2.3 sandbox §2.30, MPU §6.8 isolation, microkernel §19.5.4 separation, and native hotpatching §14.33 be compared?
Short answer
Compare a VM (virtual machine) sandbox, MPU (memory protection unit) isolation, microkernel separation and native hotpatching one property at a time, never by name. Fix one property, one threat or fault model §1.30 and one workload. For each mechanism, state which accesses it checks, which code must be correct for the property to hold, what it leaves unenforced, and what it costs, measured the same way for all four. Three mechanisms confine code; native hotpatching replaces code and confines nothing, so no single ranking exists.
Terms in the question
VM sandbox: untrusted code is delivered as bytecode §2.4, instructions for a virtual machine, which is a processor defined in software. An interpreter §2.13, a program that carries out the bytecode one instruction at a time, checks every memory access and every call before performing it; a compiler that translates the bytecode to machine code must insert the same checks. A sandbox is any environment that limits what the code inside it can reach. eBPF §2.1 (extended Berkeley Packet Filter) and WebAssembly §19.5.6 are bytecode formats used this way.
MPU isolation: an MPU is hardware, found in many microcontrollers §6.1, that checks every memory access of the processor against a few regions, each with an address range and permissions such as read, write and execute. An access that the permissions forbid raises a fault, a hardware exception that stops the access. Privileged code sets the regions; less privileged code runs inside them. Unlike an MMU §6.9 (memory management unit), an MPU does not translate addresses.
Microkernel separation: a microkernel is an operating-system kernel that keeps only a few services, such as address spaces, threads and message passing, in privileged mode. Drivers, file systems and other services run as separate unprivileged components, which reach each other only through messages that the kernel delivers. seL4 is a microkernel with a machine-checked proof that its C code implements its specification.
Native hotpatching: changing the machine code of a running program without restarting it, usually by redirecting calls of an old function to a new one. The new code runs as native machine code with all the rights of the program it joins; nothing checks its accesses.
Full answer
The labels are not comparable. Each name stands for a mechanism with its own purpose. The VM sandbox, the MPU and the microkernel confine code: each limits the memory and the functions that one piece of code can reach. Native hotpatching changes the code of a running system and confines nothing. A sentence such as “a VM sandbox is safer than hotpatching” cannot be checked until “safer” is replaced by a property.
Step 1: fix the frame. Name three things before comparing anything.
The property, for example memory confinement: code delivered by an update can write only the memory given to it. Other candidates are a bound on execution time §9.32, an update without a restart, and state kept across an update.
The threat model §1.2 or fault model: whether the update is assumed to be faulty or written by an attacker, whether an attacker controls its inputs, and whether hardware faults are in scope.
The workload: the same events, at the same rates, on the same hardware, for every mechanism.
Step 2: ask every mechanism the same four questions.
Mediation: which accesses pass through a check? Complete mediation §1.16 means that every one does.
Trusted computing base §1.4: which code and hardware must be correct for the property to hold? This set is the TCB (trusted computing base) for that property.
Residue: what does the mechanism leave unenforced?
Cost: processor time per event, code size, RAM, energy and the size of an update sent over the network, each counted the same way for all mechanisms.
Step 3: answer them for memory confinement.
VM sandbox. Every load, store and call of the bytecode is checked, to the exact byte. The TCB holds the interpreter or compiler, the helper functions §2.19 (functions of the host that the bytecode may call), any verifier that checks the program before it runs, and the operating system and hardware beneath them. The interpreter itself runs unconfined, so a bug in it breaks the property. Interpretation costs extra processor time on every instruction.
MPU isolation. The hardware checks every access of unprivileged code, with no extra instructions. The TCB holds the hardware, the privileged code that sets the regions and handles faults, and the code that switches region settings between components. Regions are few and coarse, privileged code is not confined, and nothing limits what is written inside a permitted region.
Microkernel separation. Every access of a component is checked by an MMU or MPU, and every interaction between components passes through the kernel. The TCB holds the kernel, the hardware and every server component that acts on the protected data: if a storage server writes on behalf of the update, the property depends on that server. For seL4, the share of the kernel is covered by a refinement proof, a proof that every behavior of the C code is one the specification allows; that proof depends on assumptions about the hardware and the boot code, among others. Each message between components costs processor time.
Native hotpatching. Nothing is checked. The TCB holds the patch, the tool that applies it and the whole patched program, and a faulty patch can write anything the program can write. Its own obligations lie elsewhere: the switch must happen at a quiescent point §14.34, when no thread is running the old code, and data whose layout changed must be converted. The patched code runs at full native speed.
Step 4: read the table with care.
The ranking depends on the property. For an update without a restart, the VM sandbox (which loads new bytecode) and native hotpatching both qualify, a microkernel can restart one component while the others keep running, and an MPU alone updates nothing.
An unknown is not an absence. If nobody has checked whether a mechanism has a property, the cell says “not shown”, not “no”.
The size of a TCB, for example in lines of code, compares mechanisms only for the same property.
Mechanisms combine. An interpreter can itself run inside an MPU region, so that a bug in the interpreter stays within that region.
When arguing for one mechanism, claim only what that mechanism adds: for which property, under which threat model, and at which cost on which workload.
Worked example
Property: the code of an update may write only its own data object of 200 bytes. Compare the VM sandbox and MPU isolation for exactly this property.
VM sandbox. The object starts at address 0x20000100. Its last byte is at that address plus 199, which is 0x200001C7, because 199 is 0xC7 in hexadecimal. The bounds check allows exactly these 200 bytes and nothing more.
MPU of the Armv7-M architecture, which the optional MPU of the Cortex-M4 §6.3 processor implements with 8 regions. The size of each region must be a power of two of at least 32 bytes, and its start address must be a multiple of its size.
The smallest power of two not below 200 is 256, because .
The start address
0x20000100is a multiple of 256, which is0x100, so a 256-byte region can start there. It covers0x20000100to0x200001FF.The region grants bytes beyond the object, from
0x200001C8to0x200001FF. If another variable lies there, the update can change it without any fault.
Now move the object to 0x20000140. Its last byte is 0x20000207. The 256-byte region at 0x20000100 ends at 0x200001FF and misses the last 8 bytes. A 512-byte region must start at a multiple of 512, here 0x20000000 or 0x20000200, and neither covers both ends of the object. The smallest region that fits is 1,024 bytes at 0x20000000, which grants bytes too many. Armv7-M also lets a region of 256 bytes or more switch off any of its 8 equal sub-regions. That leaves 7 sub-regions of 32 bytes, bytes, in the first placement, and 3 sub-regions of 128 bytes, bytes, in the second: still and bytes too many. The usual repair is to pad the object to a power of two and place it at a multiple of that size, which spends memory.
Microkernel separation on the same microcontroller enforces its boundaries with the same MPU, so it has the same granularity. Native hotpatching with no MPU configured lets the patched code write every byte the program can write. For the VM sandbox, the MPU and native hotpatching, the writable memory beyond the object is therefore 0 bytes, 24 to 824 bytes depending on placement and on the use of sub-regions, and unlimited. On processor time per access the order reverses: native code runs without any check, the MPU check adds no instructions, and the bounds check adds instructions to every access. Neither order is the ranking; each answers one question.
Follow-up questions and limits
Does a smaller TCB make a mechanism better? Only for the same property, and only if the smaller TCB is in fact correct. A small kernel says nothing about a timing property that depends on drivers outside it.
Can a feature table show that a mechanism is new or superior? No. A table organizes evidence about the systems in it. It cannot show that no other system has the property, and it says nothing about performance unless the costs were measured on the same workload with the same accounting.
What about a property that the comparison did not fix? Answer the four questions again for that property. The ranking may change, as the example shows for memory confinement and processor time.
This answer does not cover the internal design of each mechanism, or the many variants within each family, such as hotpatching tools that check a patch before applying it.
Fullest treatment: Security claim scope (§1.45).
Related entries: Trusted computing base (TCB) (§1.4), Sandbox (§2.30), Memory protection unit (MPU) (§6.8), Refinement (§3.32), Microkernel, monolithic kernel, and service isolation (§19.5.4), Dynamic patching and hot update (§14.33), Complete mediation (§1.16), Memory management unit (MMU) (§6.9). Further reading: [156, 174].