> ## Content Index
> Fetch the complete content index at: https://ettayeb.fr/llms.txt
> Use this file to discover other available public pages before exploring further.

# Josef Bacik proposes making containers first-class kernel objects with the cells API
- URL: https://ettayeb.fr/en/linux/linux-cells-containers-kernel-object-en/
- Published: 2026-11-16T00:00:00.000Z
- Updated: 2026-11-16T00:00:00.000Z
- Description: On October 26, 2026, Josef Bacik published version 2 of his “cells” RFC: it turns the container into a sealed, empty-by-default kernel object whose processes can never leave. Runtime maintainers should track this proposal — if it lands, the containment contract at the syscall level changes.
- Author: Walid ETTAYEB
- Tags: Linux, linux-kernel, containers, namespaces, cgroups, cells, #en, #Import 2026-11-23 14:52

**October 26, 2026.** **Josef Bacik**, maintainer of the **Btrfs** filesystem, posts **version 2** of his “**cells**” RFC to **linux-fsdevel**. **October 29, 2026.** **Jonathan Corbet** analyzes it for **LWN**. **One observation.** The **Linux** kernel still has no container abstraction: it offers *namespaces*, *cgroups*, and an implicit instruction manual that says, in effect, “some assembly required”. Why it matters: the proposal attacks at the root a class of bugs that runtimes today paper over with layers — and it could redefine the containment contract at the syscall level.

## The problem: the assembly is where the bugs live

Today a container does not exist as an object in the kernel. It is assembled by **walling things off**: you create *namespaces*, enter them, unmount or overmount filesystems to make them unreachable, and so on. The consequence, in **Bacik**’s words, is blunt: “*that is where a depressing number of our bugs come from*”. At any moment a process can be only **partly** inside a container — halfway between two *namespaces* — and that window is where resources or file descriptors leak.

The kernel cannot even answer a simple question: which container does this process belong to? It has no notion of the object, so no property to enforce, no boundary to hold. Attempts to fix this — cited by **LWN** as far back as **2017** and again in **2019** — have never gone anywhere. **Bacik** tries again with an inverted idea: instead of isolating part of the system, you create an **empty-by-default** object and place into it only what you explicitly decide.

## The cells API: a sealed object, empty by default

A *cell* comes to life through a single call, and its lifetime is governed by three syscalls whose signatures appear in the RFC:

```c
int cell_create(int parent, unsigned int flags);
int cell_kill(int cellfd, unsigned int flags);
int cell_configure(int cellfd, unsigned int cmd, const char *key,
                   const void *value, int aux);

```

`cell_create()` returns a **cellfd**, a special descriptor that acts as the handle for every other operation — and one that cannot be duplicated with the same capabilities. **Closing the cellfd immediately kills the cell and everything inside it.** Creation is an **unprivileged** operation: any process can build its own cell.

`cell_configure()` applies configuration to the cell, key by key. The `CELL_SET_FD` command accepts three descriptors: `root` (the root filesystem), `net` (the network *namespace*), and `budget` — a **mandatory** *cgroup* directory, since every cell must own its own *cgroup*. The `CELL_SET_BINARY` command sets user IDs: either processes run with the creator’s ID, or the cell receives a block of **65,536 IDs** allocated from the upper part of the 32-bit ID space, unique on the machine and entirely outside the creator’s control.

The keystone is `CELL_CMD_SEAL`. Once configuration is complete, this command **seals the cell**: no further configuration changes are possible. The cell is then given its filesystem tree, its *cgroup*, and the rest of its *namespaces* — but it remains **empty of processes**. And this is where the proposal breaks from the status quo: `setns()` **cannot** enter its *namespaces*. An existing process cannot get into a cell; a process born inside can never get out.

## “Embryo” processes, born inside the cell

To start anything inside a cell requires another mechanism, also new. You first create an empty process — an “embryo” — via `pidfd_open()` with the `PIDFD_EMPTY` flag, passing the *cellfd* rather than a PID:

```c
int pidfd_configure(int pidfd, unsigned int cmd, const char *key,
                    const void *value, int aux);

```

`pidfd_configure()` fills in the embryo: `PIDFD_SET_STRING` with the `exec` key names the executable to run, `PIDFD_SET_BINARY` carries `argv`, `envp`, and `cred`, and `PIDFD_SET_FD` installs the descriptors — the only ones the process will own, since no descriptor leaks by accident. `PIDFD_CMD_START` sets the process running. The first process started becomes the cell’s **init**: if it dies, the cell dies with it.

The boundary is locked by a series of restrictions: every process runs with the **no\_new\_privs** flag set (it cannot gain new capabilities), file descriptors cannot be passed across the boundary over **Unix-domain** sockets, and a cell cannot share its *cgroup* with any other process. The goal, in the author’s own words, is containment “as tight and controlled as it can be”.

## Why now, and why this time is different

The obvious question: why would this proposal succeed where the **2017** and **2019** attempts failed? Two things have changed. First, the plumbing already exists: **Bacik** builds on `pidfd_open()` and *pidfds*, introduced in the meantime, rather than constructing a new mechanism from scratch. Second, the weight of containers has shifted: they are no longer a development convenience, they are the cloud’s **default security boundary**, and every documented escape undercuts a containment promise that *namespaces* never fully kept.

Still, the proposal is young. Posted to a single list, it has not yet faced cross-subsystem scrutiny — *scheduler*, *cgroups*, security. And several choices, like the **65,536**\-ID block, are explicitly marked as likely to change. None of this is a promise: kernel containers have been proposed before and shelved, and the question of whether the kernel should know what a container *is* remains as much philosophical as technical. But the shape of the API — create, configure, seal — sits close enough to what **OCI** runtimes already do in user space that a migration path, however long, is imaginable. That is more than previous attempts could claim. The RFC is a starting point, not a roadmap.

## The verdict

**If you maintain a runtime — Docker, containerd, Podman, systemd — track this RFC closely, and expect nothing from it in the short term.** **Bacik** says so himself: the proposal “*exists so that there is code to argue about*”, not to be merged. It is an RFC with a long list of open issues, posted for now to a single list, touching subjects that have historically proved controversial — the same kind of debate that sank earlier attempts.

**If you consume containers without implementing them, change nothing**: the immediate value of reading this is explaining *why* your runtimes carry so many layers. First-class *cells* would concern only the kernel and the runtimes. But keep the stakes in mind: a container boundary that is a **first-class object** — instead of a stack of *namespaces* a process can only half-inhabit — would close a class of escape bugs that [**ETTAYEB has already documented from the distroless angle**](https://ettayeb.fr/devops/distroless-security-gap-bottom-up-containers-2026/). Same fight, fought one floor lower.

## References

- [LWN.net — “Containers as a recognized kernel object” (Jonathan Corbet, October 29, 2026)](https://lwn.net/Articles/1102593/?ref=ettayeb.fr)
- [LWN.net — Josef Bacik’s RFC v2 on linux-fsdevel (October 26, 2026)](https://lwn.net/ml/all/20261026-cells-rfc-v2-b41d7e0c95a3@toxicpanda.com?ref=ettayeb.fr)
- [GitHub — Josef Bacik’s cells branch, code and design document](https://github.com/josefbacik/linux/blob/cells/Documentation/userspace-api/cells.rst?ref=ettayeb.fr)