Commit Graph

12660 Commits

Author SHA1 Message Date
Akihiro Suda
e036bdc985
Merge pull request #7034 from thaJeztah/update_runc
update runc binary to v1.1.3
2022-06-09 19:32:29 +09:00
Sebastiaan van Stijn
0167e55abd
update runc binary to v1.1.3
full diff: https://github.com/opencontainers/runc/compare/v1.1.2...v1.1.3

This is the third release of the 1.1.z series of runc, and contains
various minor improvements and bugfixes.

- Our seccomp `-ENOSYS` stub now correctly handles multiplexed syscalls on
  s390 and s390x. This solves the issue where syscalls the host kernel did not
  support would return `-EPERM` despite the existence of the `-ENOSYS` stub
  code (this was due to how s390x does syscall multiplexing).
- Retry on dbus disconnect logic in libcontainer/cgroups/systemd now works as
  intended; this fix does not affect runc binary itself but is important for
  libcontainer users such as Kubernetes.
- Inability to compile with recent clang due to an issue with duplicate
  constants in libseccomp-golang.
- When using systemd cgroup driver, skip adding device paths that don't exist,
  to stop systemd from emitting warnings about those paths.
- Socket activation was failing when more than 3 sockets were used.
- Various CI fixes.
- Allow to bind mount `/proc/sys/kernel/ns_last_pid` to inside container.
- runc static binaries are now linked against libseccomp v2.5.4.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-09 07:29:43 +02:00
Samuel Karp
2b4b0cf28f
Merge pull request #7000 from akhramov/freebsd_linux_containers 2022-06-08 18:07:39 -07:00
Maksym Pavlenko
007254791e
Merge pull request #7026 from AkihiroSuda/mountinfo-0.6.2
go.mod: github.com/moby/sys/mountinfo v0.6.2
2022-06-08 10:40:29 -07:00
Derek McGowan
5ebd96d256
Merge pull request #7031 from swagatbora90/fix-spelling-overlay
fix minor spelling mistake: lablel -> label
2022-06-08 09:51:33 -07:00
Akihiro Suda
c3fb7dfa7f
go.mod: github.com/moby/sys/mountinfo v0.6.2
https://github.com/moby/sys/compare/mountinfo/v0.6.0...mountinfo/v0.6.2

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-06-08 13:25:08 +09:00
Xinlin Ma
fa4720fa16 fix add ro mount for userattr-unmount unexpected timeout
Signed-off-by: Xinlin Ma <forblue.lin@gmail.com>
2022-06-08 11:34:05 +08:00
Kazuyoshi Kato
0532f666f6
Merge pull request #7027 from AkihiroSuda/containerd-cgroup-1.0.4
go.mod: github.com/containerd/cgroups v1.0.4
2022-06-07 20:10:33 -07:00
Kazuyoshi Kato
a35fbb7ec7
Merge pull request #7028 from AkihiroSuda/continuity-0.3.0
go.mod: github.com/containerd/continuity v0.3.0
2022-06-07 20:10:13 -07:00
Swagat Bora
92d360b58a fix minor spelling mistake: lablel -> label
Signed-off-by: Swagat Bora <sbora@amazon.com>
2022-06-07 21:05:47 +00:00
Derek McGowan
1c54ab1da1
Merge pull request #7029 from Zinbo/correct-spelling-mistake
Correct spelling mistake ("sanbdox" to "sandbox")
2022-06-07 09:49:24 -07:00
Shane Jennings
6190b0f04b
Correct spelling mistake ("sanbdox" to "sandbox")
Signed-off-by: Shane Jennings <superzinbo@gmail.com>
2022-06-07 10:55:15 +01:00
Akihiro Suda
5a6e4144ac
go.mod: github.com/containerd/cgroups v1.0.4
https://github.com/containerd/cgroups/compare/v1.0.3...v1.0.4

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-06-07 17:15:21 +09:00
Akihiro Suda
088c8df3ac
go.mod: github.com/containerd/continuity v0.3.0
https://github.com/containerd/continuity/compare/v0.2.2...v0.3.0

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-06-07 17:14:08 +09:00
Paco Xu
012d68ff90 add gc scheduler metrics: collection count
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2022-06-07 10:33:47 +08:00
Daniel Canter
44e12dc5d8 Windows snapshotter touch ups and new functionality
This change does a couple things to remove some cruft/unused functionality
in the Windows snapshotter, as well as add a way to specify the rootfs
size in bytes for a Windows container via a new field added in the CRI api in
k8s 1.24. Setting the rootfs/scratch volume size was assumed to be working
prior to this but turns out not to be the case.

Previously I'd added a change to pass any annotations in the containerd
snapshot form (containerd.io/snapshot/*) as labels for the containers
rootfs snapshot. This was added as a means for a client to be able to provide
containerd.io/snapshot/io.microsoft.container.storage.rootfs.size-gb as an
annotation and have that be translated to a label and ultimately set the
size for the scratch volume in Windows. However, this actually only worked if
interfacing with the CRI api directly (crictl) as Kubernetes itself will
fail to validate annotations that if split by "/" end up with > 2 parts,
which the snapshot labels will (containerd.io / snapshot / foobarbaz).

With this in mind, passing the annotations and filtering to
containerd.io/snapshot/* is moot, so I've removed this code in favor of
a new `snapshotterOpts()` function that will return platform specific
snapshotter options if ones exist. Now on Windows we can just check if
RootfsSizeInBytes is set on the WindowsContainerResources struct and
then return a snapshotter option that sets the right label.

So all in all this change:
- Gets rid of code to pass CRI annotations as labels down to snapshotters.

- Gets rid of the functionality to create a 1GB sized scratch disk if
the client provided a size < 20GB. This code is not used currently and
has a few logical shortcomings as it won't be able to create the disk
if a container is already running and using the same base layer. WCIFS
(driver that handles the unioning of windows container layers together)
holds open handles to some files that we need to delete to create the
1GB scratch disk is the underlying problem.

- Deprecates the containerd.io/snapshot/io.microsoft.container.storage.rootfs.size-gb
label in favor of a new containerd.io/snapshot/windows/rootfs.sizebytes label.
The previous label/annotation wasn't being used by us, and from a cursory
github search wasn't being used by anyone else either. Now that there is a CRI
field to specify the size, this should just be a field that users can set
on their pod specs and don't need to concern themselves with what it eventually
gets translated to, but non-CRI clients can still use the new label/deprecated
label as usual.

- Add test to cri integration suite to validate expanding the rootfs size.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-06-06 14:57:07 -07:00
Derek McGowan
c1bcabb454
Merge pull request from GHSA-5ffw-gxpp-mxpf
Limit the response size of ExecSync
2022-06-06 10:19:23 -07:00
Kazuyoshi Kato
8bf5995e12
Merge pull request #7018 from lucacome/bump-grpc
Bump grpc to v1.47.0
2022-06-06 10:04:10 -07:00
Kazuyoshi Kato
40aa4f3f1b
Implicitly discard the input to drain the reader
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-06-06 09:57:13 -07:00
Kazuyoshi Kato
00eb74a4ca Make building static binaries simpler
This commit adds STATIC makefile variable to adjust LDFLAGS and build
tags accordingly.

Fixes #5824.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-06-04 03:34:41 +00:00
Nashwan Azhari
d25b4e6f35 Bump Golang and MinGW versions in Windows setup script.
Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
2022-06-03 21:07:53 +03:00
Kazuyoshi Kato
455b45708c
Merge pull request #7017 from lucacome/bump-k8s-deps
Bump k8s.io deps to v0.24.1
2022-06-03 10:33:50 -07:00
Phil Estes
2b661b890f
Merge pull request #6899 from shuaichang/ISSUE6657-support-runtime-snapshotter
Support runtime level snapshotter for issue 6657
2022-06-03 10:04:53 +02:00
shuaichang
7b9f1d4058 Added support for runtime level snapshotter, issue 6657
Signed-off-by: shuaichang <shuai.chang@databricks.com>

Updated annotation name
2022-06-02 16:29:59 -07:00
Luca Comellini
8bc6ccc073
Bump k8s.io deps to v0.24.1
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2022-06-02 15:26:54 -07:00
Luca Comellini
5fcde823dd
Bump grpc to v1.47.0
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2022-06-02 15:25:37 -07:00
Fu Wei
1f4e5175c4
Merge pull request #7012 from thaJeztah/update_golang_1.18.3
update golang to 1.18.3, 1.17.11
2022-06-02 18:49:01 +08:00
Sebastiaan van Stijn
1b3c3860db
update golang to 1.18.3, 1.17.11
go1.18.3 (released 2022-06-01) includes security fixes to the crypto/rand,
crypto/tls, os/exec, and path/filepath packages, as well as bug fixes to the
compiler, and the crypto/tls and text/template/parse packages. See the Go
1.18.3 milestone on our issue tracker for details:

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

update golang to 1.17.11

go1.17.11 (released 2022-06-01) includes security fixes to the crypto/rand,
crypto/tls, os/exec, and path/filepath packages, as well as bug fixes to the
crypto/tls package. See the Go 1.17.11 milestone on our issue tracker for details.

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

Hello gophers,

We have just released Go versions 1.18.3 and 1.17.11, minor point releases.

These minor releases include 4 security fixes following the security policy:

- crypto/rand: rand.Read hangs with extremely large buffers
  On Windows, rand.Read will hang indefinitely if passed a buffer larger than
  1 << 32 - 1 bytes.

  Thanks to Davis Goodin and Quim Muntal, working at Microsoft on the Go toolset,
  for reporting this issue.

  This is [CVE-2022-30634][CVE-2022-30634] and Go issue https://go.dev/issue/52561.
- crypto/tls: session tickets lack random ticket_age_add
  Session tickets generated by crypto/tls did not contain a randomly generated
  ticket_age_add. This allows an attacker that can observe TLS handshakes to
  correlate successive connections by comparing ticket ages during session
  resumption.

  Thanks to GitHub user nervuri for reporting this.

  This is [CVE-2022-30629][CVE-2022-30629] and Go issue https://go.dev/issue/52814.
- `os/exec`: empty `Cmd.Path` can result in running unintended binary on Windows

  If, on Windows, `Cmd.Run`, `cmd.Start`, `cmd.Output`, or `cmd.CombinedOutput`
  are executed when Cmd.Path is unset and, in the working directory, there are
  binaries named either "..com" or "..exe", they will be executed.

  Thanks to Chris Darroch, brian m. carlson, and Mikhail Shcherbakov for reporting
  this.

  This is [CVE-2022-30580][CVE-2022-30580] and Go issue https://go.dev/issue/52574.
- `path/filepath`: Clean(`.\c:`) returns `c:` on Windows

  On Windows, the `filepath.Clean` function could convert an invalid path to a
  valid, absolute path. For example, Clean(`.\c:`) returned `c:`.

  Thanks to Unrud for reporting this issue.

  This is [CVE-2022-29804][CVE-2022-29804] and Go issue https://go.dev/issue/52476.

[CVE-2022-30634]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30634
[CVE-2022-30629]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30629
[CVE-2022-30580]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30580
[CVE-2022-29804]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-29804

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-02 09:45:57 +02:00
Phil Estes
5e876262ed
Merge pull request #7004 from SilverSoldier/patch-1
Fix containerd-stress duration flag
2022-06-02 09:43:36 +02:00
Fu Wei
aa0aaa4947
Merge pull request #7009 from mikebrow/update-gocni 2022-06-02 11:09:46 +08:00
Mike Brown
e3b4d750db update go-cni/for cni update fixing plugins that don't respond with version
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2022-06-01 17:20:18 -05:00
Kazuyoshi Kato
c149e6c2ea
Merge pull request #6996 from dcantah/hpc-validations
Add validations for Windows HostProcess CRI configs
2022-06-01 11:37:12 -07:00
Kazuyoshi Kato
fcd0c86c70
Merge pull request #7007 from dmcgowan/move-docker-sort
Move docker reference logic to reference/docker package
2022-06-01 11:33:52 -07:00
Phil Estes
5bc2d2e429
Merge pull request #7003 from pacoxu/pause-3.7
promote pause image to 3.7 (sync with kube v1.24)
2022-06-01 05:59:14 -04:00
Phil Estes
dd9e6a70dc
Merge pull request #6998 from thaJeztah/urfave_cli_no_docs
Makefile: use urfave_cli_no_docs for binaries that don't need it
2022-06-01 05:32:09 -04:00
Derek McGowan
8ed54849a6
Move docker reference logic to reference/docker package
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-05-31 22:40:49 -07:00
SilverSoldier
f7aa90d273 Fix containerd-stress duration flag
Signed-off-by: Kavya G <soldatargent@gmail.com>
2022-06-01 10:47:18 +05:30
Mike Brown
8c27ce4193
Merge pull request #6993 from mxpv/images
CRI: cleanup cri/store package
2022-05-31 20:38:43 -05:00
Gijs Peskens
ae22854e2b
Linux containers on FreeBSD
This allows running Linux containers on FreeBSD and modifies the
mounts so that they represent the linux emulated filesystems, as per:
https://wiki.freebsd.org/LinuxJails

Co-authored-by: Gijs Peskens <gijs@peskens.net>, Samuel Karp <samuelkarp@users.noreply.github.com>
Signed-off-by: Artem Khramov <akhramov@pm.me>
2022-06-01 00:56:24 +02:00
Kazuyoshi Kato
49ca87d727 Limit the response size of ExecSync
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-05-31 22:21:35 +00:00
Kazuyoshi Kato
78cd9d3b6b
Merge pull request #7001 from dcantah/cri-trun
Use t.Run for /pkg/cri tests
2022-05-31 12:26:48 -07:00
Paco Xu
1cf6f20320 promote pause image to 3.7
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2022-05-30 15:08:28 +08:00
Daniel Canter
b5e1b8f619 Use t.Run for /pkg/cri tests
A majority of the tests in /pkg/cri are testing/validating multiple
things per test (generally spec or options validations). This flow
lends itself well to using *testing.T's Run method to run each thing
as a subtest so `go test` output can actually display which subtest
failed/passed.

Some of the tests in the packages in pkg/cri already did this, but
a bunch simply logged what sub-testcase was currently running without
invoking t.Run.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-05-29 18:32:09 -07:00
Maksym Pavlenko
b572a82ad8 CRI: Remove deprecated error types and update error msg
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-05-28 13:53:28 -07:00
Daniel Canter
978ff393d2 Add validations for Windows HostProcess CRI configs
HostProcess containers require every container in the pod to be a
host process container and have the corresponding field set. The Kubelet
usually enforces this so we'd error before even getting here but we recently
found a bug in this logic so better to be safe than sorry.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-05-27 21:17:07 -07:00
Sebastiaan van Stijn
1a8024b46a
Makefile: use urfave_cli_no_docs for binaries that don't need it
We only need the `ToMan()` as part of the `bin/gen-manpages` binary, which
generates the man-pages; other binaries don't use this code, so we can
set the `urfave_cli_no_docs` build-tag to exclude `cpuguy83/md2man` and
`russross/blackfriday` (and other dependencies) from the binaries:

Before:

    ls -lh bin
    total 149M
    -rwxr-xr-x 1 root root  49M May 27 10:12 containerd
    -rwxr-xr-x 1 root root 6.1M May 27 10:13 containerd-shim
    -rwxr-xr-x 1 root root 8.1M May 27 10:13 containerd-shim-runc-v1
    -rwxr-xr-x 1 root root 8.2M May 27 10:13 containerd-shim-runc-v2
    -rwxr-xr-x 1 root root  22M May 27 10:12 containerd-stress
    -rwxr-xr-x 1 root root  26M May 27 10:11 ctr
    -rwxr-xr-x 1 root root  30M May 27 10:14 gen-manpages

    ls -l bin
    total 151676
    -rwxr-xr-x 1 root root 51280184 May 27 10:12 containerd
    -rwxr-xr-x 1 root root  6332416 May 27 10:13 containerd-shim
    -rwxr-xr-x 1 root root  8458240 May 27 10:13 containerd-shim-runc-v1
    -rwxr-xr-x 1 root root  8536064 May 27 10:13 containerd-shim-runc-v2
    -rwxr-xr-x 1 root root 22567160 May 27 10:12 containerd-stress
    -rwxr-xr-x 1 root root 26873752 May 27 10:11 ctr
    -rwxr-xr-x 1 root root 30508888 May 27 10:14 gen-manpages

After:

    ls -lh bin
    total 147M
    -rwxr-xr-x 1 root root  49M May 27 10:26 containerd
    -rwxr-xr-x 1 root root 6.1M May 27 10:26 containerd-shim
    -rwxr-xr-x 1 root root 8.1M May 27 10:26 containerd-shim-runc-v1
    -rwxr-xr-x 1 root root 8.2M May 27 10:26 containerd-shim-runc-v2
    -rwxr-xr-x 1 root root  22M May 27 10:26 containerd-stress
    -rwxr-xr-x 1 root root  26M May 27 10:26 ctr
    -rwxr-xr-x 1 root root  30M May 27 10:27 gen-manpages

    ls -l bin
    total 149912
    -rwxr-xr-x 1 root root 50930360 May 27 10:26 containerd
    -rwxr-xr-x 1 root root  6332416 May 27 10:26 containerd-shim
    -rwxr-xr-x 1 root root  8458240 May 27 10:26 containerd-shim-runc-v1
    -rwxr-xr-x 1 root root  8536064 May 27 10:26 containerd-shim-runc-v2
    -rwxr-xr-x 1 root root 22209144 May 27 10:26 containerd-stress
    -rwxr-xr-x 1 root root 26523896 May 27 10:26 ctr
    -rwxr-xr-x 1 root root 30508888 May 27 10:27 gen-manpages

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-05-27 19:57:12 +02:00
Kazuyoshi Kato
c76559a6a9
Merge pull request #6997 from thaJeztah/update_urfave
vendor: github.com/urfave/cli v1.22.9 and fix "verify-vendor" script
2022-05-27 10:30:58 -07:00
Sebastiaan van Stijn
5bb47fb956
vendor: github.com/urfave/cli v1.22.9
The regression in v1.22.2 has been resolved, so we can drop the
replace rule and use the latest v1.22.x version.

full diff: https://github.com/urfave/cli/compare/v1.22.1...v1.22.9

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-05-27 13:05:54 +02:00
Sebastiaan van Stijn
a3a2d14ecc
fix verify-vendor if go.mod does not contain replace rules
Before this patch, if the go.mod did not contain a replace rule, jq would fail
(Cannot iterate over null), and Bash would produce an error when trying to add
an empty `$key` to `map_requires`:

    make verify-vendor
    + verify-vendor
      jq: error (at <stdin>:581): Cannot iterate over null (null)
      /go/src/github.com/containerd/containerd//script/verify-go-modules.sh: line 44: map_replaces_1[$key]: bad array subscript
      make: *** [Makefile:435: verify-vendor] Error 1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-05-27 12:57:12 +02:00
Maksym Pavlenko
688b30cf52 CRI: Move truncindex to pkg
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-05-26 13:02:45 -07:00