Commit Graph

224 Commits

Author SHA1 Message Date
Davanum Srinivas
de6db4038c
Update vendored runc to v1.0.0.0-rc94
Note that this is the code in containerd that uses runc (as almost
a library). Please see the other commit for the update to runc binary
itself.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-05-10 13:12:48 -04:00
Jintao Zhang
79d800b9b0 Update Go to 1.16.4
fix [#45710](https://github.com/golang/go/issues/45710) and CVE-2021-31525.

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
2021-05-07 07:07:09 +08:00
Sebastiaan van Stijn
fbe1e140f2
Update Go to 1.16.3
go1.16.3 (released 2021/04/01) includes fixes to the compiler, linker, runtime,
the go command, and the testing and time packages. See the Go 1.16.3 milestone
on our issue tracker for details:

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

full diff: https://github.com/golang/go/compare/go1.16.2...go1.16.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-19 13:10:18 +02:00
pacoxu
ffff688663 upgrade pause image to 3.5 for non-root
Signed-off-by: pacoxu <paco.xu@daocloud.io>
2021-03-16 23:20:35 +08:00
Phil Estes
a1138182d5
Merge pull request #5180 from dmcgowan/lint-enforce-comments
Fix exported comments enforcer in CI
2021-03-15 10:50:06 -04:00
Derek McGowan
35eeb24a17
Fix exported comments enforcer in CI
Add comments where missing and fix incorrect comments

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-03-12 08:47:05 -08:00
Phil Estes
8cbef0fade
Update to Go 1.16.2
Signed-off-by: Phil Estes <estesp@amazon.com>
2021-03-12 09:59:01 -05:00
Mike Brown
ce8e8e8907
Merge pull request #5036 from thaJeztah/split_runc_binary
Separate runc binary version from libcontainer version, and remove obsolete build-tags
2021-03-11 09:24:30 -06:00
Phil Estes
c55492f8de
Update to Go 1.16.1
Signed-off-by: Phil Estes <estesp@amazon.com>
2021-03-11 09:03:09 -05:00
Sebastiaan van Stijn
79a51cd16a
move runc version to a separate file for easier consumption
This moves the runc version to build to scripts/setup/runc-version,
which makes it easier for packagers to find the default version
to use.

The RUNC_VERSION environment variable can still be used to override
the version, which can be used (e.g.) to test against different versions
in our CI.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-03-10 14:28:29 +01:00
Sebastiaan van Stijn
8325ba5d36
Separate runc binary version from libcontainer version
Now that the dependency on runc (libcontaienr) code has been reduced
considerably, it is probbaly ok to cut the version dependency between
libcontainer and the runc binary that is supported.

This patch separates the runc binary version from the version of
libcontainer that is defined in go.mod, and updates the documentation
accordingly.

The RUNC_COMMIT variable in the install-runc script is renamed to
RUNC_VERSION to encourage using tagged versions, and the Dockerfile
in contrib is updated to allow building with a custom version.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-03-10 13:41:12 +01:00
Akihiro Suda
9ec2778950
Merge pull request #4467 from cyphar/apparmor-update-profile
apparmor: handle signal mediation
2021-03-09 10:55:01 +09:00
Mike Brown
6d68490ef6
Merge pull request #5014 from Iceber/update-pause-version
move to v3.4.1 for the pause image
2021-03-08 15:48:03 -06:00
Akihiro Suda
0580bd6990
apparmor: add DumpDefaultProfile
This function will be used by nerdctl for printing the default AppArmor
profile: `nerdctl system inspect apparmor-profile`

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-03-08 17:28:03 +09:00
Iceber Gu
f37ae8fc35
move to v3.4.1 for the pause image
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2021-03-07 15:21:20 +08:00
Davanum Srinivas
15a4df0ba9
fix names and paths for containerd master
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-03-03 21:27:28 -05:00
Iceber Gu
ba199129b6
update linuxkit readme
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2021-03-01 12:00:56 +08:00
Sebastiaan van Stijn
ec7d905f4e
Update to go 1.15.8
go1.15.8 (released 2021/02/04) includes fixes to the compiler, linker, runtime,
the go command, and the net/http package. See the Go 1.15.8 milestone on the
issue tracker for details.

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

full diff: https://github.com/golang/go/compare/go1.15.7...go1.15.8

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-05 12:53:25 +01:00
Aleksa Sarai
d8572b6ca6
apparmor: handle signal mediation
On newer kernels and systems, AppArmor will block sending signals in
many scenarios by default resulting in strange behaviours (container
programs cannot signal each other, or host processes like containerd
cannot signal containers).

The reason this happens only on some distributions (and is not a kernel
regression) is that the kernel doesn't enforce signal mediation unless
the profile contains signal rules. However because our profies #include
the distribution-managed <abstractions/base>, some distributions added
signal rules -- which results in AppArmor enforcing signal mediation and
thus a regression. On these systems, containers cannot send and receive
signals at all -- meaning they cannot signal each other and the
container runtime cannot kill them either.

This issue was fixed in Docker in 2018[1] but this code was copied
before then and thus the patches weren't carried. It also contains a new
fix for a more esoteric case[2]. Ideally this code should live in a
project like "containerd/apparmor" so that Docker, libpod, and
containerd can share it, but that's probably something to do separately.

In addition, the copyright header is updated to reference that the code
is copied from Docker (and thus was not written entirely by the
containerd authors).

[1]: https://github.com/docker/docker/pull/37831
[2]: https://github.com/docker/docker/pull/41337

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-01-30 07:59:00 +11:00
Wei Fu
3299c5560d
Merge pull request #4967 from dmcgowan/cleanup-root
Move documentation and helper directories out of root
2021-01-24 15:08:19 +08:00
Akihiro Suda
45265febd3
Bump Golang 1.15.7
Changes: https://golang.org/doc/devel/release.html#go1.15.minor

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-01-22 20:54:54 +09:00
Sebastiaan van Stijn
e1445dff12
profiles: seccomp: update to Linux 5.11 syscall list
These syscalls (some of which have been in Linux for a while but were
missing from the profile) fall into a few buckets:

 * close_range(2), epoll_wait2(2) are just extensions of existing "safe
   for everyone" syscalls.

 * The mountv2 API syscalls (fs*(2), move_mount(2), open_tree(2)) are
   all equivalent to aspects of mount(2) and thus go into the
   CAP_SYS_ADMIN category.

 * process_madvise(2) is similar to the other process_*(2) syscalls and
   thus goes in the CAP_SYS_PTRACE category.

Co-authored-by: Aleksa Sarai <asarai@suse.de>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-01-21 21:30:25 +01:00
Davanum Srinivas
b72534967e
Bump Golang 1.15.6
Changes: https://golang.org/doc/devel/release.html#go1.15

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-01-12 16:44:36 -05:00
Derek McGowan
7dffdfa560
Move documentation and helper directories out of root
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-01-12 12:19:50 -08:00
Shengjing Zhu
91dc69ee43 docs: point cri release tarball to github release page
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2021-01-03 17:50:40 +08:00
Akihiro Suda
7b04b3cbb6
contrib/apparmor: expose LoadDefaultProfile
Expected to be used by nerdctl: 6026ae740a/internal_oci_hook.go (L170-L180)

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-12-11 19:59:51 +09:00
Shengjing Zhu
56eca84ae8 Remove reference of GO111MODULE=off
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2020-12-01 01:39:10 +08:00
Shengjing Zhu
553a369158 Fix reference to vendor.conf in scripts
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2020-12-01 01:34:10 +08:00
Shengjing Zhu
8344990520 Remove duplicate systemd units file
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2020-11-25 01:40:52 +08:00
Akihiro Suda
af0a20a4d5
Bump Golang 1.15.5
Changes: https://golang.org/doc/devel/release.html#go1.15

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-11-16 14:36:35 +09:00
Sebastiaan van Stijn
0a1104bcf3
seccomp: add pidfd_getfd syscall (gated by CAP_SYS_PTRACE)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-11-13 13:36:33 +01:00
Sebastiaan van Stijn
2dbbd10fd6
seccomp: add pidfd_open and pidfd_send_signal
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-11-13 13:36:25 +01:00
Evan
6d088549c9
Support AppArmor beta version format
Signed-off-by: Evan Tsai <devillordking@gmail.com>
2020-10-15 22:55:26 +11:00
Derek McGowan
e7a350176a
Merge containerd/cri into containerd/containerd
Signed-off-by: Derek McGowan <derek@mcg.dev>
2020-10-07 10:58:39 -07:00
Maksym Pavlenko
5b3ac0c86f
Merge pull request #4050 from thaJeztah/bump_golang_1.14
Update to golang 1.15.2
2020-09-14 09:42:13 -07:00
Roy Yang
9e094abd08 Refractor the script to work in both python2 and python3
Signed-off-by: Roy Yang <royyang@google.com>
2020-09-11 13:53:33 -07:00
Sebastiaan van Stijn
d1c8d98658
update to golang 1.15.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-11 09:21:25 +02:00
Michael Crosby
f9d231f660
Merge pull request #4493 from thaJeztah/seccomp_uring
seccomp: allow io-uring related system calls
2020-08-25 11:39:45 -04:00
Michael Crosby
396b863138
Merge pull request #4491 from thaJeztah/seccomp_syslog
seccomp: move the syslog syscall to be gated by CAP_SYS_ADMIN or CAP_SYSLOG
2020-08-25 11:35:28 -04:00
Sebastiaan van Stijn
325bac7c71
seccomp: allow io-uring related system calls
Adds the io-uring related system call introduced in kernel 5.1 to the
seccomp whitelist. With older kernels or older versions of libseccomp,
this configure will be omitted.

Note that io_uring will grow support for more syscalls in the future
so we should keep an eye on this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:59:53 +02:00
Sebastiaan van Stijn
0a5ee7e6f3
seccomp: allow clock_settime when CAP_SYS_TIME is added
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:43:21 +02:00
Sebastiaan van Stijn
5cdb6e81d2
seccomp: allow quotactl with CAP_SYS_ADMIN
This allows the quotactl syscall in the default seccomp profile, gated by
CAP_SYS_ADMIN.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:40:43 +02:00
Sebastiaan van Stijn
5862285fac
seccomp: allow sync_file_range2 on supported architectures.
On a ppc64le host, running postgres (tried with 9.4 to 9.6) gives the following
warning when trying to flush data to disks (which happens very frequently):

     WARNING: could not flush dirty data: Operation not permitted.

A quick dig in postgres source code indicate it uses sync_file_range(2) to
flush data; which on ppe64le and arm64 is translated to sync_file_range2(2)
for alignements reasons.

The profile did not allow sync_file_range2(2), making postgres sad because
it can not flush its buffers. arm_sync_file_range(2) is an ancient alias to
sync_file_range2(2), the syscall was renamed in Linux 2.6.22 when the same
syscall was added for PowerPC.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:36:53 +02:00
Sebastiaan van Stijn
117d678749
seccomp: allow personality with UNAME26 bit set
From personality(2):

    Have uname(2) report a 2.6.40+ version number rather than a 3.x version
    number.  Added as a stopgap measure to support broken applications that
    could not handle the  kernel  version-numbering  switch  from 2.6.x to 3.x.

This allows both "UNAME26|PER_LINUX" and "UNAME26|PER_LINUX32".

Fixes: "setarch broken in docker packages from Debian stretch"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:27:14 +02:00
Sebastiaan van Stijn
fc9e5d161a
seccomp: allow syscall membarrier
Add the membarrier syscall to the default seccomp profile.
It is for example used in the implementation of dlopen() in
the musl libc of Alpine images.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:16:26 +02:00
Sebastiaan van Stijn
1746a195e9
seccomp: allow adjtimex get time operation
Enabled adjtimex in the default profile without requiring CAP_SYS_TIME privilege.
The kernel will check CAP_SYS_TIME and won't allow setting the time.

Fixes: Getting the system time with ntptime returns an error in an unprivileged
container

To verify, inside a CentOS 7 container:

    yum install -y ntp
    ntptime
    # ntp_gettime() returns code 0 (OK)

    ntpdate -v time.nist.gov
    # ntpdate[84]: Can't adjust the time of day: Operation not permitted

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:16:23 +02:00
Sebastiaan van Stijn
7e7545e556
seccomp: allow add preadv2 and pwritev2 syscalls
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 12:16:21 +02:00
Sebastiaan van Stijn
267a0cf68e
seccomp: move the syslog syscall to be gated by CAP_SYS_ADMIN or CAP_SYSLOG
This call is what is used to implement `dmesg` to get kernel messages
about the host. This can leak substantial information about the host.
It is normally available to unprivileged users on the host, unless
the sysctl `kernel.dmesg_restrict = 1` is set, but this is not set
by standard on the majority of distributions. Blocking this to restrict
leaks about the configuration seems correct.

Relates to docker/docker#37897 "docker exposes dmesg to containers by default"

See also https://googleprojectzero.blogspot.com/2018/09/a-cache-invalidation-bug-in-linux.html

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-24 11:57:48 +02:00
Jintao Zhang
6a915a1453 seccomp: add faccessat2 syscall.
related to https://patchwork.kernel.org/patch/11545287/

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
2020-08-17 21:48:21 +08:00
Jintao Zhang
e28e55f455 seccomp: add openat2 syscall.
related to https://patchwork.kernel.org/patch/11167585/

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
2020-08-16 16:28:21 +08:00