Commit Graph

8102 Commits

Author SHA1 Message Date
Kir Kolyshkin 78b80677f6 libct: minor refactor in mountToRootfs
No change in functionality, just a preparation for the next patch.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-03-28 23:48:07 -07:00
Kir Kolyshkin 60352524d3 libct: mountCgroupV1: address TODO
Indeed, it does not make sense to prepend c.root once we started using
MkdirAllInRoot in commit 63c29081.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-03-28 23:48:07 -07:00
Aleksa Sarai 7b40afb6cc merge #5177 into opencontainers/runc:main
Li Fubang (3):
  test: check mount source fds are cleaned up with idmapped mounts
  libct: close mount source fd as soon as possible
  libct: add a nil check for mountError

LGTMs: kolyshkin rata cyphar
2026-03-28 17:32:21 +11:00
lfbzhm fe158d1781 Merge pull request #5195 from cyphar/readme-libpathrs
README: add libpathrs installation notes
2026-03-26 12:44:40 +08:00
Aleksa Sarai 81d59df8d5 README: add libpathrs installation notes
libpathrs now has its own installation instructions[1] but it is quite
helpful to provide some high-level instructions as well as notes about
what minimum versions we expect.

[1]: https://github.com/cyphar/libpathrs/blob/main/INSTALL.md

Suggested-by: Li Fubang <lifubang@acmcoder.com>
Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
2026-03-25 19:38:39 +11:00
Aleksa Sarai 142c838e53 merge #5194 into opencontainers/runc:main
Akhil Mohan (1):
  use POSIX regex in libpathrs build

LGTMs: kolyshkin cyphar
2026-03-25 02:57:28 +11:00
Akhil Mohan 28d5ffbab0 use POSIX regex in libpathrs build
word boundary anchor \> is present only in GNU awk implementation. This
will not work if we are building libpathrs inside a container like
debian/ubuntu which uses mawk. Therefore switch to a POSIX compatible
regex that can be used with all implementations of awk to find the
system libc path

Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
2026-03-24 21:20:45 +11:00
lfbzhm 132498f869 Merge pull request #5191 from kolyshkin/unix
libct/exeseal: drop own F_SEAL_EXEC
2026-03-21 19:55:16 +08:00
Kir Kolyshkin dc2558d7b2 Merge pull request #5185 from kolyshkin/fix-5172
CHANGELOG fixups
2026-03-20 23:19:04 -07:00
Kir Kolyshkin f00b2f9fd5 libct/exeseal: drop own F_SEAL_EXEC
Since golang.org/x/sys@v0.22 it is available from unix.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-03-20 15:57:55 -07:00
lifubang 7fdab1cb69 test: check mount source fds are cleaned up with idmapped mounts
Signed-off-by: lifubang <lifubang@acmcoder.com>
2026-03-20 01:17:08 +00:00
lifubang c77e71a3e7 libct: close mount source fd as soon as possible
This commit factors out setupAndMountToRootfs without changing any
logic. Use "Hide whitespace changes" during review to focus on the
actual changes.

The refactor ensures the mount source file descriptor is closed via
defer in each loop iteration, reducing the total number of open FDs
in runc. This helps avoid hitting the file descriptor limit under
high concurrency or when handling many mounts.

Signed-off-by: lifubang <lifubang@acmcoder.com>
2026-03-20 01:09:49 +00:00
Kir Kolyshkin 65d3120d9e CHANGELOG: forward-port v1.3.5 changes
From commit 488fc13e.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-03-19 12:18:44 -07:00
Kir Kolyshkin 29f2d82a85 CHANGELOG: fix entry placement
Commit 0079bee1 incorrectly placed an entry into v1.4.1 changelog.
Move it to under "Unreleased".

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-03-19 12:18:41 -07:00
lifubang 0d0fd95731 libct: add a nil check for mountError
Signed-off-by: lifubang <lifubang@acmcoder.com>
2026-03-19 15:47:32 +00:00
lfbzhm 837e98c984 Merge pull request #5171 from kolyshkin/runc-buildtags
Makefile: add RUNC_BUILDTAGS, deprecate EXTRA_BUILDTAGS
2026-03-19 16:32:40 +08:00
Kir Kolyshkin d8c62c7d0b Makefile: add RUNC_BUILDTAGS, deprecate EXTRA_BUILDTAGS
A bit of history. EXTRA_BUILDTAGS was introduced in commit dac417174,
as a quick way to add some extra Go build tags to the runc build.

Later, commit 767bc008 changed Makefile to not get EXTRA_TAGS from the
shell environment, as the name is quite generic and some unrelated
environment variable with that name can affect runc build. While such
change does make sense, it makes it more complicated to pass build tags
in CI and otherwise (see e.g. commit 0e1fe368a).

Moreover, runc build uses some Go build tags by default (via Makefile),
and while it is easy to add more build tags (via EXTRA_BUILDTAGS), in
order to remove some existing tags one has to redefine BUILDTAGS from
scratch, which is not very convenient (again, see commit 0e1fe368a which
gets the current value of BUILDTAGS from the Makefile in order to remove
a single tag).

To handle all of the above, let's do this:
 - implement RUNC_BUILDTAGS, fixing the issue of not-so-unique name;
 - allow to get RUNC_BUILDTAGS from shell environment;
 - implement a feature to remove a build tag from default set by
   prefixing it with "-" (as in RUNC_BUILDTAGS="-seccomp");
 - document all this in README;
 - make CI use the new feature;
 - keep EXTRA_BUILDTAGS for backward compatibility, add a make warning
   and a TODO to remove it for runc 1.6.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-03-18 13:17:17 +08:00
Akihiro Suda 348c7663e1 Merge pull request #5172 from kolyshkin/seccomp-wait-kill
Support specs.LinuxSeccompFlagWaitKillableRecv
2026-03-18 09:34:49 +09:00
Kir Kolyshkin 0079bee17f Support specs.LinuxSeccompFlagWaitKillableRecv
This adds support for WaitKillableRecv seccomp flag
(also known as SCMP_FLTATR_CTL_WAITKILL in libseccomp and
as SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV in the kernel).

This requires:
 - libseccomp >= 2.6.0
 - libseccomp-golang >= 0.11.0
 - linux kernel >= 5.19

Note that this flag does not make sense without NEW_LISTENER, and
the kernel returns EINVAL when SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV
is set but SECCOMP_FILTER_FLAG_NEW_LISTENER is not set.

For runc this means that .linux.seccomp.listenerPath should also be set,
and some of the seccomp rules should have SCMP_ACT_NOTIFY action. This
is why the flag is tested separately in seccomp-notify.bats.

At the moment the only adequate CI environment for this functionality is
Fedora 43. On all other platforms (including CentOS 10 and Ubuntu 24.04)
it is skipped similar to this:

> ok 251 runc run [seccomp] (SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV) # skip requires libseccomp >= 2.6.0 and API level >= 7 (current version: 2.5.6, API level: 6)

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-03-16 10:48:42 -07:00
Aleksa Sarai 496b68a305 Merge pull request #5175 from kolyshkin/changelog-runc-init-errors
CHANGELOG: move "better errors from runc init" to 1.4.0
2026-03-15 21:11:24 +09:00
Kir Kolyshkin e232a541bd CHANGELOG: move "better errors from runc init" to 1.4.0
Found out that these changes were backported to release-1.4 (PR 5040)
and made its way into runc v1.4.0, but were missing from its CHANGELOG.

Move the item to v1.4.0 changelog, and add a backport PR reference.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-03-14 15:35:42 -07:00
Aleksa Sarai 5c48e21781 merge #5154 into opencontainers/runc:main
Aleksa Sarai (4):
  VERSION: back to development
  VERSION: release v1.5.0-rc.1
  CHANGELOG: forward-port v1.4.1 entry
  CHANGELOG: add original PR references to backports

LGTMs: rata lifubang
2026-03-13 21:28:25 +09:00
Aleksa Sarai e5b355048c VERSION: back to development
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-13 18:17:43 +09:00
Aleksa Sarai 5d2588d379 VERSION: release v1.5.0-rc.1
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
v1.5.0-rc.1
2026-03-13 18:17:43 +09:00
Aleksa Sarai ced0149acf CHANGELOG: forward-port v1.4.1 entry
Some of the patches in the "unreleased" section were backported and so
they can be moved to the v1.4.1 section to some unneeded avoid
duplication.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-13 16:29:31 +09:00
Aleksa Sarai ed75f30e7a CHANGELOG: add original PR references to backports
When going through the changelog for v1.5.0-rc.1, these PRs were merged
but not referenced by their original PR number in the changelog, making
it harder to figure out which patches since v1.4.0-rc.1 are in
v1.5.0-rc.1 or v1.4.0.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-12 23:20:38 +09:00
Rodrigo Campos Catelin fd0388b2c4 Merge pull request #5170 from cyphar/ci-conmon-libpathrs
gha: install libpathrs for conmon test as well
2026-03-12 13:48:11 +01:00
Aleksa Sarai 9cf46be341 gha: install libpathrs for conmon test as well
Commit 192e3d416f ("ci: add conmon tests run") was merged without
rebasing on top of commit e2c989b7e1 ("build: enable libpathrs by
default"), causing build failures when it was merged.

The solution is to just use the same install script as the rest of CI
from commit 7322b05f41 ("ci: build and install libpathrs").

Fixes: 192e3d416f ("ci: add conmon tests run")
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-12 20:46:10 +09:00
lfbzhm 7837689f9a Merge pull request #5159 from kolyshkin/add-conmon
ci: add conmon tests run
2026-03-12 19:18:14 +08:00
Aleksa Sarai ba01f0fb6a merge #5150 into opencontainers/runc:main
Aleksa Sarai (1):
  conformance: poststart hooks spec now matches runc

LGTMs: rata kolyshkin
2026-03-12 19:05:19 +09:00
Aleksa Sarai d0444a61ba merge #5103 into opencontainers/runc:main
Aleksa Sarai (11):
  gha: test both with and without libpathrs
  build: enable libpathrs by default
  ci: build and install libpathrs
  build: enable builds with libpathrs
  deps: update to cyphar.com/go-pathrs@v0.2.4
  README: document libpathrs build tag
  script: seccomp.sh -> build-seccomp.sh
  build: rename /opt/libseccomp cdylib directory
  build: treat armhf as ARMv7
  dockerfile: switch to Debian 13
  integration: output debug information in fd leak test

LGTMs: rata kolyshkin AkihiroSuda
2026-03-12 18:56:27 +09:00
Aleksa Sarai 1c7b8c9de4 conformance: poststart hooks spec now matches runc
This entry was added by commit 653161f6d8 ("docs/spec-conformance.md:
update for spec v1.3.0") but the spec was updated before the v1.3.0
release to remove this requirement for poststart hooks in order to match
runc's current behaviour.

Fixes: 653161f6d8 ("docs/spec-conformance.md: update for spec v1.3.0")
Ref: opencontainers/runtime-spec#1262
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-12 18:13:16 +09:00
Aleksa Sarai 0e1fe368a2 gha: test both with and without libpathrs
We do plan to make libpathrs required in the future, but in the meantime
we should test both with and without libpathrs in our CI to catch
regressions for users that will not use libpathrs initially.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-12 17:58:11 +09:00
Aleksa Sarai e2c989b7e1 build: enable libpathrs by default
libpathrs has better hardening against certain attacks (most notably on
older kernels) so we should use it by default. This opens the door to
us using cyphar.com/go-pathrs in the future in order to remove some of
our internal/pathrs wrappers (that reimplement bits of libpathrs).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-12 17:58:11 +09:00
Aleksa Sarai 7322b05f41 ci: build and install libpathrs
libpathrs will be opt-out in a future patch so we need to test with it
in our CI.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-12 17:58:11 +09:00
Aleksa Sarai 8689e50cbe build: enable builds with libpathrs
pathrs-lite supports transparently switching to libpathrs.so as the
backend with the "libpathrs" build tag. In order to make this work
properly with our CI and release build scripts, we we need to have a
similar setup as with we do with libseccomp.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-12 17:58:10 +09:00
Aleksa Sarai b58e342758 deps: update to cyphar.com/go-pathrs@v0.2.4
This includes a few fixes for 32-bit builds.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-12 17:58:10 +09:00
Aleksa Sarai ab6f75dd25 README: document libpathrs build tag
Ever since v0.6.0 of github.com/cyphar/filepath-securejoin, pathrs-lite
has been able to transparently switch to using libpathrs as the backend
for safe path resolution (at compile-time, using a build tag). Note that
because build-tags apply globally, this allows for us to easily opt
pure-Go dependencies into all using libpathrs as well for our binaries.

In a future patch this will likely be enabled by default, but document
that this is an option for downstreams that want to opt-in to using
libpathrs.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-12 17:58:10 +09:00
Aleksa Sarai b1a9047c7a script: seccomp.sh -> build-seccomp.sh
This name is far more descriptive.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-12 17:58:10 +09:00
Aleksa Sarai 8292574e7a build: rename /opt/libseccomp cdylib directory
In a future patch this will contain other cdylibs so it deserves a
slightly more general name.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-12 17:58:10 +09:00
Aleksa Sarai 51ae8de054 build: treat armhf as ARMv7
The intention of commit 531e29e192 ("script/lib.sh: set GOARM=5 for
armel, GOARM=6 for armhf") was to properly support older ARM platforms
with our release builds.

However, we have never been able to support ARMv6 for our builds because
we use the Debian compiler to build the libseccomp we statically compile
into our binaries and (as per the now-deleted comment itself) Debian
treats armhf as being ARMv7 so the final binaries we produced were
always only ever compatible with ARMv7+.

This was a bit of an oddity before but when building libpathrs for
releases we will need to use Rust which makes the target more explicit
(and while it does support armhf, we are using the Debian-packaged Rust
cross-compiler and thus are in the same dilemma with what Debian
considers "armhf" to be).

All-in-all, it's better to just bite the bullet and just follow Debian
here properly.

Fixes: 531e29e192 ("script/lib.sh: set GOARM=5 for armel, GOARM=6 for armhf")
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-12 17:58:09 +09:00
Aleksa Sarai 6b757b6aa0 dockerfile: switch to Debian 13
Debian 13 (trixie) was released a few months ago and it's probably
prudent to just upgrade. This is also necessary to get access to riscv64
repositories when we build libpathrs for inclusion in our runc binaries.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-12 17:58:09 +09:00
Aleksa Sarai bb9ee2b0df integration: output debug information in fd leak test
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-12 17:58:09 +09:00
Kir Kolyshkin 192e3d416f ci: add conmon tests run
This adds a CI job to run conmon tests with runc.

Related to issue 5151, PR 5153.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-03-11 16:43:18 -07:00
Aleksa Sarai a462d6f8a8 Merge pull request #5160 from kolyshkin/fixup-relabel
libct/configs: exclude Relabel from json [un]marshaling
2026-03-11 18:54:28 +09:00
Kir Kolyshkin d2abe47689 libct/configs: exclude Relabel from json [un]marshaling
When deprecating Relabel field, its json attributes were mistakenly
removed, so now it is:
 - saved to JSON under "Relabel" (rather than "relabel");
 - won't be ignored if empty.

Let's fix it before it's too late.

Fixes: 8b2b5e94 ("libct: remove relabeling dead code")

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-03-10 14:13:11 -07:00
Aleksa Sarai 5f3ac16d18 merge #5152 into opencontainers/runc:main
Kir Kolyshkin (1):
  libct: remove relabeling dead code

LGTMs: cyphar rata
2026-03-08 00:16:03 +09:00
Rodrigo Campos Catelin 2db0c5e8b1 Merge pull request #5155 from cyphar/intelrdt-improve-mkdir
libct: intelrdt: improve directory cleanup logic
2026-03-06 14:40:40 +01:00
Aleksa Sarai 1c35df9ea2 merge #5153 into opencontainers/runc:main
Kir Kolyshkin (1):
  Revert "Preventing containers from being unable to be deleted"

LGTMs: cyphar rata
2026-03-06 18:48:53 +09:00
Aleksa Sarai fbaf5e3161 libct: intelrdt: improve directory cleanup logic
It makes more sense to save whether we should cleanup the directory
after it gets created (to avoid error cases deleting a different
directory) as well as tying this check to the existing os.ErrExist
check rather than doing an extra stat(2).

Fixes: e2baa3ad10 ("Intel RDT: update according to spec changes.")
Suggested-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2026-03-06 18:45:36 +09:00