Commit Graph

13124 Commits

Author SHA1 Message Date
Akihiro Suda
0f043ae434
seccomp, apparmor: add go:noinline
Tests in pkg/cri/[sb]server/container_create_linux_test.go depends on go:noinline
since Go 1.21.

e.g.,
> ```
> === FAIL: pkg/cri/sbserver TestGenerateSeccompSecurityProfileSpecOpts/should_set_default_seccomp_when_seccomp_is_runtime/default (0.00s)
>     container_create_linux_test.go:1013:
>         	Error Trace:	/home/runner/work/containerd/containerd/pkg/cri/sbserver/container_create_linux_test.go:1013
>         	Error:      	Not equal:
>         	            	expected: 0x263d880
>         	            	actual  : 0x263cbc0
>         	Test:       	TestGenerateSeccompSecurityProfileSpecOpts/should_set_default_seccomp_when_seccomp_is_runtime/default
> ```

See comments in PR 8957.

Thanks to Wei Fu for analyzing this.

Co-authored-by: Wei Fu <fuweid89@gmail.com>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-17 16:52:51 +09:00
Akihiro Suda
5d9bf7d139
CI: temporarily disable ci_fuzz due to incompatibility with recent Go
> github.com/containerd/containerd/contrib/apparmor
> github.com/containerd/containerd/contrib/apparmor
> Running go-fuzz -tags gofuzz -func FuzzLoadDefaultProfile -o fuzz_FuzzLoadDefaultProfile.a github.com/containerd/containerd/contrib/apparmor
> /usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
> fuzz_FuzzLoadDefaultProfile.a(000021.o): in function `_cgo_9c8efe9babca_C2func_res_search':
> cgo_unix_cgo_res.cgo2.c:(.text+0x32): undefined reference to `__res_search'
> /usr/bin/ld: fuzz_FuzzLoadDefaultProfile.a(000021.o): in function `_cgo_9c8efe9babca_Cfunc_res_search':
> cgo_unix_cgo_res.cgo2.c:(.text+0x81): undefined reference to `__res_search'
> clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
> 2023-08-11 14:25:45,433 - root - ERROR - Building fuzzers failed.
> 2023-08-11 14:25:45,433 - root - ERROR - Error building fuzzers for (commit: 432d86b87f75cc8ddf8f8101a5540eb206ffc894, pr_ref: refs/pull/8957/merge).

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-17 16:52:48 +09:00
Fu Wei
ba852faf41
Merge pull request #8954 from fuweid/fix-shim-leak 2023-08-17 08:16:20 +08:00
Fu Wei
a3c68d161f
Merge pull request #8778 from kiashok/stableABI_WindowsMatcher
Invoke stable ABI compliant platform check in windows matcher
2023-08-16 19:14:22 +08:00
Kirtana Ashok
e2ce4f58f6 Populate commit memory for windows memory usage stats
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2023-08-15 16:48:22 -07:00
Kirtana Ashok
823e0420eb Fix transfer service dependencies:
- Fill OSVersion field of ocispec.Platform for windows OS in
transfer service plugin init()
- Do not return error from transfer service ReceiveStream if
stream.Recv() returned context.Canceled error

Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2023-08-15 15:32:51 -07:00
Kirtana Ashok
cfb30a31a8 Invoke Stable ABI compatibility function in windows platform matcher
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2023-08-15 12:52:11 -07:00
Artem Khramov
0cea317a52
FreeBSD: set default runtime
@samuelkarp's https://github.com/samuelkarp/runj is a de facto default
FreeBSD runtime.

This change creates a set of defaults for FreeBSD setting
`wtf.sbk.runj.v1` as the default runtime.

Signed-off-by: Artem Khramov <akhramov@pm.me>
2023-08-14 22:44:21 +03:00
Fu Wei
36b871955c
Merge pull request #8930 from AkihiroSuda/rocky8.8 2023-08-14 20:44:20 +08:00
Akihiro Suda
5e051f5c6c
Merge pull request #8955 from AkihiroSuda/runc-1.1.9
update runc to v1.1.9
2023-08-14 20:30:23 +09:00
Danny Canter
def5ff3c4b Sandbox: Add annotations to controller CreateOptions
Following the addition of annotations to the grpc/ttrpc API surface,
follow suit with adding annotations to the controller api surface.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-08-12 01:39:31 -07:00
Danny Canter
939ccbed42 Sandbox: Add annotations to CreateSandbox surface
An oft employed scheme for a lot of our APIs is to include an
annotations field which is just a map of string to string. This
usually allows folks using the API to send over metadata or auxiliary
information without needing to get a new field added (especially where
the field might not make sense for it to be a standalone field). I think
having annotations for CreateSandbox make sense for this same use case.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-08-12 01:39:29 -07:00
Artem Khramov
1fd3a46526
archive/tarheader: fix FreeBSD hdr for regular files
This update addresses an issue where the stat call on FreeBSD could
return -1 for regular files. This led to incorrect Devmajor and
Devminor values, which should be zero in such cases. Refer to the
discussion on this bug in the following PR:
https://github.com/containerd/containerd/pull/5991.

The code change now handles this scenario appropriately.

Signed-off-by: Artem Khramov <akhramov@pm.me>
2023-08-11 23:50:08 +03:00
Akihiro Suda
f8edd5555f
update runc binary to v1.1.9
https://github.com/opencontainers/runc/releases/tag/v1.1.9

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-11 21:25:56 +09:00
Akihiro Suda
f35d1f08ec
go.mod: github.com/opencontainers/runc v1.1.9
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-11 21:25:29 +09:00
Wei Fu
00ef8ba99b Vagrantfile: add strace tool
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-08-11 18:22:44 +08:00
Wei Fu
601699a184 integration: add ShouldRetryShutdown case based on #7496
Since the moby/moby can't handle duplicate exit event well, it's hard
for containerd to retry shutdown if there is error, like context
canceled.

In order to prevent from regression like #4769, I add skipped
integration case as TODO item and we should rethink about how to handle
the task/shim lifecycle.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-08-11 17:43:51 +08:00
Wei Fu
8dcb2a6e6d pkg/cri/sbserver: fix leaked shim issue for podsandbox mode
Fixes: #7496 #8931

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-08-11 17:43:51 +08:00
Wei Fu
72bc63d83d pkg/cri/server: fix leaked shim issue
Fixes: #7496 #8931

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-08-11 17:43:51 +08:00
Wei Fu
5bdd9ca938 integration: add case to reproduce #7496
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-08-11 17:41:04 +08:00
rongfu.leng
b451fa96a6 bump client-go v0.26.4
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
2023-08-11 00:30:03 +08:00
Akihiro Suda
70a2c95ae8
Merge pull request #8940 from kiashok/updateShimTag-main
Update hcsshim tag to v0.10.0
2023-08-10 10:38:25 +09:00
Kirtana Ashok
a645ff2e68 Update dependencies after protobuf update in hcsshim
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
(cherry picked from commit d129b6f890bceb56b050bbb23ad330bb5699f78c)
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2023-08-09 11:56:45 -07:00
Kirtana Ashok
e7e5619fed Update hcsshim tag to v0.10.0
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2023-08-09 11:55:54 -07:00
rongfu.leng
54baf766e5 add metrics for discarding events
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
2023-08-09 09:56:26 +08:00
root
189a1599c0 archive/compression: update out of date RFC draft link
Signed-off-by: William Chen <willchen.005@gmail.com>
2023-08-08 13:08:02 -07:00
Enrico Weigelt, metux IT consult
cac8b6f4bd Makefile: allow overriding the binary executable target dir
Distros tend to change this to specific locations (eg. on MVCC installs),
therefore introduce a generic environment variable that's a common practise
since 30+ years and thus already well known and supported by distros.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2023-08-08 14:11:03 +02:00
Akihiro Suda
90443f038d
CI: update Rocky Linux to 8.8
- UEFI now has to be enabled
- The root device is now `/dev/mapper/rocky-root`

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-08 18:58:24 +09:00
Fu Wei
165f8e414e
Merge pull request #8928 from oss-qm/submit/makefile-fix-go-command 2023-08-08 05:31:48 +08:00
Derek McGowan
720e027a97
Merge pull request #8917 from amghazanfari/main
delete checkout branch in doc
2023-08-07 14:09:09 -07:00
Phil Estes
649f356656
Merge pull request #8427 from AkihiroSuda/fedora38
CI: update Fedora to 38
2023-08-07 15:41:49 -04:00
Akihiro Suda
0a57dc2a02
CI: update Fedora to 38
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-08 03:15:44 +09:00
Akihiro Suda
30dd0a17f2
CI: install Vagrant from Hashicorp
Canonical's Vagrant 2.2.19 dpkg cannot download Fedora 38 image:
https://bugs.launchpad.net/vagrant/+bug/2017828

So we have to install Vagrant >= 2.3.1 from the upstream:
https://github.com/opencontainers/runc/blob/v1.1.8/.cirrus.yml#L41-L49

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-08 03:15:44 +09:00
Phil Estes
7688c4d008
Merge pull request #8929 from oss-qm/submit/makefile-override-revision
Makefile: allow REVISION be overwritten by environment
2023-08-07 14:07:43 -04:00
Akihiro Suda
ce22387b8f
Merge pull request #8919 from AkihiroSuda/vagrant-on-gha-larger
CI: move Vagrant tests to GitHub Actions (larger runners)
2023-08-08 01:07:12 +09:00
Enrico Weigelt, metux IT consult
965641dbc1 Makefile: allow REVISION be overwritten by environment
Required for distros that wanna use their local version and
can't have some (possibly failing) git commands being run here.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2023-08-07 17:23:00 +02:00
Enrico Weigelt, metux IT consult
fc32197d43 Makefile: fix overriding go command
There still was one place that's calling the `go` command directly
instead of using the $(GO) variable.

Fixes: 9ea25634bd
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2023-08-07 17:21:47 +02:00
Akihiro Suda
2d3360ec71
CI: move Vagrant tests to GitHub Actions (larger runners)
We have been using Cirrus CI for running vagrant workloads
as the standard runners of GHA lacks nested virtualization,
but it looks like GHA with the "larger" runners support nested
virtualization.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-07 01:24:55 +09:00
rongfu.leng
4f3c8c4687 replace mcr.microsoft.com registry to ghcr.io/containerd registry
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
2023-08-06 21:14:07 +08:00
Wei Fu
d41c62a556 .github/workflows: add dmesg step for integration-linux
It will be easy to debug flaky testcase if we can provide kernel log by
`dmesg -T -f kern`.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-08-06 18:13:17 +08:00
Amir M. Ghazanfari
fd8778fba3
delete checkout branch in doc
branch "pr/proto/draft" in NRI doesn't exist anymore it's better to delete this line 

Signed-off-by: Amir M. Ghazanfari <a.m.ghazanfari76@gmail.com>
2023-08-04 22:46:33 +03:30
Fu Wei
2b2195c36b
Merge pull request #8722 from marquiz/devel/cgroup-driver-autoconfig
cri: implement RuntimeConfig rpc
2023-08-04 16:09:34 +08:00
Markus Lehtonen
c62abcb146 docs: document CRI cgroup driver auto detection
Document the user visible changes related to the new RuntimeConfig RPC.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2023-08-04 09:48:29 +03:00
Phil Estes
40c85d6c09
Merge pull request #8897 from kinvolk/rata/userns-use-platform
cri/sbserver: Use platform instead of GOOS for userns detection
2023-08-02 16:12:02 -04:00
Maksym Pavlenko
e12128cebc
Merge pull request #8899 from tonistiigi/arm64-norm-docs
platforms: clarify docs for amd64/arm64 variant normalization
2023-08-02 12:02:43 -07:00
Rodrigo Campos
c80a3ecafd cri/sbserver: Use platform instead of GOOS for userns detection
In the sbserver we should not use the GOOS, as windows hosts can run
linux containers. On the sbserver we should use the platform param.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-08-02 12:32:05 +02:00
Phil Estes
e0912c068b
Merge pull request #8904 from thaJeztah/update_go1.20.7
update to go1.20.7, go1.19.12
2023-08-01 21:38:09 -04:00
Sebastiaan van Stijn
157dff2812
update to go1.20.7, go1.19.12
Includes a fix for CVE-2023-29409

go1.20.7 (released 2023-08-01) includes a security fix to the crypto/tls
package, as well as bug fixes to the assembler and the compiler. See the
Go 1.20.7 milestone on our issue tracker for details:

- https://github.com/golang/go/issues?q=milestone%3AGo1.20.7+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.20.6...go1.20.7

go1.19.12 (released 2023-08-01) includes a security fix to the crypto/tls
package, as well as bug fixes to the assembler and the compiler. See the
Go 1.19.12 milestone on our issue tracker for details.

- https://github.com/golang/go/issues?q=milestone%3AGo1.19.12+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.19.11...go1.19.12

From the mailing list announcement:

[security] Go 1.20.7 and Go 1.19.12 are released

Hello gophers,

We have just released Go versions 1.20.7 and 1.19.12, minor point releases.

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

- crypto/tls: restrict RSA keys in certificates to <= 8192 bits

  Extremely large RSA keys in certificate chains can cause a client/server
  to expend significant CPU time verifying signatures. Limit this by
  restricting the size of RSA keys transmitted during handshakes to <=
  8192 bits.

  Based on a survey of publicly trusted RSA keys, there are currently only
  three certificates in circulation with keys larger than this, and all
  three appear to be test certificates that are not actively deployed. It
  is possible there are larger keys in use in private PKIs, but we target
  the web PKI, so causing breakage here in the interests of increasing the
  default safety of users of crypto/tls seems reasonable.

  Thanks to Mateusz Poliwczak for reporting this issue.

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-01 23:57:32 +02:00
Phil Estes
9214c6403e
Merge pull request #8316 from davidhsingyuchen/partial-attach
fix: allow attaching to any combination of stdin/stdout/stderr
2023-08-01 14:47:53 -04:00
Hsing-Yu (David) Chen
687a5f51a8 fix: allow attaching to any combination of stdin/stdout/stderr
Before this PR, if a stdin/stdout/stderr stream is nil,
and the corresponding FIFO is not an empty string,
a panic will occur when Read/Write of the nil stream is invoked in io.CopyBuffer.

Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com>
2023-08-01 09:56:04 -07:00