1
0
mirror of https://github.com/opencontainers/runc.git synced 2026-10-23 19:49:01 +03:00

8339 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
810dd0a6dd Merge pull request #5535 from kolyshkin/kir/no-pivot-host-mntns
libct/cfg/validate: disallow some bad configurations
2026-10-23 16:07:08 +00:00
Rodrigo Campos Catelin
c9232a3698 Merge pull request #5573 from kolyshkin/review-policy-reusable
ci/review-policy: allow to use from other repos
2026-10-23 15:45:01 +00:00
Kir Kolyshkin
a254e0e03c ci/review-policy: allow to use from other repos
Make the review-policy workflow reusable (via workflow_call), so other
opencontainers repositories with the same merge rules (such as
opencontainers/cgroups, see opencontainers/cgroups#91) can call it
instead of carrying a copy.

The calling repository gets the same logic, which is fine, since:
 - CHANGELOG.md and vendor/ exceptions are no-ops where there's no
   such file/directory;
 - the merge_group trigger is the caller's, and it's harmless when unused.

The only difference was CODEOWNERS, which cgroups treats as a governance
file. Add it here, too, as it does define who reviews what.

Document how to use it from another repository.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-23 01:19:44 -07:00
Kir Kolyshkin
cfd058c778 Merge pull request #5572 from opencontainers/dependabot/github_actions/zizmorcore/zizmor-action-0.7.1
build(deps): bump zizmorcore/zizmor-action from 0.6.4 to 0.7.1
2026-10-23 06:56:03 +00:00
lfbzhm
9c85446f0f Merge pull request #5567 from kolyshkin/dockerfile-ldconfig
Dockerfile: use ldconfig for dynamic libraries
2026-10-23 06:19:36 +00:00
Kir Kolyshkin
4cc0368c87 Dockerfile: use ldconfig for dynamic libraries
The libseccomp and libpathrs libraries built by Dockerfile are installed
into $DYLIB_DIR/lib, which is only made known to the dynamic linker via
LD_LIBRARY_PATH. Yet runc init is executed with a clean environment, so
it can not find libpathrs.so.0 and dies, resulting in

	unable to start container process: can't copy bootstrap data
	to pipe: write init-p: broken pipe

As a result, "make integration" and some of "make unittest" fail.

Use ldconfig instead of LD_LIBRARY_PATH.

This went unnoticed because CI only builds the image, and never runs
tests in it. Add a quick smoke test (run.bats) to the release job, which
is the only one that builds the image.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-23 13:47:16 +08:00
dependabot[bot]
9cadf1b4e4 build(deps): bump zizmorcore/zizmor-action from 0.6.4 to 0.7.1
Bumps [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) from 0.6.4 to 0.7.1.
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](cc914d7f37...85b2b9fb8e)

---
updated-dependencies:
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.7.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-22 04:52:29 +00:00
lfbzhm
976d95abc4 Merge pull request #5569 from kolyshkin/tests-fix-config-keys
tests/int: fix wrong keys in config.json
2026-10-21 05:29:16 +00:00
Kir Kolyshkin
16a320572c tests/int: fail update_config on jq errors
Since bats does not set pipefail, the exit code of jq in update_config
is ignored, and a jq error results in an empty config.json (as awk
happily writes an empty input), so the test fails later, for an
unrelated reason (or, worse, passes, as it happened with the
"timens offsets with no timens" test).

Save jq output to a variable, and only write it to config.json if jq
succeeded.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-21 11:30:31 +08:00
Kir Kolyshkin
20d4bff0e2 tests/int: fix "timens offsets with no timens" test
The test uses ".linux.namespace" (rather than ".linux.namespaces") in
its jq expression, which results in a jq error. As update_config does
not check jq exit code, config.json ends up being empty, and so the
subsequent runc run fails because of that, not because of what the test
is supposed to check.

Fix the jq expression, so that runc now fails with:

	time namespace offsets specified, but time namespace isn't enabled in the config

Fixes: aa5f4c11 ("tests: add several timens tests")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-21 11:30:31 +08:00
Kir Kolyshkin
c3f58816e7 tests/int: use pageSize key for linux.resources.hugepageLimits
The "runc run (hugetlb limits)" test uses "pagesize" key in
linux.resources.hugepageLimits entries in config.json.

The OCI runtime spec uses "pageSize" key. The test only works because
Go's encoding/json matches keys case-insensitively, which is not the
case for other OCI runtimes, such as crun, when running runc's
integration tests against those.

Use the proper key.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-21 11:30:31 +08:00
Kir Kolyshkin
9de5c0baad tests/int: use lowercase keys for linux.resources.cpu
The "update cpuset parameters via resources.CPU" test uses "CPU",
"Cpus", and "Mems" keys in linux.resources in config.json, and in the
input for runc update -r.

The OCI runtime spec uses "cpu", "cpus", and "mems" keys. The test only
works because Go's encoding/json matches keys case-insensitively, which
is not the case for other OCI runtimes, such as crun, when running
runc's integration tests against those.

Use the proper keys. Since the CPU resources are already set by setup(),
merge the new values into them (which is what effectively happened with
the old keys, too).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-21 11:30:31 +08:00
Akihiro Suda
e488f62829 Merge pull request #5560 from sairex53/5320-quote-mount-error-fields
Quote mount error fields
2026-10-21 02:03:28 +00:00
lfbzhm
1ffa703185 Merge pull request #5547 from kolyshkin/log-no-osync
Do not open log file with O_SYNC
2026-10-20 09:00:55 +00:00
Kir Kolyshkin
2b5f516b12 Do not open log file with O_SYNC
The log file is opened with O_SYNC since commit 8f206929 ("Ensure logs
are flushed", PR #637). The intent was to make sure log entries are not
lingering in a buffer, but *os.File is not buffered: logrus does a
single Write per entry, which is a single write(2), and the data is
visible to any reader (e.g. containerd reading the log after runc
exits) as soon as it returns.

What O_SYNC actually does is wait for the data to hit the disk on every
write, which only helps to preserve the log in case of a host crash or
power loss. This is of little value for runc logs, while the cost on a
slow disk (e.g. a network-attached cloud volume) is substantial,
especially with --debug.

Remove O_SYNC.

Fixes: #5540
Suggested-by: Benjamin Peterson <benjamin@engflow.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-20 16:28:33 +08:00
Akihiro Suda
96a7a46d02 Merge pull request #5562 from opencontainers/dependabot/go_modules/golang.org/x/net-0.61.0
build(deps): bump golang.org/x/net from 0.60.0 to 0.61.0
2026-10-20 07:55:42 +00:00
lfbzhm
ad40b6f3b5 Merge pull request #5563 from kolyshkin/review-policy-merge-group
🚨 ci/review-policy: pass in merge queue
2026-10-20 07:28:51 +00:00
Kir Kolyshkin
bba8d44bb0 ci/review-policy: pass in merge queue
With the merge queue enabled, all required checks must also pass for the
merge group commit. As review-policy only runs on pull_request_review, it
is never reported there, and the queue times out.

Add the merge_group trigger, and skip the actual check for it: a pull
request can only be added to the queue after review-policy has passed.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-18 23:04:06 -07:00
dependabot[bot]
79178d23fa build(deps): bump golang.org/x/net from 0.60.0 to 0.61.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.60.0 to 0.61.0.
- [Commits](https://github.com/golang/net/compare/v0.60.0...v0.61.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.61.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-19 04:59:48 +00:00
Eduard Zateev
db00922379 Quote mount error fields
Quote source, destination, destination fd, and mount data in mount errors
so that embedded control characters are visible in diagnostics.

Fixes: https://github.com/opencontainers/runc/issues/5320
Signed-off-by: Eduard Zateev <hackerowskiy@gmail.com>
2026-10-19 04:10:28 +02:00
Kir Kolyshkin
65c21f346f libct/cfg/validate: disallow / as rootfs
Using host's / as the container rootfs does not work: with a private
mount namespace, pivot_root (or MS_MOVE in case of no-pivot) fails,
and without it, container mounts (such as proc, dev etc.) are mounted
on top of the host ones, effectively breaking the host.

Disallow it.

Add an integration test.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-17 10:30:39 -07:00
Kir Kolyshkin
66e3067ea6 libct/cfg/validate: require mount ns for no-pivot, rootfsPropagation
When the container does not have its own mount namespace, using
--no-pivot results in msMoveRoot being run in the host mount namespace.
It unmounts host's procfs and sysfs mounts, and then moves the container
rootfs on top of the host's /, effectively breaking the host.

Similarly, rootfs propagation is applied to / and to the parent mount of
the container rootfs. Without a private mount namespace, this changes
the propagation of host mounts.

Disallow both configurations.

Add integration tests (the --no-pivot one is marked as unsafe, since
without the fix it breaks the host).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-17 10:30:39 -07:00
Kir Kolyshkin
c107d70ea5 libct/cfg/validate: split security check
Split security into mountns and selinuxCheck, as these are unrelated.

In mountns, return early if there is a private mount namespace.

No functional change.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-17 10:30:18 -07:00
Kir Kolyshkin
1d1e08fd6d libct/cfg/validate: sort checks
The order of checks is not important (none of them modify the config),
so sort the list alphabetically, making it easier to add new entries.

The only visible effect is which error is reported first in case
the configuration has multiple issues.

Suggested-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-17 10:30:18 -07:00
Kir Kolyshkin
2a603d366e Merge pull request #5504 from kolyshkin/ci-podman
ci: add podman tests
2026-10-16 20:14:33 -07:00
Kir Kolyshkin
d2691cb3cb Merge pull request #5528 from kolyshkin/conformance-delete
docs/spec-conformance.md: document deviations
2026-10-16 15:25:38 -07:00
Kir Kolyshkin
c3b18a87c6 docs/spec-conformance.md: document default umask
The runtime spec says that if umask is unspecified, it should not be
changed from the calling process' umask. runc, though, sets the umask
of the container init process to 0022 in this case (as it did before
umask support was added, and as crun does, too). For runc exec, the
umask is not changed.

Document this deviation.

Fixes #3533.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-15 23:51:07 -07:00
Kir Kolyshkin
70173413a7 docs/spec-conformance.md: document lack of ociVersion validation
The runtime spec says ociVersion is REQUIRED and MUST be in SemVer
format, and a runtime must generate an error when encountering an
invalid value. runc does not validate ociVersion at all, accepting
a missing, empty, or invalid value, as well as a version with a
different major.

Document this deviation.

Fixes #1846.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-15 23:51:07 -07:00
Kir Kolyshkin
b1281089d4 Merge pull request #5503 from kolyshkin/test-mount-order-dest
tests/int/mounts: use container paths for mount destinations
2026-10-15 23:47:56 -07:00
Kir Kolyshkin
e84ddb21a9 tests/int/mounts: use container paths for mount destinations
The test_mount_order test used host rootfs paths as mount destinations,
relying on runc stripping the rootfs prefix, which is a legacy runc
behavior not described by the runtime spec.

Use paths inside the container instead, as the spec says, so the test
can also be used with other runtimes (e.g. crun). Bind mount sources
inside the container rootfs are still used, as this is what the test
is about.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-15 23:06:42 -07:00
Kir Kolyshkin
d6b6d8282a Merge pull request #5534 from kolyshkin/kir/fix-4437
libct/int: fix TestExecIn and TestExecInTTY race
2026-10-15 22:57:32 -07:00
Kir Kolyshkin
c1044bf038 Merge pull request #5555 from opencontainers/dependabot/go_modules/golang.org/x/net-0.60.0
build(deps): bump golang.org/x/net from 0.59.0 to 0.60.0
2026-10-15 22:52:03 -07:00
dependabot[bot]
5be7e5cb18 build(deps): bump golang.org/x/net from 0.59.0 to 0.60.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.59.0 to 0.60.0.
- [Commits](https://github.com/golang/net/compare/v0.59.0...v0.60.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.60.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-16 04:52:18 +00:00
Kir Kolyshkin
9ad879a0b8 Merge pull request #5526 from kolyshkin/completion-shebang
contrib/completions/bash: replace shebang
2026-10-15 16:03:08 -07:00
Kir Kolyshkin
0745dd6680 Merge pull request #5452 from kjanat/fix/docs-security-links
docs: fix security links in README
2026-10-15 15:56:35 -07:00
Kir Kolyshkin
c1b8439197 Merge pull request #5523 from kolyshkin/rm-nic-stats
libct: remove dead network stats code
2026-10-15 15:55:10 -07:00
Kir Kolyshkin
1736f2dfc4 Merge pull request #5518 from kolyshkin/ci-bats-install
ci: simplify bats installation
2026-10-15 15:52:41 -07:00
Kir Kolyshkin
a6f2c3489d Merge pull request #5552 from opencontainers/dependabot/github_actions/actions/upload-artifact-7.0.2
build(deps): bump actions/upload-artifact from 7.0.1 to 7.0.2
2026-10-15 15:35:04 -07:00
Kir Kolyshkin
1a15cf9917 Merge pull request #5553 from opencontainers/dependabot/go_modules/golang.org/x/sys-0.49.0
build(deps): bump golang.org/x/sys from 0.48.0 to 0.49.0
2026-10-15 15:33:39 -07:00
Kir Kolyshkin
d501604ab6 Merge pull request #5512 from kolyshkin/review-policy
Proposal: relax PR merge rules, enforce them via CI
2026-10-15 15:30:59 -07:00
Kir Kolyshkin
97d719fea3 ci: add review-policy check
Add a check enforcing the pull request merge rules from
MAINTAINERS_GUIDE.md, to be used as a required status check (in
addition to the GitHub's required number of approvals, which can not
depend on who the author is, and also counts approvals from anyone
having write access, not just from current maintainers).

The check is a pull_request_review workflow with a read-only token,
which evaluates the current state of the pull request using the GitHub
API. No other triggers are used, since branch protection requires the
latest run for each event type to pass, so a failed run triggered by,
say, a push would keep blocking the merge after a review fixes it.

As a result, the check needs a review (a comment-only one is fine) to
be run after a push, and it needs to be re-run manually once a review
period is over.

Note that since the workflow runs from the pull request, a pull request
can change it. This is the price for not using privileged triggers
(pull_request_target or workflow_run) and write permissions. To
mitigate, the workflow is a governance file (so changing it requires
two LGTMs), and GitHub's own required approval stays as a backstop.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-14 13:17:03 -07:00
Kir Kolyshkin
7af1cbcffc MAINTAINERS_GUIDE: clarify and relax PR merge rules
Many pull requests stay open for weeks waiting for a second review,
which slows down development considerably.

Spell out the merge rules, and relax them for maintainers: a pull
request authored by a maintainer can be merged with a single LGTM
from another maintainer, provided it has been open for review for at
least 7 days (14 days for large changes, i.e. more than 100 lines not
counting vendor/), so that other maintainers had a chance to object.

Also, allow routine pull requests (opened by Dependabot, or only
changing documentation and/or CI configuration) to be merged with a
single LGTM.

Neither of the above applies to governance changes, i.e. changes to
the project rules (such as this document) or their enforcement, which
always require two LGTMs.

While at it, clarify that:
 - an LGTM is a pull request approval;
 - the author's own LGTM does not count;
 - a maintainer requesting changes blocks the merge.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-14 12:57:51 -07:00
dependabot[bot]
f39b8a3f43 build(deps): bump golang.org/x/sys from 0.48.0 to 0.49.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.48.0 to 0.49.0.
- [Commits](https://github.com/golang/sys/compare/v0.48.0...v0.49.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-version: 0.49.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-14 15:50:14 +00:00
dependabot[bot]
ec0e4332eb build(deps): bump actions/upload-artifact from 7.0.1 to 7.0.2
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 7.0.1 to 7.0.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](043fb46d1a...cf430e030d)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-14 15:49:08 +00:00
Akihiro Suda
e6d915bf2b Merge pull request #5546 from kolyshkin/no-tcp
Bump godbus/dbus, add godbus_no_tcp build tag
2026-10-14 12:44:22 +09:00
Akihiro Suda
fd5d641dbc Merge pull request #5520 from kolyshkin/carry-5502
libct/specconv: do not pass "defaults" as mount data
2026-10-14 12:43:39 +09:00
Kir Kolyshkin
9b483fe45c Makefile: add godbus_no_tcp build tag
This, together with godbus/dbus bump to v5.2.3 and commit f61eed56,
removes runc binary dependency on DNS resolver from net package,
making the binary slightly smaller.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-13 11:29:35 -07:00
Kir Kolyshkin
58a2347541 deps: bump dbus to v5.2.4
Release notes:
 - https://github.com/godbus/dbus/releases/tag/v5.2.3
 - https://github.com/godbus/dbus/releases/tag/v5.2.4

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-13 11:29:11 -07:00
Kir Kolyshkin
f410007672 ci: install bats to /usr
Install bats to /usr rather than /usr/local, so we no longer need to add
/usr/local/bin to PATH and sudo's secure_path in script/setup_host.sh.

For Dockerfile, it makes no difference (because Debian comes with
/usr/local preconfigured for both PATH and sudo), but do the same change
for uniformity.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-12 22:32:52 -07:00
Kir Kolyshkin
ae1a7771b1 ci: use shallow clone to install bats from source
When installing bats from source (in Dockerfile and setup_host.sh),
do a shallow clone of the needed tag, rather than cloning the whole
repo and then checking out the tag.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-12 22:32:52 -07:00