Femto-Containers ., .
by the device, e.g. CoAP endpoints exposed by existing sandboxed
environments. The malicious client seeks to gain any permission
on the device to inuence it or gain access to condential data
on the device. The malicious client could make use of an already
vulnerable tenant function.
A number of attack vectors are considered in this work:
•
Install and update time attacks: These attacks focus on modi-
fying the application during the transport to the sandbox en-
vironment. This includes man-in-the-middle modications
to the applications.
•
Privilege escalation to a dierent sandbox: This class of at-
tacks focus on escaping the sandbox of the application to
a dierent sandbox. The new sandbox could have dierent
permissions.
•
Privilege escalation to the operating system: This attack class
attempts to escape the sandboxed environment altogether
to the operating system.
•
Resource exhaustion attacks: The devices considered here
have very limited resources, both computational power and
battery energy are limited. A denial of service vector can be
to exhaust these resources.
Within the Femto-Container design we consider network attacks
to exhaust resources on the system to be out of scope, this type
of attack should be guarded against by the embedded operating
system.
4 RELATED WORK
Typically, the fundamental building block for middleware embedded
on devices allowing for generic function deployment and execution
is a virtual machine runtime.
The vast majority of prior work on lightweight virtualization
runtimes [
5
] does not target microcontrollers, but microprocessor-
class computers. Recent examples include for instance AWS Fire-
cracker [
10
] for serverless computing, WebAssembly [
11
] for pro-
cess isolation in Web browsers, or eBPF [
12
,
13
] for debug and
inspection code inserted in the Linux kernel at run-time.
However, some ultra-lightweight virtualization approaches have
been proposed for microcontrollers. For example, minimized Web-
Assembly runtimes adapted to run on 32-bit microcontrollers were
proposed, such as WAMR [
14
] and WASM3 [
15
]. RapidPatch [
16
]
uses an eBPF runtime to provide a hotpatching framework for RTOS
rmwares.
VM runtimes for microcontrollers include also earlier exam-
ples such as Mate [17] or Darjeeling [18], a subset of the Java VM,
modied to use a 16 bit architecture, designed for 8- and 16-bit mi-
crocontrollers. JavaCard [
19
] also uses a small Java virtual machine
tailored for cryptographic purposes, running on smart cards.
Recently, tiny scripted logic interpreters and runtimes have also
been proposed to provide a basic virtualization environment. For
instance, MicroPython [
20
] is a very popular scripted logic inter-
preter used on microcontrollers. Small Python runtimes are used on
ESP8266 microcontrollers in prior work such as NanoLambda [
21
].
Small Javascript runtimes are used on Cortex-M microcontrollers
in prior work such as RIOTjs [
22
]. However, complementary mech-
anisms should however be used to guarantee mutual isolation be-
tween scripts (such as SecureJS [23]).
The most closely related work was published in [
24
] and in [
25
].
In [
24
], authors provide rBPF, a port of the eBPF instruction set in
order to host a (single) VM on a microcontroller. In contrast, we
extend rBPF’s instruction set architecture and VM core with an ade-
quate embedded loading and execution environment, which caters
for well-dened, event-driven, short lived and isolated (concurrent)
execution of (multiple) functions to be deployed on-the-y on a
networked microcontroller. On the other hand, while [
25
], concerns
formal verication of the sole rBPF instruction interpreter, here
we also verify the pre-ight instruction checker and we integrate
both in our femto-container implementation – the performance of
which we thoroughly evaluate on various microcontrollers. Our
design and implementation are so small (a few hundreds lines of
code) that formal verication was indeed realistic. Comparatively,
software alternatives (WASM, MicroPython...) would require hun-
dreds of thousands of lines of code, and magnitudes more lines of
proof, all but voiding concrete perspectives of formal verication.
Hardware alternatives (e.g. TrustZone [
26
]) are, to the best of our
knowledge, not formally veried, and may require a software API
to avoid unspecied hardware behaviours, hence faults.
To the best of our knowledge, our work provides the rst for-
mally veried middleware based on eBPF virtualization able to host
multiple tiny runtime containers on a wide variety of heterogeneous
low-power microcontrollers.
5 EMBEDDED RUNTIME ARCHITECTURE
DESIGN
In this section, we introduce Femto-Containers, a new embedded
runtime architecture tailored for constrained IoT devices, as de-
scribed in the following.
Similarly to a FaaS runtime, Femto-Containers allow for the we
deployment and execution of small logic modules. These modules,
or functions, are hosted on top of a middleware oering isolation,
abstraction and tight isolation with respect to the underlying OS
and hardware. By combining isolation and hardware/OS abstraction,
we retain the crucial properties of FaaS runtimes: code mobility and
cyber-security. Dierently from typical FaaS runtimes, however,
Femto-Containers must be able to interact with specic hardware
(e.g. sensor/actuators), and must drastically reduce the scope and
the cost of virtualization to make do with IoT hardware constraints.
The Femto-Container architecture therefore relies on ultra-light-
weight virtualization, as well as on a set of assumptions and features
regarding an underlying RTOS, dened below.
Use of an RTOS with Multi-Threading.
It is assumed that the
RTOS supports real-time multi-threading with a scheduler. Each
Femto-Container runs in a separate thread. Well-known operating
systems in this space can provide for that, such as RIOT [
27
] or
FreeRTOS [
28
] and others [
2
]. These can run on the bulk of commod-
ity microcontroller hardware available. Note that RTOS facilities
for scheduling enable simple controlling of how Femto-Containers
interfere with other tasks in the embedded system.
No Assumptions on Microcontroller Hardware.
To retain
generality, we aim for a purely software-based isolation, which
can also run on the least capable microcontrollers, without any
assumptions on hardware architecture enhancements or security