Commit Graph

361 Commits

Author SHA1 Message Date
AdamKorcz
96ec0b6f34 content fuzzer: Clean up tempdir
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-09-04 13:41:11 +01:00
Adelina Tuvenie
6d3d34b85d Update Pause image in tests & config
With the introduction of Windows Server 2022, some images have been updated
to support WS2022 in their manifest list. This commit updates the test images
accordingly.

Signed-off-by: Adelina Tuvenie <atuvenie@cloudbasesolutions.com>
2021-08-31 19:42:57 +03:00
Sebastiaan van Stijn
2ac9968401
replace uses of os/exec with golang.org/x/sys/execabs
Go 1.15.7 contained a security fix for CVE-2021-3115, which allowed arbitrary
code to be executed at build time when using cgo on Windows. This issue also
affects Unix users who have “.” listed explicitly in their PATH and are running
“go get” outside of a module or with module mode disabled.

This issue is not limited to the go command itself, and can also affect binaries
that use `os.Command`, `os.LookPath`, etc.

From the related blogpost (ttps://blog.golang.org/path-security):

> Are your own programs affected?
>
> If you use exec.LookPath or exec.Command in your own programs, you only need to
> be concerned if you (or your users) run your program in a directory with untrusted
> contents. If so, then a subprocess could be started using an executable from dot
> instead of from a system directory. (Again, using an executable from dot happens
> always on Windows and only with uncommon PATH settings on Unix.)
>
> If you are concerned, then we’ve published the more restricted variant of os/exec
> as golang.org/x/sys/execabs. You can use it in your program by simply replacing

This patch replaces all uses of `os/exec` with `golang.org/x/sys/execabs`. While
some uses of `os/exec` should not be problematic (e.g. part of tests), it is
probably good to be consistent, in case code gets moved around.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-25 18:11:09 +02:00
Akihiro Suda
d3aa7ee9f0
Run go fmt with Go 1.17
The new `go fmt` adds `//go:build` lines (https://golang.org/doc/go1.17#tools).

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-08-22 09:31:50 +09:00
Phil Estes
70d122b290
Merge pull request #5889 from estesp/update-go-1.17
Update to Go 1.17
2021-08-20 10:57:36 -04:00
Derek McGowan
fda782a7b9
Merge pull request #5886 from AdamKorcz/fuzz11
Fuzzing: Add fuzzer
2021-08-17 09:41:50 -07:00
Phil Estes
f8602c3725
Update to Go 1.17
Signed-off-by: Phil Estes <estesp@amazon.com>
2021-08-17 12:27:39 -04:00
AdamKorcz
c9b1b2fd5b Fuzzing: Add fuzzer
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-08-17 00:08:59 +01:00
Aditi Sharma
9e1b57ca01 Add env for SystemdCgroup driver
Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
2021-08-16 17:27:55 +05:30
AdamKorcz
538d93d2fc Fuzzing: Add 4 fuzzers
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-08-12 15:34:12 +01:00
Phil Estes
159c0f04e5
Merge pull request #5840 from AdamKorcz/fuzz9
Fuzzing: Add experimental version of container fuzzer
2021-08-11 11:45:49 -04:00
AdamKorcz
5e49ec27dc Use http.Get to download binaries instead of exec.Command
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-08-10 12:48:33 +01:00
zounengren
30b832e494 archive docs and point to new location
fix #https://github.com/containerd/cri/issues/1624

Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2021-08-10 15:54:06 +08:00
AdamKorcz
11a90c7ff4 Fuzzing: Add experimental version of container fuzzer
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-08-09 11:18:25 +01:00
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
Shengjing Zhu
553a369158 Fix reference to vendor.conf in scripts
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2020-12-01 01:34:10 +08:00
Shengjing Zhu
8344990520 Remove duplicate systemd units file
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2020-11-25 01:40:52 +08:00
Akihiro Suda
af0a20a4d5
Bump Golang 1.15.5
Changes: https://golang.org/doc/devel/release.html#go1.15

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-11-16 14:36:35 +09:00
Sebastiaan van Stijn
0a1104bcf3
seccomp: add pidfd_getfd syscall (gated by CAP_SYS_PTRACE)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-11-13 13:36:33 +01:00
Sebastiaan van Stijn
2dbbd10fd6
seccomp: add pidfd_open and pidfd_send_signal
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-11-13 13:36:25 +01:00
Evan
6d088549c9
Support AppArmor beta version format
Signed-off-by: Evan Tsai <devillordking@gmail.com>
2020-10-15 22:55:26 +11:00
Derek McGowan
e7a350176a
Merge containerd/cri into containerd/containerd
Signed-off-by: Derek McGowan <derek@mcg.dev>
2020-10-07 10:58:39 -07:00
Maksym Pavlenko
5b3ac0c86f
Merge pull request #4050 from thaJeztah/bump_golang_1.14
Update to golang 1.15.2
2020-09-14 09:42:13 -07:00
Roy Yang
9e094abd08 Refractor the script to work in both python2 and python3
Signed-off-by: Roy Yang <royyang@google.com>
2020-09-11 13:53:33 -07:00
Sebastiaan van Stijn
d1c8d98658
update to golang 1.15.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-11 09:21:25 +02:00
Michael Crosby
f9d231f660
Merge pull request #4493 from thaJeztah/seccomp_uring
seccomp: allow io-uring related system calls
2020-08-25 11:39:45 -04:00
Michael Crosby
396b863138
Merge pull request #4491 from thaJeztah/seccomp_syslog
seccomp: move the syslog syscall to be gated by CAP_SYS_ADMIN or CAP_SYSLOG
2020-08-25 11:35:28 -04:00
Sebastiaan van Stijn
325bac7c71
seccomp: allow io-uring related system calls
Adds the io-uring related system call introduced in kernel 5.1 to the
seccomp whitelist. With older kernels or older versions of libseccomp,
this configure will be omitted.

Note that io_uring will grow support for more syscalls in the future
so we should keep an eye on this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:59:53 +02:00
Sebastiaan van Stijn
0a5ee7e6f3
seccomp: allow clock_settime when CAP_SYS_TIME is added
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:43:21 +02:00
Sebastiaan van Stijn
5cdb6e81d2
seccomp: allow quotactl with CAP_SYS_ADMIN
This allows the quotactl syscall in the default seccomp profile, gated by
CAP_SYS_ADMIN.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:40:43 +02:00
Sebastiaan van Stijn
5862285fac
seccomp: allow sync_file_range2 on supported architectures.
On a ppc64le host, running postgres (tried with 9.4 to 9.6) gives the following
warning when trying to flush data to disks (which happens very frequently):

     WARNING: could not flush dirty data: Operation not permitted.

A quick dig in postgres source code indicate it uses sync_file_range(2) to
flush data; which on ppe64le and arm64 is translated to sync_file_range2(2)
for alignements reasons.

The profile did not allow sync_file_range2(2), making postgres sad because
it can not flush its buffers. arm_sync_file_range(2) is an ancient alias to
sync_file_range2(2), the syscall was renamed in Linux 2.6.22 when the same
syscall was added for PowerPC.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:36:53 +02:00
Sebastiaan van Stijn
117d678749
seccomp: allow personality with UNAME26 bit set
From personality(2):

    Have uname(2) report a 2.6.40+ version number rather than a 3.x version
    number.  Added as a stopgap measure to support broken applications that
    could not handle the  kernel  version-numbering  switch  from 2.6.x to 3.x.

This allows both "UNAME26|PER_LINUX" and "UNAME26|PER_LINUX32".

Fixes: "setarch broken in docker packages from Debian stretch"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:27:14 +02:00
Sebastiaan van Stijn
fc9e5d161a
seccomp: allow syscall membarrier
Add the membarrier syscall to the default seccomp profile.
It is for example used in the implementation of dlopen() in
the musl libc of Alpine images.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:16:26 +02:00
Sebastiaan van Stijn
1746a195e9
seccomp: allow adjtimex get time operation
Enabled adjtimex in the default profile without requiring CAP_SYS_TIME privilege.
The kernel will check CAP_SYS_TIME and won't allow setting the time.

Fixes: Getting the system time with ntptime returns an error in an unprivileged
container

To verify, inside a CentOS 7 container:

    yum install -y ntp
    ntptime
    # ntp_gettime() returns code 0 (OK)

    ntpdate -v time.nist.gov
    # ntpdate[84]: Can't adjust the time of day: Operation not permitted

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:16:23 +02:00
Sebastiaan van Stijn
7e7545e556
seccomp: allow add preadv2 and pwritev2 syscalls
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:16:21 +02:00
Sebastiaan van Stijn
267a0cf68e
seccomp: move the syslog syscall to be gated by CAP_SYS_ADMIN or CAP_SYSLOG
This call is what is used to implement `dmesg` to get kernel messages
about the host. This can leak substantial information about the host.
It is normally available to unprivileged users on the host, unless
the sysctl `kernel.dmesg_restrict = 1` is set, but this is not set
by standard on the majority of distributions. Blocking this to restrict
leaks about the configuration seems correct.

Relates to docker/docker#37897 "docker exposes dmesg to containers by default"

See also https://googleprojectzero.blogspot.com/2018/09/a-cache-invalidation-bug-in-linux.html

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 11:57:48 +02:00
Jintao Zhang
6a915a1453 seccomp: add faccessat2 syscall.
related to https://patchwork.kernel.org/patch/11545287/

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
2020-08-17 21:48:21 +08:00
Jintao Zhang
e28e55f455 seccomp: add openat2 syscall.
related to https://patchwork.kernel.org/patch/11167585/

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
2020-08-16 16:28:21 +08:00
Lantao Liu
ccda537604
Create etcd user in cloud init.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:11 -07:00
Mike Brown
e973719ccf
use containerd/project header test
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2020-08-11 09:15:11 -07:00
Lantao Liu
cb7ffd4b0b
Fix indent in cni.template.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:11 -07:00
Lantao Liu
3e03ba7aa2
Update deployment and integration test
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:11 -07:00
Lantao Liu
9c54517920
Add TaskMax=infinity
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:11 -07:00
Lantao Liu
523b0b3c61
Remove noSnat
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:11 -07:00
Lantao Liu
231d291b2d
Use v2 config.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:11 -07:00
Lantao Liu
1e1688d211
Use per-pod shim.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:11 -07:00
Lantao Liu
87bd84a7bb
Add DefaultRuntimeName option.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:10 -07:00
Lantao Liu
cfab98a5fd
Use ctr images import.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:10 -07:00
Lantao Liu
5e3ac16cc6
Add cri as required plugin.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:10 -07:00
Lantao Liu
5b9d8476ea
Use runc.v1 for now for debugging.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:10 -07:00
Lantao Liu
e6e272e740
Enable runc.v2 as the default runtime in test.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:10 -07:00
Lantao Liu
d19aa0fd2e
Use local env to avoid writing to passed-in readonly env.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:10 -07:00
Lantao Liu
ee6d69bbc1
Set default "" to extra runtime handler.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:10 -07:00
Tim Allclair
474c79bd52
Expose vars to configure an additional runtime handler
Expose environment variables in the GCE containerd configuration
script for configuring an additional runtime handler. This unblocks
E2E testing of custom runtime handlers.

Signed-off-by: Tim Allclair <tallclair@google.com>
2020-08-11 09:15:10 -07:00
Lantao Liu
ce12477f47
Support docker 18.09 in the test script.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:10 -07:00
Lantao Liu
1467121010
Remove the unused health-monitor.sh.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:09 -07:00
Lantao Liu
201ad4d3c4
Support netd in GCE bootstrap.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:09 -07:00
Lantao Liu
5ce7057502
Serve streaming on localhost by default to match k8s 1.11 default.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:09 -07:00
Lantao Liu
b553fdaf31
Remove crictl on GCE for all cases.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:09 -07:00
Lantao Liu
d8ce08fd92
Set stream server to serve on localhost on GCE.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:09 -07:00
Lantao Liu
1629bab7f9
Make max container log line size configurable through cloud init.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:09 -07:00
Lantao Liu
042378dcf1
Disable TLS streaming to work with new kubelet streaming proxy.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:09 -07:00
Bingshen Wang
37f2ecad97
Update cni.template
Format the cni.template, use `space` instead of some `tab`. Avoid indent issue in text editor.

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
2020-08-11 09:15:09 -07:00
Lantao Liu
b58b6fef86
Disable restart plugin on GCE.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:08 -07:00
Lantao Liu
f938a166cd
Fix kube-container-runtime-monitor.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:08 -07:00
Lantao Liu
91f8e61bd3
Use crictl installed in kube-up.sh
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:08 -07:00
Lantao Liu
5161f663e4
Add unix:// prefix for socket addresses used by CRI remote client.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:08 -07:00
Lantao Liu
1b995fcaf2
Add KUBE_CONTAINER_RUNTIME_NAME to fix fluentd support.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:08 -07:00
Lantao Liu
48457a254e
Try using preloaded containerd if no version is specified.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:08 -07:00
Lantao Liu
c67a38b0b5
Add log level support.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:08 -07:00
Lantao Liu
4453aac005
Improve gce bootstrapping in various ways.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:08 -07:00
Lantao Liu
1bd3cdc572
Add cni config template support.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:07 -07:00
Lantao Liu
d520fac508
Enable TLS streaming in all the setup.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:07 -07:00
Lantao Liu
cdb4aec93a
Use systemd service cgroup and oom score adj.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:07 -07:00
Lantao Liu
af8bd80689
Fix for kube-up.sh and update several documments.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:07 -07:00
Lantao Liu
005da4a9b9
Replace ctrcri with ctr cri.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:07 -07:00
Lantao Liu
0e2bd216ce
Update GCE cluster bootstrapping and e2e test
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:07 -07:00
Lantao Liu
59e65e1f37
Enable container log rotation.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:07 -07:00
Lantao Liu
85b4e69c9f
Do not block on stream server close.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:07 -07:00
Lantao Liu
2ea6584ca7
Add initial wait for health-monitor and use pkill -x.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:07 -07:00
Lantao Liu
56b7ef2c4d
The ENV is finalized as KUBE_KUBELET_EXTRA_ARGS.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:06 -07:00
Mike Brown
24a3a0a068
change crictl sandboxes to pods; other references to sandboxes
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2020-08-11 09:15:06 -07:00
Lantao Liu
8bc30e7a2e
Update ocicni to main stream.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:06 -07:00
Lantao Liu
a010715584
Add a separate CLI for cri-containerd ctrcri.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:06 -07:00
Lantao Liu
a843a30645
Use registry-1.docker.io as backup
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:06 -07:00
Lantao Liu
ec649079a9
Put version into metadata so that version won't be changed across
restart.

Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:06 -07:00
Lantao Liu
7cbc1c8dc3
Set registry mirror.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:06 -07:00
Lantao Liu
9f0816ac43
Configure container runtime cgroups for cgroup.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:06 -07:00
Lantao Liu
be72f47ec9
Add runtime cgroup and fix a cli panic.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:05 -07:00
Lantao Liu
680e21c430
Update all glog flags to log-level.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:05 -07:00
Lantao Liu
d50b9dd64c
Update containerd to 6c7abf7c76c1973d4fb4b0bad51691de84869a51.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:05 -07:00
Lantao Liu
869ea6b0c8
Add document for kube-up.sh
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:05 -07:00
Lantao Liu
30cbfb62ec
Add OS and arch in release tarball.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:05 -07:00
Lantao Liu
0512d1e0b2
Add cluster directory and health-monitor.sh.
Signed-off-by: Lantao Liu <lantaol@google.com>
2020-08-11 09:15:05 -07:00
Sebastiaan van Stijn
55c9eade39
Bump Golang 1.13.15
full diff: https://github.com/golang/go/compare/go1.13.14...go1.13.15

go1.13.15 (released 2020/08/06) includes security fixes to the encoding/binary
package. See the Go 1.13.15 milestone on the issue tracker for details.

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-08 15:07:28 +02:00
Sebastiaan van Stijn
089672fff4
Bump Golang 1.13.14
full diff: https://github.com/golang/go/compare/go1.13.13...go1.13.14

go1.13.14 (released 2020/07/16) includes fixes to the compiler, vet, and the
database/sql, net/http, and reflect packages. See the Go 1.13.14 milestone on
the issue tracker for details:

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-17 15:37:52 +02:00
Akihiro Suda
c520f819a2
Bump Go 1.13.13
Includes security fixes to the `crypto/x509` and `net/http` packages.

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

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-07-15 14:24:48 +09:00
Florian Schmaus
e977564a8b seccomp: allow 'rseq' syscall in default seccomp profile
Restartable Sequences (rseq) are a kernel-based mechanism for fast
update operations on per-core data in user-space. Some libraries, like
the newest version of Google's TCMalloc, depend on it [1].

This also makes dockers default seccomp profile on par with systemd's,
which enabled 'rseq' in early 2019 [2].

1: https://google.github.io/tcmalloc/design.html
2: systemd/systemd@6fee3be

Signed-off-by: Florian Schmaus <flo@geekplace.eu>
2020-06-26 17:10:05 +02:00
Wei Fu
e89500bcb0
Merge pull request #4333 from AkihiroSuda/golang-1.13.12
Bump Golang 1.13.12
2020-06-23 08:54:05 +08:00
Davanum Srinivas
2b0a994ccc
explicitly fail apparmor when !linux
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-06-22 12:54:09 -04:00
Akihiro Suda
1a83f9a638
Bump Golang 1.13.12
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-06-22 16:49:31 +09:00