Commit Graph

12306 Commits

Author SHA1 Message Date
Derek McGowan
48dbdf871b Prepare release notes for v1.7.8
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-10-26 11:21:38 -07:00
Akihiro Suda
6a9a1870a7 Merge pull request #9299 from dmcgowan/1.7-fix-ambiguous-tls-fallback
[release/1.7] Fix ambiguous tls fallback
2023-10-27 01:47:30 +09:00
Phil Estes
bb65a3aa14 Merge pull request #9281 from milas/grpc-1.58.3-1.7
[release/1.7] vendor: google.golang.org/grpc v1.58.3
2023-10-26 08:16:53 -07:00
Derek McGowan
68abc543b1 Check scheme and host of request on push redirect
When the HTTP fallback is used, the scheme changes from HTTPS to HTTP
which can cause a mismatch on redirect, causing the authorizer to get
stripped out. Since the redirect host must match the redirect host in
this case, credentials are only sent to the same origin host that
returned the redirect.

This fixes an issue for a push getting a 401 unauthorized on the PUT
request even though credentials are available.

Signed-off-by: Derek McGowan <derek@mcg.dev>
(cherry picked from commit 466ee870d5)
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-10-25 21:35:29 -07:00
Derek McGowan
35c7634e33 Avoid TLS fallback when protocol is not ambiguous
The TLS fallback should only be used when the protocol is ambiguous due
to provided TLS configurations and defaulting to http. Do not add TLS
configurations when defaulting to http. When the port is 80 or will be
defaulted to 80, there is no protocol ambiguity and TLS fallback should
not be used.

Signed-off-by: Derek McGowan <derek@mcg.dev>
(cherry picked from commit d48ceb6065)
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-10-25 21:35:28 -07:00
Milas Bowman
f36948cad7 vendor: gRPC v1.58.3
Upgrade gRPC in anticipation of upgrading OTel, which raises the
lower limit.

As gRPC upgrades have been known to cause issues, this is being
done pre-emptively. Additionally, it ensures we avoid v1.58.2,
which has a known CVE, but would otherwise be chosen by MVS from
`go mod`.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2023-10-24 22:26:08 -04:00
Derek McGowan
f1185639b6 Merge pull request #9276 from thaJeztah/1.7_backport_bump_x_net
[release/1.7 backport] vendor: golang.org/x/net v0.17.0
2023-10-20 15:14:31 -07:00
Sebastiaan van Stijn
c67a531905 vendor: golang.org/x/net v0.17.0
full diff: https://github.com/golang/text/compare/v0.13.0...v0.17.0

This fixes the same CVE as go1.21.3 and go1.20.10;

- net/http: rapid stream resets can cause excessive work

  A malicious HTTP/2 client which rapidly creates requests and
  immediately resets them can cause excessive server resource consumption.
  While the total number of requests is bounded to the
  http2.Server.MaxConcurrentStreams setting, resetting an in-progress
  request allows the attacker to create a new request while the existing
  one is still executing.

  HTTP/2 servers now bound the number of simultaneously executing
  handler goroutines to the stream concurrency limit. New requests
  arriving when at the limit (which can only happen after the client
  has reset an existing, in-flight request) will be queued until a
  handler exits. If the request queue grows too large, the server
  will terminate the connection.

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

  The default stream concurrency limit is 250 streams (requests)
  per HTTP/2 connection. This value may be adjusted using the
  golang.org/x/net/http2 package; see the Server.MaxConcurrentStreams
  setting and the ConfigureServer function.

  This is CVE-2023-39325 and Go issue https://go.dev/issue/63417.
  This is also tracked by CVE-2023-44487.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f7c9e99422)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-19 22:05:24 +02:00
Sebastiaan van Stijn
71f4b36ca7 vendor: golang.org/x/text v0.13.0
full diff: https://github.com/golang/text/compare/v0.11.0...v0.13.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c3652540c7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-19 22:03:52 +02:00
Sebastiaan van Stijn
a7b3b70909 vendor: golang.org/x/sys v0.13.0
full diff: https://github.com/golang/sys/compare/v0.10.0...v0.13.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ff602c2133)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-19 22:03:46 +02:00
Phil Estes
8dd44e09e1 Merge pull request #9248 from thaJeztah/1.7_update_grpc_1.56.3
[release/1.7] vendor: google.golang.org/grpc v1.56.3
2023-10-19 13:45:35 -04:00
Maksym Pavlenko
a69ecf5ff7 Merge pull request #9265 from thaJeztah/1.7_update_golang_1.20.10
[release/1.7] update to go1.20.10, test go1.21.3
2023-10-19 10:16:55 -07:00
Samuel Karp
3a655879d3 Merge pull request #9252 from qiutongs/backport-schema1-label-1.7 2023-10-18 13:16:05 -07:00
Sebastiaan van Stijn
2479c33217 [release/1.7] update to go1.20.10, test go1.21.3
go1.20.10 (released 2023-10-10) includes a security fix to the net/http package.
See the Go 1.20.10 milestone on our issue tracker for details:

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

full diff: https://github.com/golang/go/compare/go1.20.9...go1.20.10

From the security mailing:

[security] Go 1.21.3 and Go 1.20.10 are released

Hello gophers,

We have just released Go versions 1.21.3 and 1.20.10, minor point releases.

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

- net/http: rapid stream resets can cause excessive work

  A malicious HTTP/2 client which rapidly creates requests and
  immediately resets them can cause excessive server resource consumption.
  While the total number of requests is bounded to the
  http2.Server.MaxConcurrentStreams setting, resetting an in-progress
  request allows the attacker to create a new request while the existing
  one is still executing.

  HTTP/2 servers now bound the number of simultaneously executing
  handler goroutines to the stream concurrency limit. New requests
  arriving when at the limit (which can only happen after the client
  has reset an existing, in-flight request) will be queued until a
  handler exits. If the request queue grows too large, the server
  will terminate the connection.

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

  The default stream concurrency limit is 250 streams (requests)
  per HTTP/2 connection. This value may be adjusted using the
  golang.org/x/net/http2 package; see the Server.MaxConcurrentStreams
  setting and the ConfigureServer function.

  This is CVE-2023-39325 and Go issue https://go.dev/issue/63417.
  This is also tracked by CVE-2023-44487.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-18 16:14:46 +02:00
Sebastiaan van Stijn
11f40e9d80 [release/1.7] update to go1.20.9, test go1.21.2
go1.20.9 (released 2023-10-05) includes one security fixes to the cmd/go package,
as well as bug fixes to the go command and the linker. See the Go 1.20.9
milestone on our issue tracker for details:

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

full diff: https://github.com/golang/go/compare/go1.20.8...go1.20.9

From the security mailing:

[security] Go 1.21.2 and Go 1.20.9 are released

Hello gophers,

We have just released Go versions 1.21.2 and 1.20.9, minor point releases.

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

- cmd/go: line directives allows arbitrary execution during build

  "//line" directives can be used to bypass the restrictions on "//go:cgo_"
  directives, allowing blocked linker and compiler flags to be passed during
  compliation. This can result in unexpected execution of arbitrary code when
  running "go build". The line directive requires the absolute path of the file in
  which the directive lives, which makes exploting this issue significantly more
  complex.

  This is CVE-2023-39323 and Go issue https://go.dev/issue/63211.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-18 16:12:41 +02:00
Qiutong Song
cac1bab797 Add a new image label if it is docker schema 1
Signed-off-by: Qiutong Song <songqt01@gmail.com>
(cherry picked from commit 7712375630)
Signed-off-by: Qiutong Song <songqt01@gmail.com>
2023-10-17 03:59:23 +00:00
Sebastiaan van Stijn
26736d6e1a vendor: google.golang.org/grpc v1.56.3
server: prohibit more than MaxConcurrentStreams handlers from running at once
(CVE-2023-44487).

In addition to this change, applications should ensure they do not leave running
tasks behind related to the RPC before returning from method handlers, or should
enforce appropriate limits on any such work.

- https://github.com/grpc/grpc-go/compare/v1.53.0...v1.56.3
- 7f2fa6fef1...daa745c078

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-16 21:21:31 +02:00
Sebastiaan van Stijn
54a69a6e44 vendor: golang.org/x/oauth2 v0.7.0
full diff: https://github.com/golang/oauth2/compare/v0.4.0...v0.7.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-16 21:17:14 +02:00
Sebastiaan van Stijn
ac15a7f5b9 vendor: google.golang.org/protobuf v1.30.0
full diff: https://github.com/protocolbuffers/protobuf-go/compare/v1.29.1...v1.30.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-16 21:16:28 +02:00
Phil Estes
9211aff396 Merge pull request #9235 from dmcgowan/backport-1.7-fix-basic-auth-error
[release/1.7] remotes: add handling for missing basic auth credentials
2023-10-16 11:41:11 -04:00
Derek McGowan
6cd2cc4a8f remotes: add handling for missing basic auth credentials
When a credential handler is provided but no basic auth credentials
are provided, handle the error specifically rather than treating
the credentials as not implemented. This allows a clearer error to
be provided to users rather than a confusing not implemented error
or generic unauthorized error.

Add unit tests for the basic auth case.

Signed-off-by: Derek McGowan <derek@mcg.dev>
(cherry picked from commit 51c9ffe468)
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-10-13 16:51:30 -07:00
Fu Wei
5e21abb181 Merge pull request #9209 from thaJeztah/1.7_backport_fix_deadlock
[release/1.7 backport] containerd-shim-runc-v2: avoid potential deadlock in create handler
2023-10-11 10:58:24 +08:00
Wei Fu
d0a1fedb5a *: add runc-fp as runc wrapper to inject failpoint
Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit 11a7751af5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-10 16:51:46 +02:00
Chen Yiyang
04491240af containerd-shim-runc-v2: avoid potential deadlock in create handler
After pr #8617, create handler of containerd-shim-runc-v2 will
call handleStarted() to record the init process and handle its exit.
Init process wouldn't quit so early in normal circumstances. But if
this screnario occurs, handleStarted() will call
handleProcessExit(), which will cause deadlock because create() had
acquired s.mu, and handleProcessExit() will try to lock it again.

So, I added a parameter muLocked to handleStarted to indicate whether
or not s.mu is currently locked, and thus deciding whether or not to
lock it when calling handleProcessExit.

Fix: #9103
Signed-off-by: Chen Yiyang <cyyzero@qq.com>
(cherry picked from commit 68dd47ef70)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-10 12:07:02 +02:00
Chen Yiyang
6982a0df5b containerd-shim-runc-v2: remove unnecessary s.getContainer()
Previous code has already called `getContainer()`, just pass it into
`s.getContainerPids` to reduce unnecessary lock and map lookup.

Signed-off-by: Chen Yiyang <cyyzero@qq.com>
(cherry picked from commit 6604ff6c55)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-10 12:07:02 +02:00
Marat Radchenko
0e2320398f Uncopypaste parsing of OCI Bundle spec file
Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
(cherry picked from commit 9e34b8b441)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-10 12:06:55 +02:00
Derek McGowan
8c087663b0 Merge pull request #9194 from dcantah/release-notes-1.7.7
[release/1.7] Prepare release notes for v1.7.7
v1.7.7
2023-10-09 14:00:42 -07:00
Danny Canter
a34fa5681a Prepare release notes for v1.7.7
Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-10-09 11:56:02 -07:00
Derek McGowan
8664fcaa36 Merge pull request #9149 from jsturtevant/cherry-pick-9142-on-1-7 2023-10-06 12:12:22 -07:00
James Sturtevant
6ca0aebf0c Allow for images with artifacts to pull
Signed-off-by: James Sturtevant <jstur@microsoft.com>
(cherry picked from commit a9ba33f8ff)
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-10-06 17:43:11 +00:00
Phil Estes
72e02001f2 Merge pull request #9193 from vvoland/remotes-docker-mounted-fix-1.7
[release 1.7] remotes/docker: Fix MountedFrom prefixed with target repository
2023-10-04 13:59:08 -04:00
Phil Estes
814f6c2457 Merge pull request #9134 from Kern--/release/1.7
[release/1.7] Update x/net to 0.13
2023-10-04 13:58:41 -04:00
Phil Estes
781d39521a Merge pull request #9188 from dmcgowan/backport-1.7-localhost-http-fallback
[release/1.7] remotes: always try to establish tls connection when tls configured
2023-10-04 08:54:44 -04:00
Paweł Gronowski
7df492a95c remotes/docker: Fix MountedFrom prefixed with target repository
`MountedFrom` was prefixed with the whole target repository instead of
just the registry hostname.

Also adjust the test cases to use the registry hostname.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 859c2651e5)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-10-04 10:07:33 +02:00
Derek McGowan
7779ce64e5 remotes: always try to establish tls connection when tls configured
When a endpoint is configured for http and has a tls configuration,
always try to the tls connection and fallback to http when the tls
connections fails from receiving an http response. This fixes an issue
with default localhost endpoints which get defaulted to http with
insecure tls also configured but are using tls.

Signed-off-by: Derek McGowan <derek@mcg.dev>
(cherry picked from commit 79772a0dd4)
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-10-03 09:35:07 -07:00
Kern Walster
b3db314a58 Bump x/net to 0.13
This silences govulncheck detecting
https://pkg.go.dev/vuln/GO-2023-1988.

containerd only uses x/net for context and httpcontext which do not
render html.

Signed-off-by: Kern Walster <walster@amazon.com>
2023-10-02 19:59:30 +00:00
Fu Wei
c12225c6e0 Merge pull request #9168 from AkihiroSuda/cherrypick-9158-1.7
[release/1.7] cri: stop recommending disable_cgroup
2023-10-02 19:37:22 +08:00
Fu Wei
790f6d948c Merge pull request #9165 from dmcgowan/backport-1.7-readiness-hang-fix
[release/1.7] Require plugins to succeed after registering readiness
2023-09-30 15:32:54 +08:00
Derek McGowan
a83c66813f Require plugins to succeed after registering readiness
When readiness is registered on initialization, the plugin must not
fail. When such a plugin fails, containerd will hang on the readiness
condition.

Signed-off-by: Derek McGowan <derek@mcg.dev>
(cherry picked from commit e7254406c9)
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-09-29 20:44:44 -07:00
Akihiro Suda
171d768493 cri: call RegisterReadiness after NewCRIService
`NewCRIService()` may easily fail and its error has to be ignored
unless the CRI plugin is in the `required_plugins` list.

Now this has to be called before `RegisterReadiness()`, as
PR 9153 "Require plugins to succeed after registering readiness"
was merged on 2023-09-29.

Fix issue 9163: `[Regression in main (2023-09-29)]: containerd-rootless.sh doesn't start up`

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit 5365f4b29e)
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-09-29 20:44:43 -07:00
Fu Wei
7a75a30c60 Merge pull request #9132 from dcantah/shim-kill-1.7
[release/1.7] Handle unexpected shim kill events
2023-09-30 11:42:07 +08:00
Akihiro Suda
6013b5e03e cri: stop recommending disable_cgroup
Disabling cgroup is no longer needed since cgroup v2

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit 8ffb03d689)
(cherry-pick was not clean)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-09-30 12:30:07 +09:00
Aditya Ramani
3d27bc738a Handle unexpected shim kill events
When a shim process is unexpectedly killed in a way that was not initiated through containerd - containerd reports the pod as not ready but the containers as running. This results in kubelet repeatedly sending container kill requests that fail since containerd cannot connect to the shim.

Changes:

- In the container exit handler, treat `err: Unavailable` as if the container has already exited out
- When attempting to get a connection to the shim, if the controller isn't available assume that the shim has been killed (needs to be done since we have a separate exit handler that cleans up the reference to the shim controller - before kubelet has the chance to call StopPodSandbox)

Signed-off-by: Aditya Ramani <a_ramani@apple.com>
(cherry picked from commit 729c97cf39)
Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-09-29 19:15:07 -07:00
Fu Wei
4093cfc2b2 Merge pull request #9167 from dmcgowan/update-go-version
[release/1.7] Build binaries with 1.21.1
2023-09-30 09:58:12 +08:00
Derek McGowan
4ffa3ed294 Build binaries with 1.21.1
1.19 is end of life, continue to run with 1.20 but ensure builds with
1.21.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-09-29 10:38:56 -07:00
Phil Estes
08e9425cce Merge pull request #9127 from thaJeztah/1.7_update_hcsshim 2023-09-21 11:44:38 +02:00
Sebastiaan van Stijn
5756f6064b [release/1.7] vendor: github.com/Microsoft/hcsshim v0.11.1
Fix closing stdin: fix an issue introduced in [v0.10.0-rc.3], which resulted
in the close request not being forwarded if stdin was nil.
The fix moves the nil check to after the modify request, to let the process
handle it.

full diff: https://github.com/Microsoft/hcsshim/compare/v0.11.0...v0.11.1

[v0.10.0-rc.3]: 3e090b05a8

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-21 09:21:33 +02:00
Derek McGowan
fb5868b201 Merge pull request #9106 from thaJeztah/1.7_backport_swap_log_pkg_alias
[release/1.7 backport] alias log package to github.com/containerd/log v0.1.0
2023-09-20 21:30:11 -07:00
Sebastiaan van Stijn
09633b539f deprecate logs package, but disable linter (for transitioning)
Deprecate the pacakge, but suppress linting errors for now. This is to allow
backporting these changes to release branches, which may still need to transition.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 03b9ce56b5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-20 16:27:21 +02:00
Sebastiaan van Stijn
cb201519f8 alias log package to github.com/containerd/log v0.1.0
This "soft" deprecates the package, but keeps the local uses of the package,
which can make backporting this to release-branches easier (we can
still move all uses in those branches as well though).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d69ae811d6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f1591cc9b9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-19 08:54:55 +02:00