Commit Graph

298 Commits

Author SHA1 Message Date
Maksym Pavlenko
871b6b6a9f Use testify
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-01 18:17:58 -07:00
Phil Estes
00d951e16a
Merge pull request #6751 from nobellium1997/arm-support-gce-configure
Adding multi-arch support for the configure.sh script
2022-04-01 15:58:30 -04:00
Nobel Barakat
4bdac2b43b Adding multi-arch support for the configure.sh script
This script is used by various tests to install and configure
containerd. However, right now it's hardcoded to only support x86
and not other architectures like arm. This change will now check the
architecture of the machine the script is running on and will pull
the correct artifacts accordingly from the correct artifact store
(GCS vs Github).

Signed-off-by: Nobel Barakat <nobelbarakat@google.com>
2022-04-01 19:10:13 +00:00
Akihiro Suda
d0bd65d3c7
Remove unmaintained contrib/linuxkit
The last commit on https://github.com/linuxkit/kubernetes was on Nov 2018.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-04-01 18:16:21 +09:00
Kazuyoshi Kato
067611fdea Remove enumvalue_customname, goproto_enum_prefix and enum_customname
This commit removes gogoproto.enumvalue_customname,
gogoproto.goproto_enum_prefix and gogoproto.enum_customname.

All of them make proto-generated Go code more idiomatic, but we already
don't use these enums in our external-surfacing types and they are anyway
not supported by Google's official toolchain (see #6564).

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-03-21 19:48:16 +00:00
Kazuyoshi Kato
a19ad9bb6f Use Go 1.18 to build and test containerd
Go 1.18 is released. Go 1.16 is no longer supported by the Go team.
golangci-lint is updated since 1.44.2 doesn't support Go 1.18.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-03-18 16:48:25 +00:00
Kazuyoshi Kato
375a217e79
Merge pull request #6423 from AdamKorcz/fuzz17
Fuzzing: refactor metadata fuzzers
2022-03-11 10:19:55 -08:00
Sebastiaan van Stijn
e0a6f9c7d0
update to go 1.16.15, 1.17.8 to address CVE-2022-24921
Addresses [CVE-2022-24921](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24921)

go 1.16.15
--------------------

go1.16.15 (released 2022-03-03) includes a security fix to the regexp/syntax package,
as well as bug fixes to the compiler, runtime, the go command, and to the net package.
See the Go 1.16.15 milestone on the issue tracker for details:

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

full diff: https://github.com/golang/go/compare/go1.16.14...go1.16.15

go 1.17.8
--------------------

go1.17.8 (released 2022-03-03) includes a security fix to the regexp/syntax package,
as well as bug fixes to the compiler, runtime, the go command, and the crypto/x509,
and net packages. See the Go 1.17.8 milestone on the issue tracker for details:

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

full diff: https://github.com/golang/go/compare/go1.17.7...go1.17.8

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-04 16:53:51 +01:00
Sebastiaan van Stijn
f261498e0e
Update Go to 1.16.14, 1.17.7
Includes security fixes for crypto/elliptic (CVE-2022-23806), math/big (CVE-2022-23772),
and cmd/go (CVE-2022-23773).

go1.17.7 (released 2022-02-10) includes security fixes to the crypto/elliptic,
math/big packages and to the go command, as well as bug fixes to the compiler,
linker, runtime, the go command, and the debug/macho, debug/pe, and net/http/httptest
packages. See the Go 1.17.7 milestone on our issue tracker for details:

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

full diff: https://github.com/golang/go/compare/go1.17.6...go1.17.7

Update Go to 1.17.6

go1.17.6 (released 2022-01-06) includes fixes to the compiler, linker, runtime,
and the crypto/x509, net/http, and reflect packages. See the Go 1.17.6 milestone
on our issue tracker for details:

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-02-15 16:28:23 +01:00
David Porter
6e3cc28a66 Wait for containerd installation in GCE scripts
Prior to running the `kube-node-installation.service`, the containerd
installation should be complete as the k8s installation may have
dependencies on containerd and related binaries (e.g ctr). Add
wants/after systemd directives to ensure
`kube-node-installation.service` will only start after containerd
installation completes.

Signed-off-by: David Porter <porterdavid@google.com>
2022-02-10 16:01:13 -08:00
Akihiro Suda
34f7173491
seccomp: kernel 5.16 (futex_waitv)
Allow `futex_waitv` by default.
See https://www.phoronix.com/scan.php?page=news_item&px=FUTEX2-futex-waiv-More-Archs

Note: libseccomp does not cover kernel 5.16 at this moment:
51b50f95e1/src/syscalls.csv

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-02-01 09:08:06 +09:00
Akihiro Suda
8632bdcb7b
seccomp: kernel 5.15 (process_mrelease)
Allow `process_mrelease` by default.

See https://lwn.net/Articles/864184/

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-02-01 09:08:05 +09:00
Akihiro Suda
c013db6965
seccomp: kernel 5.14 (quotactl_fd, memfd_secret)
- Allow `quotactl_fd` when `CAP_SYS_ADMIN` is granted.
  See https://lwn.net/Articles/859679/

- Allow `memfd_secret` by default.
  See https://lwn.net/Articles/865256/

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-02-01 09:08:01 +09:00
Akihiro Suda
17a2831f70
seccomp: kernel 5.13 (landlock_{add_rule,create_ruleset,restrict_self})
Allow the following syscalls by default:
- `landlock_add_rule`
- `landlock_create_ruleset`
- `landlock_restrict_self`

See https://landlock.io/

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-02-01 09:07:33 +09:00
Akihiro Suda
1329ea3716
seccomp: kernel 5.12 (mount_setattr)
Allow `mount_setattr` when `CAP_SYS_ADMIN` is granted.

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

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-02-01 09:06:41 +09:00
Michael Crosby
52b8ca5545
Merge pull request #6411 from nmeum/swapcontext
seccomp: add support for "swapcontext" syscall in default policy
2022-01-31 16:11:55 -05:00
AdamKorcz
86d52fc265 Fuzzing: refactor metadata fuzzers
Signed-off-by: AdamKorcz <adam@adalogics.com>
2022-01-11 21:23:46 +00:00
Derek McGowan
8aca314ddb
Update error message for apparmor parser
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-01-07 12:31:02 -08:00
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
haoyun
bbe46b8c43 feat: replace github.com/pkg/errors to errors
Signed-off-by: haoyun <yun.hao@daocloud.io>
Co-authored-by: zounengren <zouyee1989@gmail.com>
2022-01-07 10:27:03 +08: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