Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync with containerd v1.6.18 #10

Open
wants to merge 204 commits into
base: CC-main
Choose a base branch
from

Conversation

jepio
Copy link
Member

@jepio jepio commented Feb 23, 2023

No description provided.

thaJeztah and others added 30 commits August 8, 2022 10:12
A container should not have access to tun/tap device, unless it is explicitly
specified in configuration.

This device was already removed from docker's default, and runc's default;

- opencontainers/runc@2ce40b6
- https://github.com/moby/moby//commit/9c4570a958df42d1ad19364b1a8da55b891d850a

Per the commit message in runc, this should also fix these messages;

> Apr 26 03:46:56 foo.bar systemd[1]: Couldn't stat device /dev/char/10:200: No such file or directory

coming from systemd on every container start, when the systemd cgroup driver
is used, and the system runs an old (< v240) version of systemd
(the message was presumably eliminated by [1]).

[1]: systemd/systemd@d5aecba

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit a3ac156)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
[release/1.6 backport] oci: WithDefaultUnixDevices(): remove tun/tap from the default devices
Signed-off-by: Maksym Pavlenko <[email protected]>
Signed-off-by: Andrey Klimentyev <[email protected]>
(cherry picked from commit 5f3ce95)
Signed-off-by: Andrey Klimentyev <[email protected]>
Signed-off-by: Samuel Karp <[email protected]>
(cherry picked from commit 396d2a7)
Signed-off-by: Samuel Karp <[email protected]>
…y/1.6

[release/1.6] ci: remove GOPROXY environment variable due to https://github.com/go-…
Signed-off-by: Akihiro Suda <[email protected]>
(cherry picked from commit ad59701)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
[release/1.6 backport] update runc binary to v1.1.4
full diff: golang/crypto@32db794...3147a52

This version contains a fix for CVE-2022-27191 (not sure if it affects us).

From the golang mailing list:

    Hello gophers,

    Version v0.0.0-20220315160706-3147a52a75dd of golang.org/x/crypto/ssh implements
    client authentication support for signature algorithms based on SHA-2 for use with
    existing RSA keys.

    Previously, a client would fail to authenticate with RSA keys to servers that
    reject signature algorithms based on SHA-1. This includes OpenSSH 8.8 by default
    and—starting today March 15, 2022 for recently uploaded keys.

    We are providing this announcement as the error (“ssh: unable to authenticate”)
    might otherwise be difficult to troubleshoot.

    Version v0.0.0-20220314234659-1baeb1ce4c0b (included in the version above) also
    fixes a potential security issue where an attacker could cause a crash in a
    golang.org/x/crypto/ssh server under these conditions:

    - The server has been configured by passing a Signer to ServerConfig.AddHostKey.
    - The Signer passed to AddHostKey does not also implement AlgorithmSigner.
    - The Signer passed to AddHostKey does return a key of type “ssh-rsa” from its PublicKey method.

    Servers that only use Signer implementations provided by the ssh package are
    unaffected. This is CVE-2022-27191.

    Alla prossima,

    Filippo for the Go Security team

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Dan Čermák <[email protected]>
(cherry picked from commit 9aadef1)
…pto-vendor

[release/1.6] backport: vendor: golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd
Signed-off-by: ruiwen-zhao <[email protected]>
Signed-off-by: zounengren <[email protected]>
Signed-off-by: zounengren <[email protected]>
…e_1.6

[release/1.6] cherry-pick: ContainerStatus to return container resources
[release/1.6] cherry-pick: Set grpc code for unimplemented cri-api methods
The [Openlab][1] has deprecated zuul jobs. We don't see any active the
zuul jobs in PR. Remove it and we need to seek new solution for ARM64
CI test.

[1]: <https://github.com/theopenlab>

Signed-off-by: Wei Fu <[email protected]>
(cherry picked from commit f9166aa)
Signed-off-by: Wei Fu <[email protected]>
previously PR 7369 removed .zuul jobs directory as zuul jobs are deprecated in openlab

Signed-off-by: Benjamin Elder <[email protected]>
(cherry picked from commit dcb0d8f)
Signed-off-by: Wei Fu <[email protected]>
[release/1.6] .zuul: remove the zull because it is offline
Signed-off-by: Iceber Gu <[email protected]>
(cherry picked from commit 3cfde73)
Signed-off-by: Iceber Gu <[email protected]>
Signed-off-by: Ye Sijun <[email protected]>
(cherry picked from commit 68a55fe)
Signed-off-by: Phil Estes <[email protected]>
[release/1.6] cherry-pick: make xattr EPERM non-fatal in createTarFile
Failpoint is used to control the fail during API call when testing, especially
the API is complicated like CRI-RunPodSandbox. It can help us to test
the unexpected behavior without mock. The control design is based on freebsd
fail(9), but simpler.

REF: https://www.freebsd.org/cgi/man.cgi?query=fail&sektion=9&apropos=0&manpath=FreeBSD%2B10.0-RELEASE

Signed-off-by: Wei Fu <[email protected]>
(cherry picked from commit ffd59ba)
Signed-off-by: Qiutong Song <[email protected]>
Currently, the runc shimv2 commandline manager doesn't support ttrpc
server's customized option, for example, the ttrpc server interceptor.
This commit is to allow the task plugin can return the
`UnaryServerInterceptor` option to the manager so that the task plugin
can do enhancement before handling the incoming request, like API-level
failpoint control.

Signed-off-by: Wei Fu <[email protected]>
(cherry picked from commit 822cc51)
Signed-off-by: Qiutong Song <[email protected]>
Added new runc shim binary in integration testing.

The shim is named by io.containerd.runc-fp.v1, which allows us to use
additional OCI annotation `io.containerd.runtime.v2.shim.failpoint.*` to
setup shim task API's failpoint. Since the shim can be shared with
multiple container, like what kubernetes pod does, the failpoint will be
initialized during setup the shim server. So, the following the
container's OCI failpoint's annotation will not work.

This commit also updates the ctr tool that we can use `--annotation` to
specify annotations when run container. For example:

```bash
➜  ctr run -d --runtime runc-fp.v1 \
     --annotation "io.containerd.runtime.v2.shim.failpoint.Kill=1*error(sorry)" \
     docker.io/library/alpine:latest testing sleep 1d

➜  ctr t ls
TASK       PID       STATUS
testing    147304    RUNNING

➜  ctr t kill -s SIGKILL testing
ctr: sorry: unknown

➜  ctr t kill -s SIGKILL testing

➜  sudo ctr t ls
TASK       PID       STATUS
testing    147304    STOPPED
```

The runc-fp.v1 shim is based on core runc.v2. We can use it to inject
failpoint during testing complicated or big transcation API, like
kubernetes PodRunPodsandbox.

Signed-off-by: Wei Fu <[email protected]>
(cherry picked from commit 5f9b318)
Signed-off-by: Qiutong Song <[email protected]>
If there is any unskipable error during setuping shim plugins, we should
fail return error to prevent from leaky shim instance. For example,
there is error during init task plugin, the shim ttrpc server will not
contain any shim API method. The any call to the shim will receive that

  failed to create shim task: service containerd.task.v2.Task: not implemented

Then containerd can't use `Shutdown` to let the shim close. The shim
will be leaky. And also fail return if there is no ttrpc service.

Signed-off-by: Wei Fu <[email protected]>
(cherry picked from commit b297775)
Signed-off-by: Qiutong Song <[email protected]>
AkihiroSuda and others added 28 commits February 8, 2023 13:12
…snlabel

[release/1.6 backport] Export remote snapshotter label handler
[1.6] Backport default registry hosts config
Signed-off-by: Ye Sijun <[email protected]>
(cherry picked from commit 5bf7052)
Signed-off-by: Akihiro Suda <[email protected]>
Signed-off-by: Ye Sijun <[email protected]>
(cherry picked from commit 72b87ad)
Signed-off-by: Akihiro Suda <[email protected]>
Signed-off-by: Ye Sijun <[email protected]>
(cherry picked from commit 1ab42be)
Signed-off-by: Akihiro Suda <[email protected]>
Signed-off-by: Ye Sijun <[email protected]>
(cherry picked from commit 2dbff1d)
Signed-off-by: Akihiro Suda <[email protected]>
Signed-off-by: Akihiro Suda <[email protected]>
(cherry picked from commit ef2560d)
Signed-off-by: Akihiro Suda <[email protected]>
Test suite:
```yaml

---
apiVersion: v1
kind: Pod
metadata:
  name: test-no-option
  annotations:
    description: "Equivalent of `docker run` (no option)"
spec:
  restartPolicy: Never
  containers:
    - name: main
      image: ghcr.io/containerd/busybox:1.28
      args: ['sh', '-euxc',
             '[ "$(id)" = "uid=0(root) gid=0(root) groups=0(root),10(wheel)" ]']
---
apiVersion: v1
kind: Pod
metadata:
  name: test-group-add-1-group-add-1234
  annotations:
    description: "Equivalent of `docker run --group-add 1 --group-add 1234`"
spec:
  restartPolicy: Never
  containers:
    - name: main
      image: ghcr.io/containerd/busybox:1.28
      args: ['sh', '-euxc',
             '[ "$(id)" = "uid=0(root) gid=0(root) groups=0(root),1(daemon),10(wheel),1234" ]']
  securityContext:
    supplementalGroups: [1, 1234]
---
apiVersion: v1
kind: Pod
metadata:
  name: test-user-1234
  annotations:
    description: "Equivalent of `docker run --user 1234`"
spec:
  restartPolicy: Never
  containers:
    - name: main
      image: ghcr.io/containerd/busybox:1.28
      args: ['sh', '-euxc',
             '[ "$(id)" = "uid=1234 gid=0(root) groups=0(root)" ]']
  securityContext:
    runAsUser: 1234
---
apiVersion: v1
kind: Pod
metadata:
  name: test-user-1234-1234
  annotations:
    description: "Equivalent of `docker run --user 1234:1234`"
spec:
  restartPolicy: Never
  containers:
    - name: main
      image: ghcr.io/containerd/busybox:1.28
      args: ['sh', '-euxc',
             '[ "$(id)" = "uid=1234 gid=1234 groups=1234" ]']
  securityContext:
    runAsUser: 1234
    runAsGroup: 1234
---
apiVersion: v1
kind: Pod
metadata:
  name: test-user-1234-group-add-1234
  annotations:
    description: "Equivalent of `docker run --user 1234 --group-add 1234`"
spec:
  restartPolicy: Never
  containers:
    - name: main
      image: ghcr.io/containerd/busybox:1.28
      args: ['sh', '-euxc',
             '[ "$(id)" = "uid=1234 gid=0(root) groups=0(root),1234" ]']
  securityContext:
    runAsUser: 1234
    supplementalGroups: [1234]
```

Signed-off-by: Akihiro Suda <[email protected]>
(cherry picked from commit 3eda46a)
> Conflicts:
>	integration/addition_gids_test.go
>	pkg/cri/sbserver/container_create_linux.go
Signed-off-by: Akihiro Suda <[email protected]>
For running CI in a non-upstream repo

Signed-off-by: Akihiro Suda <[email protected]>
(cherry picked from commit fe0116e)
> Conflicts:
>	.github/workflows/codeql.yml
>	.github/workflows/fuzz.yml
Signed-off-by: Akihiro Suda <[email protected]>
[release/1.6] Prepare release notes for v1.6.17
[release/1.6] CI: skip some jobs when `repo != containerd/containerd`
This reverts commit 1acca8b.

As stated in the Godoc, this function is intended to check for presence
of `apparmor_parser`. Changing this regressed the public API of
containerd, and directly contradicts the way that this function is
consumed inside of containerd itself:
* https://github.com/containerd/containerd/blob/fdfdc9bfc0f865a43c88171110615d1510fad3bc/pkg/apparmor/apparmor.go#L20
* https://github.com/containerd/containerd/blob/fdfdc9bfc0f865a43c88171110615d1510fad3bc/pkg/cri/sbserver/helpers_linux.go#L85
* https://github.com/containerd/containerd/blob/fdfdc9bfc0f865a43c88171110615d1510fad3bc/pkg/cri/server/helpers_linux.go#L144

This has lead to a number of painful regressions and attempted fixes in
Moby:
* moby/moby#44900
* moby/moby#44902
* moby/moby#44970

While reverting this late into the life of 1.6 and at the start of the
life of 1.7 is likely painful, I think this is ultimately the best path
to take, as containerd is subject to the same failure to start
containers with an AppArmor kernel when `apparmor_parser` is missing as
Moby.

Signed-off-by: Bjorn Neergaard <[email protected]>
(cherry picked from commit a326510)
Signed-off-by: Bjorn Neergaard <[email protected]>
Signed-off-by: Bjorn Neergaard <[email protected]>
(cherry picked from commit d33a43c)
Signed-off-by: Bjorn Neergaard <[email protected]>
Signed-off-by: Swagat Bora <[email protected]>
(cherry picked from commit 6ae3e5d)

Signed-off-by: Swagat Bora <[email protected]>
…egression_1.6

[release/1.6 backport] Revert `apparmor_parser` regression
Signed-off-by: Iceber Gu <[email protected]>
(cherry picked from commit 0b9313c)
Signed-off-by: Iceber Gu <[email protected]>
The background for this change:

1. Windows host-process containers do not have an OS version set
2. Buildx v0.10 started pushing manifest lists by default, but it never
   has the OSVersion in the platform data (not that there is any way to
   specify what particular OS version you want). The change means that
   containerd cannot run images created with the new buildx on Windows
   because there is no matching OSVersion in the list of manifests.

Signed-off-by: Brian Goff <[email protected]>
(cherry picked from commit 8442521)
Signed-off-by: Brian Goff <[email protected]>
"cherry-pick" the main PR 8109

Signed-off-by: Akihiro Suda <[email protected]>
…latform_matching

[1.6] Add fallback for windows platforms without osversion
[release/1.6] importer: stream oci-layout and manifest.json
[release/1.6] oci: fix additional GIDs
Signed-off-by: Derek McGowan <[email protected]>
[release/1.6] Prepare release notes for v1.6.18
containerd 1.6.18

Signed-off-by: Jeremi Piotrowski <[email protected]>
@jepio jepio changed the title Cc main sync with containerd v1.6.18 Feb 23, 2023
@jepio jepio changed the base branch from main to CC-main February 23, 2023 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet