Commit Graph

5830 Commits

Author SHA1 Message Date
Kir Kolyshkin e4d23d50fa CHANGELOG.md: nit
The 1.1.0 "Changed" heading level is not proper.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-01-20 18:42:21 -08:00
Sebastiaan van Stijn 62133e3840 Merge pull request #3306 from kolyshkin/rdt-faster
Faster Intel RDT init if the feature is unavailable
2022-01-19 11:24:41 +01:00
Aleksa Sarai 17543edd15 merge branch 'pr-3338'
Aleksa Sarai (2):
  VERSION: back to development
  VERSION: release runc v1.1.0

LGTMs: AkihiroSuda thaJeztah hqhq
Closes #3338
2022-01-18 09:44:11 +11:00
Aleksa Sarai d7f7b22a85 VERSION: back to development
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2022-01-17 19:16:33 +11:00
Aleksa Sarai 067aaf8548 VERSION: release runc v1.1.0
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
v1.1.0
2022-01-17 19:16:31 +11:00
Akihiro Suda c83abc503d Merge pull request #3331 from kolyshkin/nsenter-unsup
Refuse to build runc without nsenter
2022-01-05 14:18:02 +09:00
Kir Kolyshkin c0e300f109 Refuse to build runc without nsenter
Commit 4d1d6185ab added this
nsenter_unsupported.go file in order for nsenter to be a valid (but
empty, non-functional) Go package on unsupported platforms.

As a result, runc can be build successfully without CGO, which results
in a non-working and hard-to-debug binary (see issue 3330).

As the functionality of being able to compile a package which is
definitely not working is questionable, and I can't think of any use
cases, let's remove the file.

With this, runc can no longer be build without CGO:

	[kir@kir-rhat runc]$ CGO_ENABLED=0 make runc
	go build -trimpath "-buildmode=pie"  -tags "seccomp" -ldflags "-X main.gitCommit=v1.0.0-452-g00f56786-dirty -X main.version=1.1.0-rc.1+dev " -o runc .
	go build github.com/opencontainers/runc/libcontainer/nsenter: build constraints exclude all Go files in /home/kir/go/src/github.com/opencontainers/runc/libcontainer/nsenter

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-01-04 15:49:41 -08:00
Akihiro Suda 00f56786bb Merge pull request #3328 from opencontainers/dependabot/go_modules/github.com/checkpoint-restore/go-criu/v5-5.3.0
build(deps): bump github.com/checkpoint-restore/go-criu/v5 from 5.2.0 to 5.3.0
2021-12-23 11:00:22 +09:00
dependabot[bot] e155b3322c build(deps): bump github.com/checkpoint-restore/go-criu/v5
Bumps [github.com/checkpoint-restore/go-criu/v5](https://github.com/checkpoint-restore/go-criu) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/checkpoint-restore/go-criu/releases)
- [Commits](https://github.com/checkpoint-restore/go-criu/compare/v5.2.0...v5.3.0)

---
updated-dependencies:
- dependency-name: github.com/checkpoint-restore/go-criu/v5
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-22 04:18:26 +00:00
Akihiro Suda 81044ad7c9 Merge pull request #3325 from kolyshkin/rm-go115
libct/cg: rm go 1.15 compatibility
2021-12-15 11:39:50 +09:00
Kir Kolyshkin 5c7e898186 libct/cg: rm go 1.15 compatibility
Since commit 12e99a0f8d we do require Go >= 1.16, so this file
is no longer needed.

Also, this actually ensures that go >= 1.16 is used (otherwise
libcontainer/cgroups/getallpids.go won't compile).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-12-14 13:08:47 -08:00
Aleksa Sarai 7113a40898 merge branch 'pr-3323'
Aleksa Sarai (2):
  VERSION: back to development
  VERSION: release v1.1.0-rc.1

LGTMs: AkihiroSuda kolyshkin
Closes #3323
2021-12-14 15:27:16 +11:00
Aleksa Sarai 4773769ce1 VERSION: back to development
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-12-14 14:23:02 +11:00
Aleksa Sarai 55df1fc4c8 VERSION: release v1.1.0-rc.1
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
v1.1.0-rc.1
2021-12-14 14:23:00 +11:00
Kir Kolyshkin 6c1e2ecc20 Merge pull request #3320 from cyphar/changelog
CHANGELOG: add an in-repo changelog file
2021-12-13 12:51:14 -08:00
Aleksa Sarai a8f9d5defc CHANGELOG: add an in-repo changelog file
This will make releases much simpler. I've back-filled the changelog
with everything since runc 1.0.0 (there's not much point going further
back than that).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-12-13 13:22:11 +11:00
Aleksa Sarai 7e792c9236 merge branch 'pr-3301'
Kir Kolyshkin (1):
  libct/utils: ResolveRootfs: remove

LGTMs: AkihiroSuda cyphar
Closes #3301
2021-12-09 23:11:12 +11:00
Akihiro Suda 4e56a2b35e Merge pull request #3313 from kolyshkin/int-nits
libct/int: minor improvements
2021-12-09 19:20:59 +09:00
Aleksa Sarai e7dfcc93af Merge pull request #3314 from kolyshkin/seccomp-2.5.3
release: update libseccomp to 2.5.3, minor script fixes
2021-12-09 20:36:54 +11:00
Kir Kolyshkin 6d2067a4bf script/seccomp.sh: fix argc check
This check was always broken, and it slipped through the cracks because
we never run it without additional architectures now.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-12-09 00:59:47 -08:00
Kir Kolyshkin 457ca62f1f script/release_*.sh: fix usage
- release_build: fix -H <hash_cmd> option (was -h)
- release_sign: add -H and -S options

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-12-09 00:59:43 -08:00
Kir Kolyshkin c729594cdd deps: update libseccomp to 2.5.3
It was released about a month ago. I don't see anything major
in the changelog but it makes sense to keep tracking upstream deps.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-12-09 00:38:25 -08:00
Aleksa Sarai 1b747a43f0 merge branch 'pr-3309'
Aleksa Sarai (1):
  release: correctly handle binary signing for "make releaseall"

LGTMs: AkihiroSuda kolyshkin
Closes #3309
2021-12-09 16:47:31 +11:00
Kir Kolyshkin 5d77962099 tests/int: use update_config in hooks test
Using "$@" instead of $1 in update_config() allows us to use it from
hooks.bats, where jq is used with more options than usual.

We need to disable SC2016 as otherwise shellcheck sees $something inside
single quotes and think we are losing the shell expansion (we are not).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-12-08 21:36:27 -08:00
Kir Kolyshkin 9e798e26cb tests/int: ability to specify binary
This can be used to specify a different runc binary, for example:

	sudo -E RUNC=$PWD/runc.mine tests/integration/cwd.bats

A different (but compatible enough) runtime also works:

	sudo -E RUNC=/usr/local/bin/crun tests/integration/cwd.bats

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-12-08 21:25:05 -08:00
Kir Kolyshkin 13b0806f12 Merge pull request #3272 from AkihiroSuda/mount-rro
Support recursive mount attrs ("rro", "rnosuid", "rnodev", ...)
2021-12-08 11:02:26 -08:00
Aleksa Sarai 4b22d8e446 Merge branch 'pr-3310'
Akihiro Suda (2):
  types/features: clarify MountOptions
  Mark `runc features` experimental

LGTMs: cyphar mrunalp
Closes #3310
2021-12-08 17:07:21 +11:00
Mrunal Patel cd07af28ce Merge pull request #3304 from kolyshkin/lint-extra
ci: enable extra linters for new code
2021-12-07 15:58:10 -08:00
Akihiro Suda 97688ddff3 types/features: clarify MountOptions
`MountOptions` does not contain `const void *data` options.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-12-07 18:36:04 +09:00
Akihiro Suda deb0a5f2ef Mark runc features experimental
Follow-up to PR 3296

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-12-07 17:51:39 +09:00
Akihiro Suda 382eba4354 Support recursive mount attrs ("rro", "rnosuid", "rnodev", ...)
The new mount option "rro" makes the mount point recursively read-only,
by calling `mount_setattr(2)` with `MOUNT_ATTR_RDONLY` and `AT_RECURSIVE`.
https://man7.org/linux/man-pages/man2/mount_setattr.2.html

Requires kernel >= 5.12.

The "rro" option string conforms to the proposal in util-linux/util-linux Issue 1501.

Fix issue 2823

Similary, this commit also adds the following mount options:
- rrw
- r[no]{suid,dev,exec,relatime,atime,strictatime,diratime,symfollow}

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-12-07 17:39:57 +09:00
Akihiro Suda ba935a51a6 Support nosymfollow mount option (kernel 5.10)
See MS_NOSYMFOLLOW in mount(2)

https://man7.org/linux/man-pages/man2/mount.2.html

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-12-07 17:33:49 +09:00
Akihiro Suda f8c48e4617 go.mod: golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-12-07 17:33:46 +09:00
Aleksa Sarai acd8f12f24 release: correctly handle binary signing for "make releaseall"
My GPG keys are not available inside the container, so it makes little
sense to try to sign the binaries inside the container's release.sh. The
solution is to split things into separate build and sign stages, with
signing ocurring after the in-Docker build.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-12-07 18:10:34 +11:00
Aleksa Sarai cdce249635 merge branch 'pr-3057'
Fraser Tweedale (1):
  chown cgroup to process uid in container namespace

LGTMs: kolyshkin cyphar
Closes #3057
2021-12-07 17:06:19 +11:00
Aleksa Sarai 2b0ca195d6 merge branch 'pr-3296'
Akihiro Suda (1):
  Add `runc features` command

LGTMs: kolyshkin cyphar
Closes #3296
2021-12-07 16:15:37 +11:00
Aleksa Sarai f50369af4b Merge pull request from GHSA-v95c-p5hm-xq8f
runc init: avoid netlink message length overflows
2021-12-06 15:30:29 +11:00
Kir Kolyshkin edeb3b376c libct/intelrdt: faster init if rdt is unsupported
In a (quite common) case RDT is not supported by the kernel/hardware,
it does not make sense to parse /proc/cpuinfo and /proc/self/mountinfo,
and yet the current code does it (on every runc exec, for example).

Fortunately, there is a quick way to check whether RDT is available --
if so, kernel creates /sys/fs/resctrl directory. Check its existence,
and skip all the other initialization if it's not present.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-12-03 15:59:30 -08:00
Kir Kolyshkin 6c6b14e075 libct/intelrdt: remove findMountpointDir test
This test was written back in the day when findIntelRdtMountpointDir
was using its own mountinfo parser. Commit f1c1fdf911 changed that,
and thus this test is actually testing moby/sys/mountinfo parser, which
does not make much sense.

Remove the test, and drop the io.Reader argument since we no longer need
to parse a custom file.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-12-03 15:59:24 -08:00
Kir Kolyshkin 02e961bcf9 libct/intelrdt: wrap Root in sync.Once
In case resctrl filesystem can not be found in /proc/self/mountinfo
(which is pretty common on non-server or non-x86 hardware), subsequent
calls to Root() will result in parsing it again and again.

Use sync.Once to avoid it. Make unit tests call it so that Root() won't
actually parse mountinfo in tests.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-12-03 15:58:43 -08:00
Aleksa Sarai d72d057ba7 runc init: avoid netlink message length overflows
When writing netlink messages, it is possible to have a byte array
larger than UINT16_MAX which would result in the length field
overflowing and allowing user-controlled data to be parsed as control
characters (such as creating custom mount points, changing which set of
namespaces to allow, and so on).

Co-authored-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-12-03 16:07:40 +11:00
Sebastiaan van Stijn 45c31f9e1f Merge pull request #3305 from kolyshkin/rdt-4
libct/intelrdt: remove unused type
2021-12-02 18:06:57 +01:00
Kir Kolyshkin 25112dd179 libct/intelrdt: remove unused type
Since commit 7296dc1712, type intelRdtData is only used by tests,
and since commit 79d292b9f, its only member is config.

Change the test to use config directly, and remove the type.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-11-30 18:03:28 -08:00
Kir Kolyshkin c4a61aa918 ci: enable extra linters for new code
This adds a new GHA CI job which runs a few extra linters. This is only
done for pull requests, and should only warn about new code.

The justification is simple: we want more linters, but since this is not
a new project, adding a new linter meaning we have to fix all the
existing warnings. In some cases having all the warnings fixed is
difficult and takes time, plus it is usually a low priority task.

Therefore, we are stuck with inability to add new linters because we
can't fix all their warnings. Meanwhile, new pull requests add more
code which is not linted.

This is an attempt to break this vicious cycle. Let's enable godot
and revive for now and see how it is going.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-11-30 16:51:55 -08:00
Sebastiaan van Stijn 0c0ec3f53f Merge pull request #3302 from kolyshkin/ci-unparam
Enable unparam linter; fix/mute existing warnings
2021-11-30 23:21:30 +01:00
Akihiro Suda 520702dac5 Add runc features command
Fix issue 3274

See `types/features/features.go`.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-11-30 16:40:39 +09:00
Kir Kolyshkin 02475d9c8b .golangci.lint: add unparam linter
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-11-29 20:10:22 -08:00
Kir Kolyshkin 953e56c56f libct/int: runContainer: drop console arg
It is not and was never ever used.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-11-29 20:10:22 -08:00
Kir Kolyshkin 6c0bfcb1c8 libct/cg/fs/blkio_test: ignore unparam warning
Ignore the following warning:

> libcontainer/cgroups/fs/blkio_test.go:167:78: `appendBlkioStatEntry` - `minor` always receives `0` (unparam)
> func appendBlkioStatEntry(blkioStatEntries *[]cgroups.BlkioStatEntry, major, minor, value uint64, op string) {

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-11-29 20:10:22 -08:00
Kir Kolyshkin 06b3fd9d19 libct/cg/ebpf: drop finalize return value
It never returns any error, so let's drop it (in case it needs to be
re-added, it is easy to do so).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-11-29 20:10:22 -08:00