Commit Graph

247 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
42a28ad2ca
Update Go to 1.16.7
go1.16.7 (released 2021-08-05) includes a security fix to the net/http/httputil
package, as well as bug fixes to the compiler, the linker, the runtime, the go
command, and the net/http package. See the Go 1.16.7 milestone on the issue
tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.16.7+label%3ACherryPickApproved

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-07 18:07:50 +02:00
AdamKorcz
c3c276ae1c Fuzzing: Fix for OSS-fuzz issue 36825
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-08-04 12:50:36 +01:00
AdamKorcz
41a04246f4 Fuzzing: Add two more fuzzers
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-08-03 12:23:38 +01:00
AdamKorcz
2c699cc350 Fuzzing: Remove panics of container_fuzzer
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-08-02 11:28:05 +01:00
AdamKorcz
acecd66031 Change protoc link
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-07-30 10:06:47 +01:00
AdamKorcz
cc88f8e0ae Split fuzzer to two fuzzers
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-07-27 15:32:22 +01:00
AdamKorcz
6294235d81 Fuzzing: Add container fuzzer
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-07-23 13:01:29 +01:00
AdamKorcz
2556aac675 Fuzzing: Add archive fuzzer
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-07-22 16:39:27 +01:00
Fu Wei
a137b64f50
Merge pull request #5687 from AdamKorcz/fuzz3 2021-07-22 07:28:48 +08:00
AdamKorcz
0789a0c02b Add docker fetch fuzzer
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-07-20 16:33:03 +01:00
Phil Estes
b809212b18
Merge pull request #5750 from thaJeztah/cleanup_test_dockerfile
Refactor / optimize contrib/Dockerfile.test
2021-07-20 10:33:55 -04:00
Aditi Sharma
150e07b648 Use systemd cgroup driver for cgroupv2 tests
Set systemdCgroup for cgroupv2 Kuberentes e2e tests

Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
2021-07-19 10:01:29 +00:00
Sebastiaan van Stijn
9537bc2654
Dockerfile.test: build containerd in separate stage
Looking at how this image is used, I think we don't even need the
source in the final image, so we can build containerd in a separate
stage, and copy the binaries.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-17 17:27:07 +02:00
Sebastiaan van Stijn
36be5ef3a2
Dockerfile.test: add GOLANG_IMAGE build arg to allow overriding
This allows the base image itself to be overridden with an alternative image.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-17 17:19:44 +02:00
Sebastiaan van Stijn
8faacfca16
Dockerfile.test: clean up apt indexes after installing
Not critical for intermediate stages, but a minor optimization to
reduce the image cache. Ideally, this would use cache-mounts for this,
but those may not be supported by podman, so taking the traditional
approach.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-17 17:19:43 +02:00
Sebastiaan van Stijn
9f7e6335c4
Dockerfile.test: build critools in a separate stage
Building critools only requires the install script and the critools-version
file (to determin the version to build). Moving it to a separate stage
prevents rebuilding it if unrelated changes are made in the code.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-17 17:19:40 +02:00
Sebastiaan van Stijn
7ec8e2d369
Dockerfile.test: build cni in a separate stage
Building cni only requires the install script, and the go.mod (to determin
the version to install). Moving it to a separate stage prevents it from
being rebuilt if unrelated changes were made in the codebase.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-17 17:19:34 +02:00
Sebastiaan van Stijn
f9f423c078
Dockerfile.test: standard directory to collect build aftifacts
This allows for easier copying artifacts from stages, by just copying
the directory content to the stage where it's used. These stages are
not used to be run individually so do not have to be "runnable".
Each stage is "responsible" for colllecting all aftifacts in the directory,
so that "consumer" stages do not have to be aware of what needs to be copied.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-17 17:08:47 +02:00
Sebastiaan van Stijn
e9f26eb877
Dockerfile.test: split dev stage, and optimize order
This makes the following changes:

- The containerd/config.toml, and docker-entrypoint.sh only occasionally change,
  so copy them before copying the source code to allow them to be cached.
- The cri-in-userns stage does not need files from proto3, so do not copy them
- The dev environment does need the file from the proto3 stage, so copy them there.
- Change the order of stages. Our CI uses `podman build` which (I think) does not
  skips stages that are not used for the specified target (like BuildKit does).
  So I moved stages that are not used for the `cri-in-userns` after that stage.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-17 17:08:04 +02:00
Sebastiaan van Stijn
25fada0cc7
Dockerfile.test: skip curl, gcc, git and make install
These are already installed by default in the golang image.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-17 14:06:11 +02:00
Akihiro Suda
e72046f86b
Update Go to 1.16.6
Release notes: https://golang.org/doc/devel/release#go1.16

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-07-13 14:05:37 +09:00
Akihiro Suda
aefabe5462
Dockerfile.test: add "cri-in-userns" (aka rootless) test stage
The `cri-in-userns` stage is for testing "CRI-in-UserNS", which should be used in conjunction with "Kubelet-in-UserNS":
https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2033-kubelet-in-userns-aka-rootless

This feature is mostly expected to be used for `kind` and `minikube`.

Requires Rootless Docker/Podman/nerdctl with cgroup v2 delegation: https://rootlesscontaine.rs/getting-started/common/cgroup2/
(Rootless Docker/Podman/nerdctl prepares the UserNS, so we do not need to create UserNS by ourselves)

Usage:
```
podman build --target cri-in-userns -t cri-in-userns -f contrib/Dockerfile.test .
podman run -it --rm --privileged cri-in-userns
```

The stage is tested on CI with Rootless Podman on Fedora 34 on Vagrant.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-07-09 14:50:04 +09:00
ktock
9c01fe20d3 Allow to pass --no-cgroup option to nvidia-container-cli
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-06-14 23:58:22 +09:00
Davanum Srinivas
de6db4038c
Update vendored runc to v1.0.0.0-rc94
Note that this is the code in containerd that uses runc (as almost
a library). Please see the other commit for the update to runc binary
itself.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-05-10 13:12:48 -04:00
Jintao Zhang
79d800b9b0 Update Go to 1.16.4
fix [#45710](https://github.com/golang/go/issues/45710) and CVE-2021-31525.

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
2021-05-07 07:07:09 +08:00
Sebastiaan van Stijn
fbe1e140f2
Update Go to 1.16.3
go1.16.3 (released 2021/04/01) includes fixes to the compiler, linker, runtime,
the go command, and the testing and time packages. See the Go 1.16.3 milestone
on our issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.16.3+label%3ACherryPickApproved

full diff: https://github.com/golang/go/compare/go1.16.2...go1.16.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-19 13:10:18 +02:00
pacoxu
ffff688663 upgrade pause image to 3.5 for non-root
Signed-off-by: pacoxu <paco.xu@daocloud.io>
2021-03-16 23:20:35 +08:00
Phil Estes
a1138182d5
Merge pull request #5180 from dmcgowan/lint-enforce-comments
Fix exported comments enforcer in CI
2021-03-15 10:50:06 -04:00
Derek McGowan
35eeb24a17
Fix exported comments enforcer in CI
Add comments where missing and fix incorrect comments

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-03-12 08:47:05 -08:00
Phil Estes
8cbef0fade
Update to Go 1.16.2
Signed-off-by: Phil Estes <estesp@amazon.com>
2021-03-12 09:59:01 -05:00
Mike Brown
ce8e8e8907
Merge pull request #5036 from thaJeztah/split_runc_binary
Separate runc binary version from libcontainer version, and remove obsolete build-tags
2021-03-11 09:24:30 -06:00
Phil Estes
c55492f8de
Update to Go 1.16.1
Signed-off-by: Phil Estes <estesp@amazon.com>
2021-03-11 09:03:09 -05:00
Sebastiaan van Stijn
79a51cd16a
move runc version to a separate file for easier consumption
This moves the runc version to build to scripts/setup/runc-version,
which makes it easier for packagers to find the default version
to use.

The RUNC_VERSION environment variable can still be used to override
the version, which can be used (e.g.) to test against different versions
in our CI.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-03-10 14:28:29 +01:00
Sebastiaan van Stijn
8325ba5d36
Separate runc binary version from libcontainer version
Now that the dependency on runc (libcontaienr) code has been reduced
considerably, it is probbaly ok to cut the version dependency between
libcontainer and the runc binary that is supported.

This patch separates the runc binary version from the version of
libcontainer that is defined in go.mod, and updates the documentation
accordingly.

The RUNC_COMMIT variable in the install-runc script is renamed to
RUNC_VERSION to encourage using tagged versions, and the Dockerfile
in contrib is updated to allow building with a custom version.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-03-10 13:41:12 +01:00
Akihiro Suda
9ec2778950
Merge pull request #4467 from cyphar/apparmor-update-profile
apparmor: handle signal mediation
2021-03-09 10:55:01 +09:00
Mike Brown
6d68490ef6
Merge pull request #5014 from Iceber/update-pause-version
move to v3.4.1 for the pause image
2021-03-08 15:48:03 -06:00
Akihiro Suda
0580bd6990
apparmor: add DumpDefaultProfile
This function will be used by nerdctl for printing the default AppArmor
profile: `nerdctl system inspect apparmor-profile`

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-03-08 17:28:03 +09:00
Iceber Gu
f37ae8fc35
move to v3.4.1 for the pause image
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2021-03-07 15:21:20 +08:00
Davanum Srinivas
15a4df0ba9
fix names and paths for containerd master
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-03-03 21:27:28 -05:00
Iceber Gu
ba199129b6
update linuxkit readme
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2021-03-01 12:00:56 +08:00
Sebastiaan van Stijn
ec7d905f4e
Update to go 1.15.8
go1.15.8 (released 2021/02/04) includes fixes to the compiler, linker, runtime,
the go command, and the net/http package. See the Go 1.15.8 milestone on the
issue tracker for details.

https://github.com/golang/go/issues?q=milestone%3AGo1.15.8+label%3ACherryPickApproved

full diff: https://github.com/golang/go/compare/go1.15.7...go1.15.8

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-05 12:53:25 +01:00
Aleksa Sarai
d8572b6ca6
apparmor: handle signal mediation
On newer kernels and systems, AppArmor will block sending signals in
many scenarios by default resulting in strange behaviours (container
programs cannot signal each other, or host processes like containerd
cannot signal containers).

The reason this happens only on some distributions (and is not a kernel
regression) is that the kernel doesn't enforce signal mediation unless
the profile contains signal rules. However because our profies #include
the distribution-managed <abstractions/base>, some distributions added
signal rules -- which results in AppArmor enforcing signal mediation and
thus a regression. On these systems, containers cannot send and receive
signals at all -- meaning they cannot signal each other and the
container runtime cannot kill them either.

This issue was fixed in Docker in 2018[1] but this code was copied
before then and thus the patches weren't carried. It also contains a new
fix for a more esoteric case[2]. Ideally this code should live in a
project like "containerd/apparmor" so that Docker, libpod, and
containerd can share it, but that's probably something to do separately.

In addition, the copyright header is updated to reference that the code
is copied from Docker (and thus was not written entirely by the
containerd authors).

[1]: https://github.com/docker/docker/pull/37831
[2]: https://github.com/docker/docker/pull/41337

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-01-30 07:59:00 +11:00
Wei Fu
3299c5560d
Merge pull request #4967 from dmcgowan/cleanup-root
Move documentation and helper directories out of root
2021-01-24 15:08:19 +08:00
Akihiro Suda
45265febd3
Bump Golang 1.15.7
Changes: https://golang.org/doc/devel/release.html#go1.15.minor

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-01-22 20:54:54 +09:00
Sebastiaan van Stijn
e1445dff12
profiles: seccomp: update to Linux 5.11 syscall list
These syscalls (some of which have been in Linux for a while but were
missing from the profile) fall into a few buckets:

 * close_range(2), epoll_wait2(2) are just extensions of existing "safe
   for everyone" syscalls.

 * The mountv2 API syscalls (fs*(2), move_mount(2), open_tree(2)) are
   all equivalent to aspects of mount(2) and thus go into the
   CAP_SYS_ADMIN category.

 * process_madvise(2) is similar to the other process_*(2) syscalls and
   thus goes in the CAP_SYS_PTRACE category.

Co-authored-by: Aleksa Sarai <asarai@suse.de>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-01-21 21:30:25 +01:00
Davanum Srinivas
b72534967e
Bump Golang 1.15.6
Changes: https://golang.org/doc/devel/release.html#go1.15

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-01-12 16:44:36 -05:00
Derek McGowan
7dffdfa560
Move documentation and helper directories out of root
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-01-12 12:19:50 -08:00
Shengjing Zhu
91dc69ee43 docs: point cri release tarball to github release page
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2021-01-03 17:50:40 +08:00
Akihiro Suda
7b04b3cbb6
contrib/apparmor: expose LoadDefaultProfile
Expected to be used by nerdctl: 6026ae740a/internal_oci_hook.go (L170-L180)

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-12-11 19:59:51 +09:00
Shengjing Zhu
56eca84ae8 Remove reference of GO111MODULE=off
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2020-12-01 01:39:10 +08:00