Commit graph

39844 commits

Author SHA1 Message Date
Eng Zer Jun
a916414b0b refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated in Go 1.16. 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>
(cherry picked from commit c55a4ac779)
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-24 16:11:55 -05:00
Sebastiaan van Stijn
9f156997b0
Merge pull request #44946 from thaJeztah/20.10_backport_dockerfile_git_dubious
[20.10 backport] Dockerfile: configure code dir as "safe" directory
2023-02-14 20:32:10 +01:00
Sebastiaan van Stijn
0312e468da
Dockerfile: configure code dir as "safe" directory
CI is failing when bind-mounting source from the host into the dev-container;

    fatal: detected dubious ownership in repository at '/go/src/github.com/docker/docker'
    To add an exception for this directory, call:

        git config --global --add safe.directory /go/src/github.com/docker/docker

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 21677816a0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-07 14:05:53 +01:00
Akihiro Suda
b3ff678200
Merge pull request #44882 from thaJeztah/20.10_containerd_binary_1.6.16
[20.10] update containerd binary to v1.6.16
2023-01-31 02:00:29 +09:00
Sebastiaan van Stijn
526ae907e2
[20.10] update containerd binary to v1.6.16
Notable Updates

- Fix push error propagation
- Fix slice append error with HugepageLimits for Linux
- Update default seccomp profile for PKU and CAP_SYS_NICE
- Fix overlayfs error when upperdirlabel option is set

full diff: https://github.com/containerd/containerd/compare/v1.6.15...v1.6.16

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-30 09:17:32 +01:00
Bjorn Neergaard
6051f14291
Merge pull request #44846 from thaJeztah/20.10_bump_libnetwork
[20.10] vendor: libnetwork 05b93e0d3a95952f70c113b0bc5bdb538d7afdd7
2023-01-18 09:24:28 -07:00
Sebastiaan van Stijn
e3b9b535bd
[20.10] vendor: libnetwork 05b93e0d3a95952f70c113b0bc5bdb538d7afdd7
full diff: 374259e831...05b93e0d3a

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-18 13:25:55 +01:00
Sebastiaan van Stijn
d0a3f3a376
Merge pull request #44795 from thaJeztah/20.10_bump_go_1.18.10
[20.10] update to go1.18.10
2023-01-11 16:25:23 +01:00
Sebastiaan van Stijn
de10f917ea
Merge pull request #44797 from neersighted/libnetwork_revendor
[20.10] vendor: github.com/docker/libnetwork 374259e8316124ccf1fc38c0c0f3430f8d0e9c76
2023-01-11 09:41:28 +01:00
Bjorn Neergaard
26a4ccf99e
vendor: github.com/docker/libnetwork 374259e8316124ccf1fc38c0c0f3430f8d0e9c76
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-10 18:14:10 -07:00
Sebastiaan van Stijn
625903f3fd
[20.10] update to go1.18.10
go1.18.10 (released 2023-01-10) includes fixes to cgo, the compiler, the linker,
and the crypto/x509, net/http, and syscall packages. See the Go 1.18.10 milestone
on the issue tracker for details:

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

full diff: https://github.com/golang/go/compare/go1.18.9...go1.18.10

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-11 00:21:42 +01:00
Sebastiaan van Stijn
864cc1c871
Merge pull request #44765 from vvoland/fix-test-race-logs-goroutines-20
[20.10 backport] integration-cli: Fix hanging TestLogsFollowGoroutines*
2023-01-10 15:30:39 +01:00
Samuel Karp
8771b4be5f
Merge pull request #44767 from thaJeztah/20.10_containerd_binary_1.6.15 2023-01-09 13:23:34 -08:00
Sebastiaan van Stijn
208fb1ca7b
Merge pull request #44755 from vvoland/buildflags-nopie-whenrace-2010
[20.10 backport] hack/make: Don't add -buildmode=pie with -race
2023-01-09 13:30:14 +01:00
Sebastiaan van Stijn
efbc878c47
[20.10] update containerd binary to v1.6.15
release notes: https://github.com/containerd/containerd/releases/tag/v1.6.15

> Welcome to the v1.6.15 release of containerd!
>
> The fifteenth patch release for containerd 1.6 fixes an issue with CNI in the CRI plugin
>
> Notable Updates
>
> - Fix no CNI info for pod sandbox on restart in CRI plugin

full diff: https://github.com/containerd/containerd/compare/v1.6.14...v1.6.15

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-09 13:13:40 +01:00
Paweł Gronowski
91e767cc1e
integration-cli: Fix hanging TestLogsFollowGoroutines*
cmd.Wait is called twice from different goroutines which can cause the
test to hang completely. Fix by calling Wait only once and sending its
return value over a channel.

In TestLogsFollowGoroutinesWithStdout also added additional closes and
process kills to ensure that we don't leak anything in case test returns
early because of failed test assertion.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit deb4910c5b)
2023-01-09 10:31:06 +01:00
Paweł Gronowski
d645297358
hack/make: Don't add -buildmode=pie with -race
Make it possible to add `-race` to the BUILDFLAGS without making the
build fail with error:
"-buildmode=pie not supported when -race is enabled"

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-05 20:32:46 +01:00
Sebastiaan van Stijn
6ddb3ba414
Merge pull request #44718 from neersighted/backport/44668/20.10
[20.10 backport] api: can marshal and unmarshal when args.fields is empty
2023-01-02 18:29:02 +01:00
Yamazaki Masashi
ad703aa0ab
api: can marshal and unmarshal when args.fields is empty
Signed-off-by: Yamazaki Masashi <masi19bw@gmail.com>
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
(cherry picked from commit 5fed968b1d)
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2022-12-29 15:42:24 -07:00
Sebastiaan van Stijn
ae6a9319b0
Merge pull request #44712 from neersighted/20.10_revert_vsock_filter
[20.10] Revert "seccomp: block socket calls to AF_VSOCK in default profile"
2022-12-29 23:13:50 +01:00
Sebastiaan van Stijn
d46fe8029b
Merge pull request #44650 from thaJeztah/20.10_backport_builder_host_gateway
[20.10 backport] builder: handle host-gateway with extra hosts
2022-12-29 23:10:02 +01:00
Sebastiaan van Stijn
d3bf4595cd
Merge pull request #44682 from thaJeztah/20.10_update_libnetwork
[20.10] vendor: github.com/docker/libnetwork 1f3b98be6833a93f254aa0f765ff55d407dfdd69
2022-12-29 22:54:14 +01:00
Bjorn Neergaard
f91836cb26
Merge pull request #44709 from zhsj/20.10-btrfs-progs-6.1
[20.10 backport] daemon/graphdriver/btrfs: workaround field rename in btrfs-progs 6.1
2022-12-29 14:47:31 -07:00
Bjorn Neergaard
dcf27af59b
Revert "seccomp: block socket calls to AF_VSOCK in default profile"
This reverts commit 57b229012a.

This change, while favorable from a security standpoint, caused a
regression for users of the 20.10 branch of Moby. As such, we are
reverting it to ensure stability and compatibility for the affected
users.

However, users of AF_VSOCK in containers should recognize that this
(special) address family is not currently namespaced in any version of
the Linux kernel, and may result in unexpected behavior, like VMs
communicating directly with host hypervisors.

Future branches, including the 23.0 branch, will continue to filter
AF_VSOCK. Users who need to allow containers to communicate over the
unnamespaced AF_VSOCK will need to turn off seccomp confinement or set a
custom seccomp profile.

It is our hope that future mechanisms will make this more
ergonomic/maintainable for end users, and that future kernels will
support namespacing of AF_VSOCK.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2022-12-29 13:16:57 -07:00
Sebastiaan van Stijn
7f3a95d360
vendor: github.com/docker/libnetwork 1f3b98be6833a93f254aa0f765ff55d407dfdd69
- fix linting issues
- update to go1.18.9, gofmt, and regenerate proto
- processEndpointCreate: Fix deadlock between getSvcRecords and processEndpointCreate

full diff: dcdf8f176d...1f3b98be68

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-29 19:50:39 +01:00
Sebastiaan van Stijn
313e53aafd
Merge pull request #44691 from thaJeztah/20.10_fix_vanity_url
[20.10] fix broken vanity-URL for code.cloudfoundry.org
2022-12-29 19:50:05 +01:00
Sebastiaan van Stijn
0c207b0516
[20.10] fix broken vanity-URL for code.cloudfoundry.org
The vanity URL looks to be misconfigured;

    2022-12-22T00:01:12.571Z] 2022/12/22 00:01:12 unrecognized import path "code.cloudfoundry.org/clock" (https fetch: Get "https://code.cloudfoundry.org/clock?go-get=1": x509: certificate is valid for *.de.a9sapp.eu, de.a9sapp.eu, not code.cloudfoundry.org)

This patch updates vendor.conf to fetch the code directly from GitHub.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-29 14:45:04 +01:00
Shengjing Zhu
97ae178741 daemon/graphdriver/btrfs: workaround field rename in btrfs-progs 6.1
Closes: #44698

Signed-off-by: Shengjing Zhu <zhsj@debian.org>
(cherry picked from commit ffbbe3d103)
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2022-12-29 21:21:26 +08:00
Sebastiaan van Stijn
ddab6b3621
Merge pull request #44673 from thaJeztah/20.10_update_containerd_1.6.14
[20.10] update containerd binary to v1.6.14
2022-12-20 10:56:02 +01:00
Sebastiaan van Stijn
2f212873ac
update containerd binary to v1.6.14
Notable Updates

- Fix `memory.memsw.limit_in_bytes: no such file or directory` error in CRI plugin

full diff: https://github.com/containerd/containerd/compare/v1.6.13...v1.6.14

See the changelog for complete list of changes:
https://github.com/containerd/containerd/releases/tag/v1.6.14

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-19 18:35:28 +01:00
Sebastiaan van Stijn
42c8b31499
Merge pull request #44656 from thaJeztah/20.10_containerd_binary_1.6.13
[20.10] update containerd binary to v1.6.13
2022-12-15 23:17:04 +01:00
Sebastiaan van Stijn
ff29c403a3
update containerd binary to v1.6.13
Notable Updates

- Update overlay snapshotter to check for tmpfs when evaluating usage of userxattr
- Update hcsschim to v0.9.6 to fix resource leak on exec
- Make swapping disabled with memory limit in CRI plugin
- Allow clients to remove created tasks with PID 0
- Fix concurrent map iteration and map write in CRI port forwarding
- Check for nil HugepageLimits to avoid panic in CRI plugin

See the changelog for complete list of changes:
https://github.com/containerd/containerd/releases/tag/v1.6.13

full diff: https://github.com/containerd/containerd/compare/v1.6.12...v1.6.13

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-15 19:29:13 +01:00
Sebastiaan van Stijn
02343226e5
Merge pull request #44488 from thaJeztah/20.10_backport_update_gotestsum
[20.10] update gotestsum to v1.8.2
2022-12-15 15:13:54 +01:00
CrazyMax
877a5e6867
builder: handle host-gateway with extra hosts
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 521b8c02cc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-15 13:30:26 +01:00
Sebastiaan van Stijn
edca413033
[20.10] update gotestsum to v1.8.2
release notes: https://github.com/gotestyourself/gotestsum/releases/tag/v1.8.2

- Show shuffle seed
- Update tests, and cleanup formats
- Update dependencies
- Test against go1.19, remove go1.15
- Add project name to junit.xml output
- Adding in support for s390x and ppc64le

full diff: https://github.com/gotestyourself/gotestsum/compare/v1.7.0...v1.8.2

(adapted from commit 882ddf4b16)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-08 19:53:20 +01:00
Sebastiaan van Stijn
6112b23b36
Merge pull request #44476 from sbuckfelder/20.10_UPDATE
[20.10] vendor: github.com/moby/libnetwork dcdf8f176d1e13ad719e913e796fb698d846de98
2022-12-08 19:51:17 +01:00
Sebastiaan van Stijn
194e73feb9
Merge pull request #44607 from thaJeztah/20.10_containerd_binary_1.6.12
[20.10] update containerd binary to v1.6.12 (addresses CVE-2022-23471)
2022-12-08 10:32:35 +01:00
Sebastiaan van Stijn
a9fdcd577f
[20.10] update containerd binary to v1.6.12 (addresses CVE-2022-23471)
The twelfth patch release for containerd 1.6 contains a fix for CVE-2022-23471.

Notable Updates

- Fix goroutine leak during Exec in CRI plugin (GHSA-2qjp-425j-52j9)

full diff: https://github.com/containerd/containerd/compare/v1.6.11...v1.6.12

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-08 00:48:56 +01:00
Sebastiaan van Stijn
48f955ddb9
Merge pull request #44597 from thaJeztah/20.10_containerd_1.6.11
[20.10] update containerd binary to v1.6.11
2022-12-07 13:49:24 +01:00
Sebastiaan van Stijn
50d4d98737
Merge pull request #44569 from thaJeztah/20.10_backport_relax_checkSupportedMediaType
[20.10 backport] distribution: checkSupportedMediaType: allow additional media-types
2022-12-07 13:29:51 +01:00
Sebastiaan van Stijn
17451d2fdc
Merge pull request #44593 from thaJeztah/20.10_update_go_1.18.9
[20.10] update to go1.18.9
2022-12-07 13:23:00 +01:00
Sebastiaan van Stijn
565fcdd56c
[20.10] update containerd binary to v1.6.11
Welcome to the v1.6.11 release of containerd!

The eleventh patch release for containerd 1.6 contains a various fixes and updates.

Notable Updates

- Add pod UID annotation in CRI plugin
- Fix nil pointer deference for Windows containers in CRI plugin
- Fix lease labels unexpectedly overwriting expiration
- Fix for simultaneous diff creation using the same parent snapshot

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-06 23:35:20 +01:00
Sebastiaan van Stijn
f8b0d77bfe
[20.10] update to go1.18.9
Includes security fixes for net/http (CVE-2022-41717, CVE-2022-41720),
and os (CVE-2022-41720).

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

- os, net/http: avoid escapes from os.DirFS and http.Dir on Windows

  The os.DirFS function and http.Dir type provide access to a tree of files
  rooted at a given directory. These functions permitted access to Windows
  device files under that root. For example, os.DirFS("C:/tmp").Open("COM1")
  would open the COM1 device.
  Both os.DirFS and http.Dir only provide read-only filesystem access.

  In addition, on Windows, an os.DirFS for the directory \(the root of the
  current drive) can permit a maliciously crafted path to escape from the
  drive and access any path on the system.

  The behavior of os.DirFS("") has changed. Previously, an empty root was
  treated equivalently to "/", so os.DirFS("").Open("tmp") would open the
  path "/tmp". This now returns an error.

  This is CVE-2022-41720 and Go issue https://go.dev/issue/56694.

- net/http: limit canonical header cache by bytes, not entries

  An attacker can cause excessive memory growth in a Go server accepting
  HTTP/2 requests.

  HTTP/2 server connections contain a cache of HTTP header keys sent by
  the client. While the total number of entries in this cache is capped,
  an attacker sending very large keys can cause the server to allocate
  approximately 64 MiB per open connection.

  This issue is also fixed in golang.org/x/net/http2 vX.Y.Z, for users
  manually configuring HTTP/2.

  Thanks to Josselin Costanzi for reporting this issue.

  This is CVE-2022-41717 and Go issue https://go.dev/issue/56350.

View the release notes for more information:
https://go.dev/doc/devel/release#go1.18.9

And the milestone on the issue tracker:
https://github.com/golang/go/issues?q=milestone%3AGo1.18.9+label%3ACherryPickApproved

Full diff: https://github.com/golang/go/compare/go1.18.8...go1.18.9

The golang.org/x/net fix is in 1e63c2f08a

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-06 22:59:44 +01:00
Sebastiaan van Stijn
cfb3ebe96e
Merge pull request #44564 from thaJeztah/20.10_backport_seccomp_block_af_vsock
[20.10 backport] seccomp: block socket calls to AF_VSOCK in default profile
2022-12-05 13:31:18 +01:00
Sebastiaan van Stijn
966327c1e5
distribution: checkSupportedMediaType: allow additional media-types
This addresses a regression introduced in 407e3a4552,
which turned out to be "too strict", as there's old images that use, for example;

    docker pull python:3.5.1-alpine
    3.5.1-alpine: Pulling from library/python
    unsupported media type application/octet-stream

Before 407e3a4552, such mediatypes were accepted;

    docker pull python:3.5.1-alpine
    3.5.1-alpine: Pulling from library/python
    e110a4a17941: Pull complete
    30dac23631f0: Pull complete
    202fc3980a36: Pull complete
    Digest: sha256:f88925c97b9709dd6da0cb2f811726da9d724464e9be17a964c70f067d2aa64a
    Status: Downloaded newer image for python:3.5.1-alpine
    docker.io/library/python:3.5.1-alpine

This patch copies the additional media-types, using the list of types that
were added in a215e15cb1, which fixed a
similar issue.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a6a539497a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-02 01:31:15 +01:00
Sebastiaan van Stijn
a01576ec4a
seccomp: block socket calls to AF_VSOCK in default profile
This syncs the seccomp-profile with the latest changes in containerd's
profile, applying the same changes as 17a9324035

Some background from the associated ticket:

> We want to use vsock for guest-host communication on KubeVirt
> (https://github.com/kubevirt/kubevirt). In KubeVirt we run VMs in pods.
>
> However since anyone can just connect from any pod to any VM with the
> default seccomp settings, we cannot limit connection attempts to our
> privileged node-agent.
>
> ### Describe the solution you'd like
> We want to deny the `socket` syscall for the `AF_VSOCK` family by default.
>
> I see in [1] and [2] that AF_VSOCK was actually already blocked for some
> time, but that got reverted since some architectures support the `socketcall`
> syscall which can't be restricted properly. However we are mostly interested
> in `arm64` and `amd64` where limiting `socket` would probably be enough.
>
> ### Additional context
> I know that in theory we could use our own seccomp profiles, but we would want
> to provide security for as many users as possible which use KubeVirt, and there
> it would be very helpful if this protection could be added by being part of the
> DefaultRuntime profile to easily ensure that it is active for all pods [3].
>
> Impact on existing workloads: It is unlikely that this will disturb any existing
> workload, becuase VSOCK is almost exclusively used for host-guest commmunication.
> However if someone would still use it: Privileged pods would still be able to
> use `socket` for `AF_VSOCK`, custom seccomp policies could be applied too.
> Further it was already blocked for quite some time and the blockade got lifted
> due to reasons not related to AF_VSOCK.
>
> The PR in KubeVirt which adds VSOCK support for additional context: [4]
>
> [1]: https://github.com/moby/moby/pull/29076#commitcomment-21831387
> [2]: dcf2632945
> [3]: https://kubernetes.io/docs/tutorials/security/seccomp/#enable-the-use-of-runtimedefault-as-the-default-seccomp-profile-for-all-workloads
> [4]: https://github.com/kubevirt/kubevirt/pull/8546

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 57b229012a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-01 14:32:05 +01:00
Scott Buckfelder
72b9ba4f24
[20.10] vendor: github.com/moby/libnetwork dcdf8f176d1e13ad719e913e796fb698d846de98
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Scott Buckfelder <buckscot@amazon.com>
2022-11-23 20:26:17 +01:00
Sebastiaan van Stijn
6dfa15b24b
Merge pull request #44472 from thaJeztah/20.10_backport_containerd_v1.6.10
[20.10 backport] update containerd binary to v1.6.10
2022-11-17 10:46:40 +01:00
Jintao Zhang
7ebfee940f
update containerd binary to v1.6.10
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
(cherry picked from commit a5979a2106)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-11-16 14:04:59 +01:00
Samuel Karp
4ed81ac0e2
Merge pull request #44412 from thaJeztah/20.10_bump_go_1.18.8
fixes https://github.com/golang/go/issues/56309
2022-11-08 19:13:48 -08:00