Commit Graph

13124 Commits

Author SHA1 Message Date
Fu Wei
e4fefea554
Merge pull request #7153 from mxpv/install-protobuf 2022-07-15 15:44:29 +08:00
Fu Wei
c0f0627319
Merge pull request #7164 from mxpv/cri-fork 2022-07-15 15:19:28 +08:00
Maksym Pavlenko
98a1b7ff1b Add log messages when choosing CRI server
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-14 09:12:35 -07:00
Phil Estes
470ebf4499
Merge pull request #7167 from thaJeztah/seccomp_sys_nice
seccomp: add get_mempolicy, mbind, set_mempolicy, with CAP_SYS_NICE
2022-07-14 11:54:19 -04:00
Sebastiaan van Stijn
bbb8d34704
seccomp: add get_mempolicy, mbind, set_mempolicy, with CAP_SYS_NICE
This aligns the profile with docker's profile, which added this in
47dfff68e4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-07-14 10:39:55 +02:00
Samuel Karp
bb6278749e
Merge pull request #7158 from bart0sh/PR003-fix-cdi-doc-formatting 2022-07-13 23:17:23 -07:00
Fu Wei
b3eb85a344
Merge pull request #7159 from thaJeztah/bump_go_1.18.4 2022-07-14 09:48:39 +08:00
Sebastiaan van Stijn
19e8479837
seccomp: seccomp: add syscalls related to PKU in default policy
Add pkey_alloc(2), pkey_free(2) and pkey_mprotect(2) in seccomp default profile.
pkey_alloc(2), pkey_free(2) and pkey_mprotect(2) can only configure
the calling process's own memory, so they are existing "safe for everyone" syscalls.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-07-13 23:03:35 +02:00
Maksym Pavlenko
2ba6353316 Change metrics namespace for sandboxed CRI to prevent panic
panic: duplicate metrics collector registration attempted

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-13 12:47:13 -07:00
Maksym Pavlenko
b8e93774c1 Enable integration tests against sandboxed CRI
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-13 12:02:06 -07:00
Maksym Pavlenko
cf5df7e4ac Fork CRI server package
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-13 10:54:59 -07:00
Sebastiaan van Stijn
4ffef752d0
update golang to 1.18.4, 1.17.12
go1.18.4 (released 2022-07-12) includes security fixes to the compress/gzip,
encoding/gob, encoding/xml, go/parser, io/fs, net/http, and path/filepath
packages, as well as bug fixes to the compiler, the go command, the linker,
the runtime, and the runtime/metrics package. See the Go 1.18.4 milestone on the
issue tracker for details:

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

This update addresses:

CVE-2022-1705, CVE-2022-1962, CVE-2022-28131, CVE-2022-30630, CVE-2022-30631,
CVE-2022-30632, CVE-2022-30633, CVE-2022-30635, and CVE-2022-32148.

Full diff: https://github.com/golang/go/compare/go1.18.3...go1.18.4

From the security announcement;
https://groups.google.com/g/golang-announce/c/nqrv9fbR0zE

We have just released Go versions 1.18.4 and 1.17.12, minor point releases. These
minor releases include 9 security fixes following the security policy:

- net/http: improper sanitization of Transfer-Encoding header

  The HTTP/1 client accepted some invalid Transfer-Encoding headers as indicating
  a "chunked" encoding. This could potentially allow for request smuggling, but
  only if combined with an intermediate server that also improperly failed to
  reject the header as invalid.

  This is CVE-2022-1705 and https://go.dev/issue/53188.

- When `httputil.ReverseProxy.ServeHTTP` was called with a `Request.Header` map
  containing a nil value for the X-Forwarded-For header, ReverseProxy would set
  the client IP as the value of the X-Forwarded-For header, contrary to its
  documentation. In the more usual case where a Director function set the
  X-Forwarded-For header value to nil, ReverseProxy would leave the header
  unmodified as expected.

  This is https://go.dev/issue/53423 and CVE-2022-32148.

  Thanks to Christian Mehlmauer for reporting this issue.

- compress/gzip: stack exhaustion in Reader.Read

  Calling Reader.Read on an archive containing a large number of concatenated
  0-length compressed files can cause a panic due to stack exhaustion.

  This is CVE-2022-30631 and Go issue https://go.dev/issue/53168.

- encoding/xml: stack exhaustion in Unmarshal

  Calling Unmarshal on a XML document into a Go struct which has a nested field
  that uses the any field tag can cause a panic due to stack exhaustion.

  This is CVE-2022-30633 and Go issue https://go.dev/issue/53611.

- encoding/xml: stack exhaustion in Decoder.Skip

  Calling Decoder.Skip when parsing a deeply nested XML document can cause a
  panic due to stack exhaustion. The Go Security team discovered this issue, and
  it was independently reported by Juho Nurminen of Mattermost.

  This is CVE-2022-28131 and Go issue https://go.dev/issue/53614.

- encoding/gob: stack exhaustion in Decoder.Decode

  Calling Decoder.Decode on a message which contains deeply nested structures
  can cause a panic due to stack exhaustion.

  This is CVE-2022-30635 and Go issue https://go.dev/issue/53615.

- path/filepath: stack exhaustion in Glob

  Calling Glob on a path which contains a large number of path separators can
  cause a panic due to stack exhaustion.

  Thanks to Juho Nurminen of Mattermost for reporting this issue.

  This is CVE-2022-30632 and Go issue https://go.dev/issue/53416.

- io/fs: stack exhaustion in Glob

  Calling Glob on a path which contains a large number of path separators can
  cause a panic due to stack exhaustion.

  This is CVE-2022-30630 and Go issue https://go.dev/issue/53415.

- go/parser: stack exhaustion in all Parse* functions

  Calling any of the Parse functions on Go source code which contains deeply
  nested types or declarations can cause a panic due to stack exhaustion.

  Thanks to Juho Nurminen of Mattermost for reporting this issue.

  This is CVE-2022-1962 and Go issue https://go.dev/issue/53616.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-07-13 11:59:05 +02:00
Ed Bartosh
c733119db7 cri doc: fix formatting for CDI options
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2022-07-13 12:38:58 +03:00
Phil Estes
ff91434af1
Merge pull request #7152 from dcantah/fix-err-comments-cri
Fix out of date comments for CRI store packages
2022-07-12 10:46:49 -04:00
Samuel Karp
efd1ff778b
Merge pull request #7124 from ginglis13/devmapper-docs 2022-07-11 21:58:12 -07:00
Ye Sijun
f77d45e3ba
ctr: support --user for run/create
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2022-07-12 11:53:03 +08:00
Maksym Pavlenko
22dfc68ade Fix protobuf script to install protobuf on darwin
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-11 15:01:21 -07:00
Daniel Canter
bcdc8468f8 Fix out of date comments for CRI store packages
All of the CRI store related packages all use the standard errdefs
errors now for if a key doesn't or already exists (ErrAlreadyExists,
ErrNotFound), but the comments for the methods still referenced
some unused package specific error definitions. This change just
updates the comments to reflect what errors are actually returned
and adds comments for some previously undocumented exported functions.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-07-11 13:57:39 -07:00
Phil Estes
de4e2e11d4
Merge pull request #7149 from AkihiroSuda/seccomp-clock_settime64
seccomp: allow clock_settime64 when CAP_SYS_TIME is added
2022-07-11 11:52:17 -04:00
Gavin Inglis
174b013446 update some devmapper docs
Updated some documentation for devmapper snapshotter plugin.
Made consistent use of "thin-pool", "Device Mapper" when referring to
the volume management framework, and "devmapper" when referring to the
snapshotter plugin itself.

Also added some additional resources / reorg.

Signed-off-by: Gavin Inglis <giinglis@amazon.com>
2022-07-11 15:49:54 +00:00
Akihiro Suda
575095fcd6
seccomp: allow clock_settime64 when CAP_SYS_TIME is added
Port moby/moby PR 43775

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-07-11 10:04:13 +09:00
Derek McGowan
681aaf68b7
Merge pull request #7123 from kzys/fuzz
Copy fuzzers from github.com/cncf/cncf-fuzzing
2022-07-06 14:52:28 -07:00
Kazuyoshi Kato
bfb316cb86
Merge pull request #6847 from zhanghe9702/pr/fix-content-edit
fix can't edit object by using ctr content edit command
2022-07-06 10:33:14 -07:00
Kazuyoshi Kato
a0da9edd98
Merge pull request #7130 from eltociear/patch-1
integration/client: fix typo in export_test.go
2022-07-06 09:49:02 -07:00
Kazuyoshi Kato
e9e33f847d Copy fuzzers from github.com/cncf/cncf-fuzzing
This commit copies the fuzzers from the repository except for
containerd_import_structured_fuzzer.go.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-07-06 15:21:48 +00:00
Kazuyoshi Kato
b316318596 Upgrade github.com/AdaLogics/go-fuzz-headers
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-07-06 15:21:45 +00:00
Ikko Ashimine
6d4b61007b integration/client: fix typo in export_test.go
Seet -> Seek
begining -> beginning

Signed-off-by: Ikko Ashimine <eltociear@gmail.com>
2022-07-06 11:14:45 +09:00
Phil Estes
c4b1b368ad
Merge pull request #7126 from kzys/fix-auth-param
Fix WWW-Authenticate parsing
2022-07-05 11:20:35 -04:00
Ye Sijun
ccd1d22ad1
fix incorrect namespace of event when create/update namespace
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2022-07-05 12:13:26 +08:00
zhanghe9702
b8bb33b92d fix can't edit object by using ctr content edit command
Signed-off-by: zhang he <zhanghe9702@163.com>
2022-07-04 11:44:44 +08:00
Kazuyoshi Kato
548c9c317b Fix WWW-Authenticate parsing
According to RFC 9110, quoted-string could be "".

https://datatracker.ietf.org/doc/html/rfc9110#section-11.6.1
https://datatracker.ietf.org/doc/html/rfc9110#appendix-A

Fixes #6376.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-07-01 20:26:39 +00:00
Phil Estes
7eae7f206c
Merge pull request #7112 from dcantah/lcow-notimpl
LCOW differ return ErrNotImplemented for wrong mount type
2022-06-30 10:52:36 -04:00
Rodrigo Campos
b8403d2e15 Update k8s.io/cri-api to v0.25.0-alpha2
This version contains the CRI changes for user namespaces support.
Future patches will use the new fields in the CRI.

Updating the module without using the new fields doesn't cause any
behaviour change.

Updates: #7063

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2022-06-30 12:09:08 +02:00
Fu Wei
42d6923fe8
Merge pull request #7117 from estesp/update-restful 2022-06-30 08:02:14 +08:00
Derek McGowan
aee50aeac2
Merge pull request #7108 from fuweid/refactor-cri-api
pkg/cri: use marshal wrapper for version convertor
2022-06-29 13:58:15 -07:00
Phil Estes
a44cabf517
Update go-restful/v3 to latest release
Signed-off-by: Phil Estes <estesp@amazon.com>
2022-06-29 15:23:10 -04:00
Wei Fu
c2703c08c9 pkg/cri: use marshal wrapper for version convertor
Use wrapper for ReopenContainerLog v1alpha proto.

Ref: #5619

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-06-29 22:20:47 +08:00
Daniel Canter
d2588b3fa4 LCOW differ return ErrNotImplemented for wrong mount type
On Windows the two differs we register by default are the "windows" and
"windows-lcow" differs. The diff service checks if Apply returns
ErrNotImplemented and will move on to the next differ in the line.
The Windows differ makes use of this to fallback to LCOW if it's
determined the mount type passed is incorrect, but the LCOW differ
does not return ErrNotImplemented for the same scenario. This puts
a strict ordering requirement on the default differ entries in the config,
namely that ["windows", "windows-lcow"] will work, as windows will correctly
fall back to the lcow differ, but ["windows-lcow", "windows"] won't as
the diff services Apply will just return the error directly.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-06-28 17:19:04 -07:00
Kazuyoshi Kato
78c4d3de72
Merge pull request #7087 from kzys/fuzz-less-hacks
Remove hacks around contrib/fuzz
2022-06-28 09:24:37 -07:00
Phil Estes
36bd4a5178
Merge pull request #7107 from wzshiming/fix/close-http-body
Fix missing closed HTTP Body
2022-06-28 08:54:02 -04:00
Shiming Zhang
0a240ff811 Fix missing closed HTTP Body
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2022-06-28 14:49:27 +08:00
Derek McGowan
b76544b8f5
Merge pull request #7105 from mxpv/cleanup
Cleanup metadata tests
2022-06-27 16:23:24 -07:00
Kazuyoshi Kato
f7de1c8f90 Do not hardcode fuzzers
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-06-27 22:54:25 +00:00
Kazuyoshi Kato
2b60770c4b Move container_fuzzer.go under integration/client/
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-06-27 22:54:25 +00:00
Kazuyoshi Kato
66cc0fc879 Copy FuzzCRI from cncf/cncf-fuzzing
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-06-27 22:54:25 +00:00
Kazuyoshi Kato
ca5637104b Remove mainfuzz package and StartDaemonForFuzzing
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-06-27 22:54:25 +00:00
Kazuyoshi Kato
17f9c3a0ef Move builtins_*.go to cmd/containerd/builtins to make the files reusable
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-06-27 22:54:25 +00:00
Maksym Pavlenko
d97b754a5b Cleanup metadata tests
This commit replaces func returns with t.Cleanup,
which makes API and tests slightly easier to maintain.

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-06-27 14:42:22 -07:00
Phil Estes
813780e443
Merge pull request #7106 from gabriel-samfira/force-downgrade-mingw
Downgrade MinGW to version 10.2.0
2022-06-27 17:40:07 -04:00
Gabriel Adrian Samfira
1ef4bda433
Downgrade MinGW to version 10.2.0
There is currently an issue in the race detector in Go on Windows when
used with a newer version of GCC. The issue was first reported here:

https://github.com/golang/go/issues/46099

Fixes #7104

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-06-27 22:40:08 +03:00