Commit Graph

279 Commits

Author SHA1 Message Date
Sören Tempel
adee2c7974 seccomp: add support for "swapcontext" syscall in default policy
This system call is only available on 32- and 64-bit PowerPC, it is used
by modern programming language implementations to implement coroutine
features through userspace context switches.

moby [1] and systemd nspawn [2] already whitelist this system call so it
makes sense to whitelist it in containerd as well.

[1]: https://github.com/moby/moby/pull/43092
[2]: https://github.com/systemd/systemd/pull/9487

Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
2022-01-07 18:05:59 +01:00
Sebastiaan van Stijn
0e472420bf
Update Go to 1.17.5
go1.17.5 (released 2021-12-09) includes security fixes to the syscall and net/http
packages. See the Go 1.17.5 milestone on the issue tracker for details:

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

Update Go to 1.17.4
--------------------

go1.17.4 (released 2021-12-02) includes fixes to the compiler, linker, runtime,
and the go/types, net/http, and time packages. See the Go 1.17.4 milestone on
the issue tracker for details:

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-12-12 01:25:02 +01:00
Sebastiaan van Stijn
869ccc01c1
Update Go to 1.17.3
go1.17.3 (released 2021-11-04) includes security fixes to the archive/zip and
debug/macho packages, as well as bug fixes to the compiler, linker, runtime, the
go command, the misc/wasm directory, and to the net/http and syscall packages.
See the Go 1.17.3 milestone on our issue tracker for details.

From the announcement e-mail:

[security] Go 1.17.3 and Go 1.16.10 are released

We have just released Go versions 1.17.3 and 1.16.10, minor point releases.
These minor releases include two security fixes following the security policy:

- archive/zip: don't panic on (*Reader).Open
  Reader.Open (the API implementing io/fs.FS introduced in Go 1.16) can be made
  to panic by an attacker providing either a crafted ZIP archive containing
  completely invalid names or an empty filename argument.
  Thank you to Colin Arnott, SiteHost and Noah Santschi-Cooney, Sourcegraph Code
  Intelligence Team for reporting this issue. This is CVE-2021-41772 and Go issue
  golang.org/issue/48085.
- debug/macho: invalid dynamic symbol table command can cause panic
  Malformed binaries parsed using Open or OpenFat can cause a panic when calling
  ImportedSymbols, due to an out-of-bounds slice operation.
  Thanks to Burak Çarıkçı - Yunus Yıldırım (CT-Zer0 Crypttech) for reporting this
  issue. This is CVE-2021-41771 and Go issue golang.org/issue/48990.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-11-05 12:46:33 +01:00
Derek McGowan
0478e04ae8
Merge pull request #6171 from EGuesnet/Dockerfile_mkdir
Add mkdir on Dockerfile
2021-11-03 12:52:10 -07:00
Étienne Guesnet
82cb0a63e1 Add mkdir on Dockerfile
Signed-off-by: Étienne Guesnet <etienne.guesnet@atos.net>
2021-11-02 09:55:50 +01:00
zounengren
a217b5ac8f bump CNI to spec v1.0.0
Signed-off-by: zounengren <zouyee1989@gmail.com>
2021-10-22 10:58:40 +08:00
zounengren
1f1cad3912 io/ioutil package has been deprecated in Go 1.16 that replaces io/ioutil functions
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2021-10-13 09:18:31 +08:00
Sebastiaan van Stijn
de1a39bf32
Update Go to 1.17.2
go1.17.2 (released 2021-10-07) includes a security fix to the linker and misc/wasm
directory, as well as bug fixes to the compiler, the runtime, the go command, and
to the time and text/template packages. See the Go 1.17.2 milestone on our issue
tracker for details:

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-10-08 15:26:34 +02:00
zounengren
3a713811be run gofmt with Go 1.17
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2021-10-07 20:16:59 +08:00
Derek McGowan
d193dc2b8a
Merge pull request #5915 from AdamKorcz/fuzz12
Fuzzing: Add fuzzers + small modifications
2021-10-04 10:32:05 -07:00
Derek McGowan
63b7e5771e
Merge pull request #5973 from Juneezee/deprecate-ioutil
refactor: move from io/ioutil to io and os package
2021-10-01 10:52:06 -07:00
Derek McGowan
a06a0990ec
Merge pull request #6074 from mikebrow/cleanup
cleanup k8s ansible yaml (carry for #5713)
2021-09-29 13:40:31 -07:00
jayonlau
f6b7e07fd3 cleanup k8s ansible yaml (carry for https://github.com/jayonlau <jayonlau@gmail.com>)
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-09-29 14:25:32 -05:00
Eng Zer Jun
50da673592
refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-09-21 09:50:38 +08:00
AdamKorcz
65f6a896c3 Fuzzing: Add 4 fuzzers + small modifications
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-09-17 11:47:28 +01:00
Akihiro Suda
55923daa9f
seccomp: support "clone3" (return ENOSYS unless SYS_ADMIN is granted)
clone3 is explicitly requested to give ENOSYS instead of the default EPERM, when CAP_SYS_ADMIN is unset.
See moby/moby PR 42681 (thanks to berrange).

Without this commit, rawhide image does not work:
```console
$ sudo ctr run --rm --net-host --seccomp registry.fedoraproject.org/fedora:rawhide foo /usr/bin/curl google.com
curl: (6) getaddrinfo() thread failed to start
```

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-09-15 14:44:45 +09:00
Phil Estes
73dbbf5bfa
Update to Go 1.17.1
Signed-off-by: Phil Estes <estesp@amazon.com>
2021-09-14 09:12:00 -04:00
Fu Wei
d9f921e4f0
Merge pull request #5906 from thaJeztah/replace_os_exec 2021-09-11 10:38:53 +08:00
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