CLI tool for spawning and running containers according to the OCI specification
This is the first release candidate for the 1.2.0 branch of runc. It includes all patches and bugfixes included in runc 1.1 patch releases (up to and including 1.1.12). A fair few new features have been added, and some changes have been made which may affect users. Please help us thoroughly test this release before we release 1.2.0.
runc
now requires a minimum of Go 1.20 to compile.
NOTE: runc currently will not work properly when compiled with Go 1.22 or newer. This is due to some unfortunate glibc behaviour that Go 1.22 exacerbates in a way that results in containers not being able to start on some systems. See this issue for more information.
Several aspects of how mount options work has been adjusted in a way that could theoretically break users that have very strange mount option strings. This was necessary to fix glaring issues in how mount options were being treated. The key changes are:
Mount options on bind-mounts that clear a mount flag are now always
applied. Previously, if a user requested a bind-mount with only clearing
options (such as rw,exec,dev
) the options would be ignored and the
original bind-mount options would be set. Unfortunately this also means
that container configurations which specified only clearing mount options
will now actually get what they asked for, which could break existing
containers (though it seems unlikely that a user who requested a specific
mount option would consider it "broken" to get the mount options they
asked foruser who requested a specific mount option would consider it
"broken" to get the mount options they asked for). This also allows us to
silently add locked mount flags the user did not explicitly request to be
cleared in rootless mode, allowing for easier use of bind-mounts for
rootless containers. (#3967)
Container configurations using bind-mounts with superblock mount flags
(i.e. filesystem-specific mount flags, referred to as "data" in
mount(2)
, as opposed to VFS generic mount flags like MS_NODEV
) will
now return an error. This is because superblock mount flags will also
affect the host mount (as the superblock is shared when bind-mounting),
which is obviously not acceptable. Previously, these flags were silently
ignored so this change simply tells users that runc cannot fulfil their
request rather than just ignoring it. (#3990)
If any of these changes cause problems in real-world workloads, please open an issue so we can adjust the behaviour to avoid compatibility issues.
docs/spec-conformance.md
for more details.MOUNT_ATTR_IDMAP
kernel support (Linux
5.12 or newer) as well as kernel support for the underlying filesystem used
for the bind-mount. See mount_setattr(2)
for a list of
supported filesystems and other restrictions. (#3717, #3985, #3993)runc-dmz
is a minimal binary (~8K) which acts as an additional execve
stage, allowing us to only need to protect the smaller binary. It should
be noted that there have been several compatibility issues reported with
the usage of runc-dmz
(namely related to capabilities and SELinux). As
such, this mechanism is opt-in and can be enabled by running runc
with the environment variable RUNC_DMZ=true
(setting this environment
variable in config.json
will have no effect). This feature can be
disabled at build time using the runc_nodmz
build tag. (#3983, #3987)contrib/memfd-bind
is a helper daemon which will bind-mount a memfd copy
of /usr/bin/runc
on top of /usr/bin/runc
. This entirely eliminates
per-container copies of the binary, but requires care to ensure that
upgrades to runc are handled properly, and requires a long-running daemon
(unfortunately memfds cannot be bind-mounted directly and thus require a
daemon to keep them alive). (#3987)cgroup.kill
if available to kill all processes in a
container (such as when doing runc kill
). (#3135, #3825)runc exec
. (#3661)SCHED_IDLE
for runc cgroupfs. (#3377)--manage-cgroups-mode=ignore
. (#3546)SPEC_ALLOW
by
default. (#3588)MAJOR:*
syntax. (#3843)runc
binary size by ~11% by updating
github.com/checkpoint-restore/go-criu
. (#3652)--pidfd-socket
to runc run
and runc exec
to allow for management
processes to receive a pidfd for the new process, allowing them to avoid pid
reuse attacks. (#4045)runc
option --criu
is now ignored (with a warning), and the option will
be removed entirely in a future release. Users who need a non-standard
criu
binary should rely on the standard way of looking up binaries in
$PATH
. (#3316)runc kill
option -a
is now deprecated. Previously, it had to be specified
to kill a container (with SIGKILL) which does not have its own private PID
namespace (so that runc would send SIGKILL to all processes). Now, this is
done automatically. (#3864, #3825)github.com/opencontainers/runc/libcontainer/user
is now deprecated, please
use github.com/moby/sys/user
instead. It will be removed in a future
release. (#4017)runc exec
and runc run
. (#3306)runc features
is no longer experimental. (#3861)container.Signal
. (#3825)anon
and file
from memory.stat
for cgroupv2 root usage,
as the root does not have memory.current
for cgroupv2.
This aligns cgroupv2 root usage more closely with cgroupv1 reporting.
Additionally, report root swap usage as sum of swap and memory usage,
aligned with v1 and existing non-root v2 reporting. (#3933)swapOnlyUsage
in MemoryStats
. This field reports swap-only usage.
For cgroupv1, Usage
and Failcnt
are set by subtracting memory usage
from memory+swap usage. For cgroupv2, Usage
, Limit
, and MaxUsage
are set. (#4010)container.Signal
. (#3825)container.Signal
no longer takes an all
argument. Whether
or not it is necessary to kill all processes in the container individually
is now determined automatically. (#3825, #3885)runc run
/runc exec
: ignore SIGURG. (#3368)runc --root non-existent-dir list
now reports an error for non-existent
root directory. (#3374)runc init
no longer re-execs
itself twice. (#3342)-ENOSYS
stub now correctly handles multiplexed syscalls on
s390 and s390x. This solves the issue where syscalls the host kernel did not
support would return -EPERM
despite the existence of the -ENOSYS
stub
code (this was due to how s390x does syscall multiplexing). (#3474)MS_POSIXACL
. (#3739)READY
notification. (#3291, #3293)-ENOSYS
seccomp stub is now always generated for the native
architecture that runc
is running on. This is needed to work around some
arguably specification-incompliant behaviour from Docker on architectures
such as ppc64le, where the allowed architecture list is set to null
. This
ensures that we always generate at least one -ENOSYS
stub for the native
architecture even with these weird configs. (#4219)ro
bind-mount of
/proc/self/exe
has been removed. runc now creates a binary copy in all
cases. See the above notes about memfd-bind
and runc-dmz
as well as
contrib/cmd/memfd-bind/README.md
for more information about how this
(minor) change in memory usage can be further reduced. (#3987, #3599, #2532,
#3931)EnterPid
(a function with no users). (#3797){Pre,Post}MountCmds
which were never used and are
obsoleted by more generic container hooks. (#3350)The runc
binary distributed with this release are statically linked with
the following GNU LGPL-2.1 licensed libraries, with runc
acting
as a "work that uses the Library":
The versions of these libraries were not modified from their upstream versions, but in order to comply with the LGPL-2.1 (§6(a)), we have attached the complete source code for those libraries which (when combined with the attached runc source code) may be used to exercise your rights under the LGPL-2.1.
However we strongly suggest that you make use of your distribution's packages or download them from the authoritative upstream sources, especially since these libraries are related to the security of your containers.
Thanks to the following contributors who made this release possible:
Signed-off-by: Aleksa Sarai [email protected]
This is the twelfth patch release in the 1.1.z release branch of runc. It fixes a high-severity container breakout vulnerability involving leaked file descriptors, and users are strongly encouraged to update as soon as possible.
Fix CVE-2024-21626, a container breakout attack that took advantage of a file descriptor that was leaked internally within runc (but never leaked to the container process).
In addition to fixing the leak, several strict hardening measures were added to ensure that future internal leaks could not be used to break out in this manner again.
Based on our research, while no other container runtime had a similar leak, none had any of the hardening steps we've introduced (and some runtimes would not check for any file descriptors that a calling process may have leaked to them, allowing for container breakouts due to basic user error).
The runc
binary distributed with this release are statically linked with
the following GNU LGPL-2.1 licensed libraries, with runc
acting
as a "work that uses the Library":
The versions of these libraries were not modified from their upstream versions, but in order to comply with the LGPL-2.1 (§6(a)), we have attached the complete source code for those libraries which (when combined with the attached runc source code) may be used to exercise your rights under the LGPL-2.1.
However we strongly suggest that you make use of your distribution's packages or download them from the authoritative upstream sources, especially since these libraries are related to the security of your containers.
Thanks to all of the contributors who made this release possible:
Signed-off-by: Aleksa Sarai [email protected]
This is the eleventh patch release in the 1.1.z release branch of runc. It primarily fixes a few issues with runc's handling of containers that are configured to join existing user namespaces, as well as improvements to cgroupv2 support.
swapOnlyUsage
in MemoryStats
. This field reports swap-only usage.
For cgroupv1, Usage
and Failcnt
are set by subtracting memory usage
from memory+swap usage. For cgroupv2, Usage
, Limit
, and MaxUsage
are set. (#4000, #4010, #4131)The runc
binary distributed with this release are statically linked with
the following GNU LGPL-2.1 licensed libraries, with runc
acting
as a "work that uses the Library":
The versions of these libraries were not modified from their upstream versions, but in order to comply with the LGPL-2.1 (§6(a)), we have attached the complete source code for those libraries which (when combined with the attached runc source code) may be used to exercise your rights under the LGPL-2.1.
However we strongly suggest that you make use of your distribution's packages or download them from the authoritative upstream sources, especially since these libraries are related to the security of your containers.
Thanks to all of the contributors who made this release possible:
Signed-off-by: Aleksa Sarai [email protected]
This is the tenth (and most likely final) patch release in the 1.1.z release branch of runc. It mainly fixes a few issues in cgroups, and a umask-related issue in tmpcopyup.
hugetlb.<pagesize>.rsvd
limiting and accounting.
Fixes the issue of postres failing when hugepage limits are set.
(#3859, #4077)kmem.limit_in_bytes
(fixes the compatibility with Linux kernel 6.1+). (#4028)config.json
, which is outside of our threat model. (#4103)The runc
binary distributed with this release are statically linked with
the following GNU LGPL-2.1 licensed libraries, with runc
acting
as a "work that uses the Library":
The versions of these libraries were not modified from their upstream versions, but in order to comply with the LGPL-2.1 (§6(a)), we have attached the complete source code for those libraries which (when combined with the attached runc source code) may be used to exercise your rights under the LGPL-2.1.
However we strongly suggest that you make use of your distribution's packages or download them from the authoritative upstream sources, especially since these libraries are related to the security of your containers.
Thanks to all of the contributors who made this release possible:
Signed-off-by: Aleksa Sarai [email protected]
This is the ninth patch release of the 1.1.z release branch of runc. It fixes a regression introduced in 1.1.8, a bugfix in intelrdt, and a libcontainer fix to cgroup v2 statistics reporting.
anon
and file
from memory.stat
for cgroupv2 root usage,
as the root does not have memory.current
for cgroupv2.
This aligns cgroupv2 root usage more closely with cgroupv1 reporting.
Additionally, report root swap usage as sum of swap and memory usage,
aligned with v1 and existing non-root v2 reporting. (#3933)The runc
binary distributed with this release are statically linked with
the following GNU LGPL-2.1 licensed libraries, with runc
acting
as a "work that uses the Library":
The versions of these libraries were not modified from their upstream versions, but in order to comply with the LGPL-2.1 (§6(a)), we have attached the complete source code for those libraries which (when combined with the attached runc source code) may be used to exercise your rights under the LGPL-2.1.
However we strongly suggest that you make use of your distribution's packages or download them from the authoritative upstream sources, especially since these libraries are related to the security of your containers.
Thanks to all of the contributors who made this release possible:
Signed-off-by: Aleksa Sarai [email protected]
This is the eighth patch release of the 1.1.z release branch of runc. The most notable change is the addition of RISC-V support, along with a few bug fixes.
.codespellrc
: update for 2.2.5. (#3909)The runc
binary distributed with this release are statically linked with
the following GNU LGPL-2.1 licensed libraries, with runc
acting
as a "work that uses the Library":
The versions of these libraries were not modified from their upstream versions, but in order to comply with the LGPL-2.1 (§6(a)), we have attached the complete source code for those libraries which (when combined with the attached runc source code) may be used to exercise your rights under the LGPL-2.1.
However we strongly suggest that you make use of your distribution's packages or download them from the authoritative upstream sources, especially since these libraries are related to the security of your containers.
Thanks to all of the contributors who made this release possible:
Signed-off-by: Aleksa Sarai [email protected]
This is the seventh patch release in the 1.1.z release of runc, and is the last planned release of the 1.1.z series. It contains a fix for cgroup device rules with systemd when handling device rules for devices that don't exist (though for devices whose drivers don't correctly register themselves in the kernel -- such as the NVIDIA devices -- the full fix only works with systemd v240+).
DeviceAllow
rules if the device does not exist (a regression introduced
in runc 1.1.3). This fix also reverts the workaround added in runc 1.1.5,
removing an extra warning emitted by runc run/start. (#3845, #3708, #3671)runc.keyring
, which contains the keys
used to sign runc releases. (#3838)The runc
binary distributed with this release are statically linked with
the following GNU LGPL-2.1 licensed libraries, with runc
acting
as a "work that uses the Library":
The versions of these libraries were not modified from their upstream versions, but in order to comply with the LGPL-2.1 (§6(a)), we have attached the complete source code for those libraries which (when combined with the attached runc source code) may be used to exercise your rights under the LGPL-2.1.
However we strongly suggest that you make use of your distribution's packages or download them from the authoritative upstream sources, especially since these libraries are related to the security of your containers.
Thanks to all of the contributors who made this release possible:
Signed-off-by: Aleksa Sarai [email protected]
This is the sixth path release in the 1.1.z series of runc, which fixes a series of cgroup-related issues.
Note that this release can no longer be built from sources using Go 1.16. Using a latest maintained Go 1.20.x or Go 1.19.x release is recommended. Go 1.17 can still be used.
UnitExist
error
from systemd while trying to create a systemd unit, which in some scenarios
may result in a container not being added to the proper systemd unit and
cgroup. (#3780, #3806)resources.cpu.cpus
to systemd unit property (AllowedCPUs
) in case of more
than 8 CPUs, resulting in the wrong AllowedCPUs setting. (#3808)CAP_DAC_OVERRIDE
capability into account. This is
a regression in runc 1.1.4, as well as in Go 1.20 and 1.20.1 (#3715, #3817)misc
controller. (#3823)The runc
binary distributed with this release are statically linked with
the following GNU LGPL-2.1 licensed libraries, with runc
acting
as a "work that uses the Library":
The versions of these libraries were not modified from their upstream versions, but in order to comply with the LGPL-2.1 (§6(a)), we have attached the complete source code for those libraries which (when combined with the attached runc source code) may be used to exercise your rights under the LGPL-2.1.
However we strongly suggest that you make use of your distribution's packages or download them from the authoritative upstream sources, especially since these libraries are related to the security of your containers.
Thanks to all of the contributors who made this release possible:
Signed-off-by: Aleksa Sarai [email protected]
This is the fifth patch release in the 1.1.z series of runc, which fixes three CVEs found in runc.
CVE-2023-25809 is a vulnerability involving rootless containers where (under specific configurations), the container would have write access to the /sys/fs/cgroup/user.slice/... cgroup hierarchy. No other hierarchies on the host were affected. This vulnerability was discovered by Akihiro Suda. https://github.com/opencontainers/runc/security/advisories/GHSA-m8cg-xc2p-r3fc
CVE-2023-27561 was a regression which effectively re-introduced CVE-2019-19921. This bug was present from v1.0.0-rc95 to v1.1.4. This regression was discovered by @Beuc. https://github.com/advisories/GHSA-vpvm-3wq2-2wvm
CVE-2023-28642 is a variant of CVE-2023-27561 and was fixed by the same patch. This variant of the above vulnerability was reported by Lei Wang. https://github.com/opencontainers/runc/security/advisories/GHSA-g2j6-57v7-gm8c
In addition, the following other fixes are included in this release:
/dev/null
when inside a container. (#3620)/dev/null
caused by fd redirection
(a regression in 1.1.1). (#3674, #3731)write_log()
. (#3721)The runc
binary distributed with this release are statically linked with
the following GNU LGPL-2.1 licensed libraries, with runc
acting
as a "work that uses the Library":
The versions of these libraries were not modified from their upstream versions, but in order to comply with the LGPL-2.1 (§6(a)), we have attached the complete source code for those libraries which (when combined with the attached runc source code) may be used to exercise your rights under the LGPL-2.1.
However we strongly suggest that you make use of your distribution's packages or download them from the authoritative upstream sources, especially since these libraries are related to the security of your containers.
Thanks to all of the contributors who made this release possible:
[Due to the security-critical nature of this release, it was released without a direct vote but was agreed to by the required number of maintainers.]
Signed-off-by: Aleksa Sarai [email protected]
This is the fourth patch release in the 1.1.z series of runc, primarily fixing a regression introduced in 1.1.3 related to device rules. It also fixes a few other bugs.
kill()
in libcontainer/nsenter
to sane_kill()
. (#3536)runc run
on noexec
fs. (#3541)systemctl daemon-reload
. Due to a regression
in v1.1.3, the DeviceAllow=char-pts rwm
rule was no longer added and
was causing an error open /dev/pts/0: operation not permitted: unknown
when systemd was reloaded. (#3554)The runc
binary distributed with this release are statically linked with
the following GNU LGPL-2.1 licensed libraries, with runc
acting
as a "work that uses the Library":
The versions of these libraries were not modified from their upstream versions, but in order to comply with the LGPL-2.1 (§6(a)), we have attached the complete source code for those libraries which (when combined with the attached runc source code) may be used to exercise your rights under the LGPL-2.1.
However we strongly suggest that you make use of your distribution's packages or download them from the authoritative upstream sources, especially since these libraries are related to the security of your containers.
Thanks to all of the contributors who made this release possible:
Signed-off-by: Aleksa Sarai [email protected]