<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Crun on *scratch*</title>
    <link>https://www.scrivano.org/tags/crun/</link>
    <description>Recent content in Crun on *scratch*</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sat, 06 Jun 2026 10:03:54 +0000</lastBuildDate>
    <atom:link href="https://www.scrivano.org/tags/crun/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>The journey to speed up running OCI containers</title>
      <link>https://www.scrivano.org/posts/2022-10-21-the-journey-to-speed-up-oci-containers/</link>
      <pubDate>Wed, 21 Sep 2022 16:30:00 +0200</pubDate>
      <guid>https://www.scrivano.org/posts/2022-10-21-the-journey-to-speed-up-oci-containers/</guid>
      <description>&lt;p&gt;When I started working on crun, I was looking at a faster way to start up and stop containers by improving the OCI runtime, the component in the OCI stack that is responsible for talking to the kernel and setting up the environment where the container runs. Over roughly five years, a combination of kernel patches and userspace fixes reduced the time to start and stop a container from around 160 ms to just over 5 ms — nearly a 30x improvement — through targeted work on network namespace teardown, mqueue mount overhead, IPC namespace cleanup, and seccomp profile compilation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>An interesting issue handling the seccomp listener</title>
      <link>https://www.scrivano.org/posts/2022-09-05-seccomp-listener/</link>
      <pubDate>Mon, 05 Sep 2022 21:59:12 +0200</pubDate>
      <guid>https://www.scrivano.org/posts/2022-09-05-seccomp-listener/</guid>
      <description>&lt;p&gt;A &lt;a href=&#34;https://github.com/containers/crun/issues/1002&#34;&gt;bug report&lt;/a&gt; filed against crun a few days ago exposed a deadlock: under certain seccomp profiles, the runtime would hang indefinitely before the container process ever started. The root cause is a subtle sequencing problem between installing a seccomp filter that intercepts a syscall and then immediately using that same syscall to hand off the resulting listener file descriptor to the userspace handler — the very handler that has not yet received the descriptor it needs to process the interception.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Seccomp made easy</title>
      <link>https://www.scrivano.org/posts/2021-01-30-easyseccomp/</link>
      <pubDate>Sat, 30 Jan 2021 21:10:14 +0200</pubDate>
      <guid>https://www.scrivano.org/posts/2021-01-30-easyseccomp/</guid>
      <description>&lt;p&gt;Seccomp is a kernel feature that restricts what syscalls can be used by a process. The allowed syscalls are described as a BPF program that the kernel evaluates on every syscall entry. While effective, writing and maintaining seccomp profiles in the JSON format expected by OCI runtimes is tedious, and the underlying libseccomp API has surprising constraints — particularly around combining per-argument rules for the same syscall — that make complex policies difficult to express correctly.&lt;/p&gt;&#xA;&lt;p&gt;Almost every container runs with seccomp enabled to restrict its&#xA;access to syscalls.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Playing with seccomp notifications in the OCI runtime</title>
      <link>https://www.scrivano.org/posts/2020-08-10-seccomp-notifications/</link>
      <pubDate>Mon, 10 Aug 2020 10:40:19 +0200</pubDate>
      <guid>https://www.scrivano.org/posts/2020-08-10-seccomp-notifications/</guid>
      <description>&lt;p&gt;A couple weekends ago I&amp;rsquo;ve played with seccomp user notifications and how they can be used in the OCI containers stack. Seccomp user notifications are a Linux kernel feature that lets a privileged monitor process intercept specific syscalls made by a less-privileged container, inspect the arguments, and either emulate the syscall or return an error. This opens up possibilities for safely expanding what unprivileged containers can do — for example, emulating &lt;code&gt;mknod&lt;/code&gt; — without granting broad kernel capabilities to the container itself.&lt;/p&gt;&#xA;&lt;p&gt;Seccomp user notifications are a powerful Linux kernel feature, that&#xA;delegates syscalls handling to a userland program.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Avoid a memory page allocation on mount(2)</title>
      <link>https://www.scrivano.org/2019/12/27/avoid-a-memory-page-allocation-on-mount/</link>
      <pubDate>Fri, 27 Dec 2019 16:16:33 +0000</pubDate>
      <guid>https://www.scrivano.org/2019/12/27/avoid-a-memory-page-allocation-on-mount/</guid>
      <description>&lt;p&gt;While working on crun, I got surprised by how much time the kernel spent in the &lt;code&gt;copy_mount_options&lt;/code&gt; function. A container runtime issues a large number of &lt;code&gt;mount(2)&lt;/code&gt; syscalls during startup — bind mounts, proc, sysfs, devtmpfs, and more — many of them with no extra options to pass. It turned out that passing an empty string instead of &lt;code&gt;NULL&lt;/code&gt; for the data argument caused the kernel to allocate a full memory page and attempt a copy from user space on every one of those calls, adding measurable overhead.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Crun moved to github.com/containers</title>
      <link>https://www.scrivano.org/2019/08/12/crun-moved-to-github-com-containers/</link>
      <pubDate>Mon, 12 Aug 2019 09:54:25 +0000</pubDate>
      <guid>https://www.scrivano.org/2019/08/12/crun-moved-to-github-com-containers/</guid>
      <description>&lt;p&gt;The giuseppe/crun github project was moved under &lt;a href=&#34;https://github.com/containers/crun&#34;&gt;https://github.com/containers/crun&lt;/a&gt;. Moving to the containers organization means the project is no longer a personal experiment but a community-maintained component of the container stack, alongside tools like Podman, Buildah, and fuse-overlayfs. This makes it easier to coordinate changes across the ecosystem and signals that crun is a supported alternative OCI runtime for production use.&lt;/p&gt;&#xA;&lt;p&gt;Similarly libocispec, used internally by crun for parsing the OCI configuration file was moved to &lt;a href=&#34;https://github.com/containers/libocispec&#34;&gt;https://github.com/containers/libocispec&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rootless resources management with Podman on Fedora 30</title>
      <link>https://www.scrivano.org/2019/05/12/rootless-resources-management-with-podman-on-fedora-30/</link>
      <pubDate>Sun, 12 May 2019 20:36:59 +0000</pubDate>
      <guid>https://www.scrivano.org/2019/05/12/rootless-resources-management-with-podman-on-fedora-30/</guid>
      <description>&lt;p&gt;I have finally opened some PRs for conmon and libpod that enable resources management for Podman rootless containers on Fedora 30 when using crun. This builds on the cgroups v2 delegation support added to crun earlier: Fedora 30 ships a kernel and systemd new enough to support the unified cgroup hierarchy, so with a single kernel command-line option and a small systemd drop-in, unprivileged users can now set memory and CPU limits on their containers without root access.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Resources management with rootless containers and cgroups v2</title>
      <link>https://www.scrivano.org/2019/02/26/resources-management-with-rootless-containers/</link>
      <pubDate>Tue, 26 Feb 2019 21:22:10 +0000</pubDate>
      <guid>https://www.scrivano.org/2019/02/26/resources-management-with-rootless-containers/</guid>
      <description>&lt;p&gt;cgroups v2 will finally allow unprivileged users to manage a cgroup hierarchy in a safe manner without requiring any additional permission. In the cgroups v1 model, writing to cgroup control files requires root, which means rootless containers cannot enforce memory limits or CPU quotas. The unified cgroups v2 hierarchy introduces a delegation mechanism where systemd can hand ownership of a subtree to a user process, enabling the OCI runtime to configure resource limits directly without any privileged helper.&lt;/p&gt;</description>
    </item>
    <item>
      <title>New COPR repository for crun</title>
      <link>https://www.scrivano.org/2017/11/15/new-copr-repository-crun/</link>
      <pubDate>Wed, 15 Nov 2017 19:25:46 +0000</pubDate>
      <guid>https://www.scrivano.org/2017/11/15/new-copr-repository-crun/</guid>
      <description>&lt;p&gt;I made a new COPR repository for crun so that it can be easily tested on Fedora without having to build from source. crun is a lightweight OCI container runtime written in C, intended as a faster and lower-overhead alternative to runC. The COPR repository tracks the upstream development branch, making it straightforward to try out new features and report issues before they land in a distribution package.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://copr.fedorainfracloud.org/coprs/gscrivano/crun/&#34;&gt;https://copr.fedorainfracloud.org/coprs/gscrivano/crun/&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;To install crun on Fedora, it is enough to:&lt;/p&gt;</description>
    </item>
    <item>
      <title>C is a better fit for tools like an OCI runtime</title>
      <link>https://www.scrivano.org/2017/10/23/c-still-makes-sense-low-level-tools-oci-runtime/</link>
      <pubDate>Mon, 23 Oct 2017 21:21:19 +0000</pubDate>
      <guid>https://www.scrivano.org/2017/10/23/c-still-makes-sense-low-level-tools-oci-runtime/</guid>
      <description>&lt;p&gt;I’ve spent some of the last weeks working on a replacement for runC, the most used/known OCI runtime for running containers. It might not be very well known, but it is a key component for running containers. Every Docker container ultimately runs through runC. The OCI runtime is the thin layer between the container engine and the kernel: it reads a JSON configuration file, creates the necessary namespaces and cgroups, sets up mounts and capabilities, and finally execs the container process. Because it runs for such a short time and its workload is almost entirely syscalls, the implementation language matters for startup latency.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
