Commit Graph

299 Commits

Author SHA1 Message Date
dependabot[bot] 470610d0cc build(deps): bump github.com/cilium/ebpf from 0.5.0 to 0.6.0
Bumps [github.com/cilium/ebpf](https://github.com/cilium/ebpf) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/cilium/ebpf/releases)
- [Commits](https://github.com/cilium/ebpf/compare/v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: github.com/cilium/ebpf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-02 06:49:06 +00:00
dependabot[bot] c8ffd8f3bb Merge pull request #2983 from opencontainers/dependabot/go_modules/github.com/sirupsen/logrus-1.8.1 2021-06-02 05:52:03 +00:00
Aleksa Sarai c23426457c merge branch 'pr-2984'
dependabot[bot]:
  build(deps): bump github.com/coreos/go-systemd/v22 from 22.3.1 to 22.3.2

LGTMs: AkihiroSuda cyphar
PR #2984
2021-06-02 15:23:00 +10:00
dependabot[bot] 31f5882913 build(deps): bump github.com/coreos/go-systemd/v22 from 22.3.1 to 22.3.2
Bumps [github.com/coreos/go-systemd/v22](https://github.com/coreos/go-systemd) from 22.3.1 to 22.3.2.
- [Release notes](https://github.com/coreos/go-systemd/releases)
- [Commits](https://github.com/coreos/go-systemd/compare/v22.3.1...v22.3.2)

---
updated-dependencies:
- dependency-name: github.com/coreos/go-systemd/v22
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-02 01:57:21 +00:00
dependabot[bot] c836265b58 build(deps): bump github.com/sirupsen/logrus from 1.7.0 to 1.8.1
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.7.0 to 1.8.1.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.7.0...v1.8.1)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-02 01:57:12 +00:00
dependabot[bot] 074aa0448d build(deps): bump google.golang.org/protobuf from 1.25.0 to 1.26.0
Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.25.0 to 1.26.0.
- [Release notes](https://github.com/protocolbuffers/protobuf-go/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash)
- [Commits](https://github.com/protocolbuffers/protobuf-go/compare/v1.25.0...v1.26.0)

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-02 01:57:04 +00:00
Ben Hutchings 91b01682ae Update golang.org/x/sys to add linux/ppc support
This package was recently updated to add support for Linux on
32-bit PowerPC (ppc), implemented by gccgo.

Signed-off-by: Ben Hutchings <ben.hutchings@essensium.com>
2021-05-03 00:38:11 +02:00
Akihiro Suda e2dd9220dd go.mod: demote to Go 1.13
Dockre/Moby still builds runc with Go 1.13, so we should still support
Go 1.13.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-04-30 19:15:45 +09:00
Sebastiaan van Stijn d15c7bb0f2 go.mod: github.com/cilium/ebpf v0.5.0
full diff: https://github.com/cilium/ebpf/compare/v0.4.0...v0.5.0

Breaking changes
------------------------------------------

All LoadPinned*() functions now take LoadPinOptions to control loader behaviour.
Simply pass nil to load with default options.

- LoadPinnedMap()
- LoadPinnedProgram()
- LoadPinnedCgroup()
- LoadPinnedIter()
- LoadPinnedRawLink()
- LoadPinnedNetNs()

Bug fixes
------------------------------------------

- Program.IsPinned() now behaves correctly on maps loaded from bpffs
- Map.Pin() no longer clobbers the destination file if it already exists

Features
------------------------------------------

- Attaching to k(ret)probes and tracepoints can now be done with link.Kprobe(),
  link.Kretprobe() and link.Tracepoint()
- Programs of type Kprobe automatically get their KernelVersion fields populated
  by detecting the kernel version at runtime
- MapOptions now contains a LoadPinOptions
- ProgSpec now contains a Flags field, adding support for BPF_F_SLEEPABLE
- Made BTF map loader more flexible by looping over Vars in a BTF data section
- Pinned Maps and Programs can now be loaded from bpffs in read-or write-only mode
- Added golangci-lint project configuration, running in CI

Examples
------------------------------------------

kprobe and tracepoint examples updated to use the new link.Kprobe() and link.Tracepoint() API
There is now an example for how to attach eBPF programs to uprobes

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-13 12:54:47 +02:00
Kir Kolyshkin b7c315ad56 vendor: bump containerd/console to 1.0.2
This is to include https://github.com/containerd/console/pull/51.

Fixes: https://github.com/opencontainers/runc/issues/2896

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-04-12 11:21:07 -07:00
Sebastiaan van Stijn 289a304535 go.mod: github.com/moby/sys/mountinfo v0.4.1
full diff: https://github.com/moby/sys/compare/v0.4.0...v0.4.1

github.com/moby/sys/mountinfo v0.4.1
-----------------------------------------

- Fix PrefixFilter() being too greedy
- TestMountedBy*: add missing pre-checks
- Documentation improvements

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-04 23:24:59 +02:00
Sebastiaan van Stijn 48125179eb go.mod: github.com/cilium/ebpf v0.4.0
full diff: https://github.com/cilium/ebpf/compare/v0.2.0...v0.4.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-02 09:58:23 +02:00
Kir Kolyshkin 6538f9f20a Merge pull request #2854 from thaJeztah/runc_warn_unknown_caps
capabilities: WARN, not ERROR, for unknown / unavailable capabilities
2021-04-01 18:27:57 -07:00
Shiming Zhang adf733fa64 vendor: update go-systemd and godbus
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2021-04-01 20:54:13 +08:00
Kir Kolyshkin bed4d89f57 Merge pull request #2807 from kolyshkin/google-golang-protobuf
go.mod, libct: switch to google.golang.org/protobuf
2021-03-31 20:34:16 -07:00
Sebastiaan van Stijn e49d5da219 go.mod: OCI runtime-spec v1.0.3-0.20210326190908-1c3f411f0417
full diff: https://github.com/opencontainers/runtime-spec/compare/a8c4a9ee0f6b...1c3f411f0417

- Fix seccomp notify inconsistencies
    - seccomp: Add missing const for seccomp notify action
    - schema/defs-linux: Fix inconsistencies with seccomp notify
- Proposal: runtime should ignore capabilities that cannot be granted

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-03-26 21:22:58 +01:00
Sebastiaan van Stijn dd2caace16 go.mod: runtime-spec v1.0.3-0.20210316141917-a8c4a9ee0f6b
full diff: https://github.com/opencontainers/runtime-spec/compare/e6143ca7d51d...a8c4a9ee0f6b

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-03-16 16:57:38 +01:00
Kir Kolyshkin 97f2e351a8 go.mod, libct: bump go-criu to v5, use google.golang.org/protobuf
Switch from github.com/golang/protobuf (which appears to be obsoleted)
to google.golang.org/protobuf (which appears to be a replacement).

This needs a bump to go-criu v5.

[v2: fix debug print in criuSwrk]
[v3: switch to go-criu v5]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-03-04 08:59:55 -08:00
Aleksa Sarai 7a8d7162f9 seccomp: prepend -ENOSYS stub to all filters
Having -EPERM is the default was a fairly significant mistake from a
future-proofing standpoint in that it makes any new syscall return a
non-ignorable error (from glibc's point of view). We need to correct
this now because faccessat2(2) is something glibc critically needs to
have support for, but they're blocked on container runtimes because we
return -EPERM unconditionally (leading to confusion in glibc). This is
also a problem we're probably going to keep running into in the future.

Unfortunately there are several issues which stop us from having a clean
solution to this problem:

 1. libseccomp has several limitations which require us to emulate
    behaviour we want:

    a. We cannot do logic based on syscall number, meaning we cannot
       specify a "largest known syscall number";
    b. libseccomp doesn't know in which kernel version a syscall was
       added, and has no API for "minimum kernel version" so we cannot
       simply ask libseccomp to generate sane -ENOSYS rules for us.
    c. Additional seccomp rules for the same syscall are not treated as
       distinct rules -- if rules overlap, seccomp will merge them. This
       means we cannot add per-syscall -EPERM fallbacks;
    d. There is no inverse operation for SCMP_CMP_MASKED_EQ;
    e. libseccomp does not allow you to specify multiple rules for a
       single argument, making it impossible to invert OR rules for
       arguments.

 2. The runtime-spec does not have any way of specifying:

    a. The errno for the default action;
    b. The minimum kernel version or "newest syscall at time of profile
       creation"; nor
    c. Which syscalls were intentionally excluded from the allow list
       (weird syscalls that are no longer used were excluded entirely,
       but Docker et al expect those syscalls to get EPERM not ENOSYS).

 3. Certain syscalls should not return -ENOSYS (especially only for
    certain argument combinations) because this could also trigger glibc
    confusion. This means we have to return -EPERM for certain syscalls
    but not as a global default.

 4. There is not an obvious (and reasonable) upper limit to syscall
    numbers, so we cannot create a set of rules for each syscall above
    the largest syscall number in libseccomp. This means we must handle
    inverse rules as described below.

 5. Any syscall can be specified multiple times, which can make
    generation of hotfix rules much harder.

As a result, we have to work around all of these things by coming up
with a heuristic to stop the bleeding. In the future we could hopefully
improve the situation in the runtime-spec and libseccomp.

The solution applied here is to prepend a "stub" filter which returns
-ENOSYS if the requested syscall has a larger syscall number than any
syscall mentioned in the filter. The reason for this specific rule is
that syscall numbers are (roughly) allocated sequentially and thus newer
syscalls will (usually) have a larger syscall number -- thus causing our
filters to produce -ENOSYS if the filter was written before the syscall
existed.

Sadly this is not a perfect solution because syscalls can be added
out-of-order and the syscall table can contain holes for several
releases. Unfortuntely we do not have a nicer solution at the moment
because there is no library which provides information about which Linux
version a syscall was introduced in. Until that exists, this workaround
will have to be good enough.

The above behaviour only happens if the default action is a blocking
action (in other words it is not SCMP_ACT_LOG or SCMP_ACT_ALLOW). If the
default action is permissive then we don't do any patching.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-01-28 23:11:22 +11:00
Akihiro Suda cb26930680 remove "selinux" build tag (Always compile SELinux support)
The build tag was removed in go-selinux v1.8.0: https://github.com/opencontainers/selinux/pull/132

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-12-16 17:41:11 +09:00
Sebastiaan van Stijn ee1bdb80af vendor: github.com/cilium/ebpf v0.2.0
full diff: https://github.com/cilium/ebpf/compare/v0.1.0...v0.2.0

- btf: add go-fuzz targets
- btf: avoid Type copy in FuncProto.walk
- btf: check err in loadSpecFromVmlinux
- btf: handle type name flavours
- CI: test on 5.9 kernel
- cmd/bpf2go: output ELF .o next to the .go file
- link: add AttachSkLookup
- Remove two unused functions
- Support LSM attach
- use buffered I/O to cut down on read syscalls
- Various doc link fixes

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-11-20 13:56:46 +01:00
Akihiro Suda 4690064f05 update vendor
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-11-09 15:14:23 +09:00
Kir Kolyshkin 13afa58d0e libct/cg/sd/v2: support cpuset.* / Allowed*
* cpuset.cpus -> AllowedCPUs
 * cpuset.mems -> AllowedMemoryNodes

No test for cgroup v2 resources.unified override, as this requires a
separate test case, and all the unified resources are handled uniformly
so there's little sense to test all parameters.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-11-05 16:04:57 -08:00
Kir Kolyshkin 17de6f803d vendor: bump mountinfo to v0.4.0
Release notes:
 - https://github.com/moby/sys/releases/tag/mountinfo%2Fv0.4.0

In particular, this fixes a regression introduced in commit b8bf572812
which checked the mountinfo.Root field in a FilterFunc, while Root was
not set when calling a filter.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-10-21 21:41:13 -07:00
Kir Kolyshkin 87412ee435 vendor: bump mountinfo v0.3.1
It contains some breaking changes, so fix the code.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-10-01 18:51:25 -07:00
Sebastiaan van Stijn 819fd68392 go.mod: sirupsen/logrus v1.7.0
full diff: https://github.com/sirupsen/logrus/compare/v1.6.0...v1.7.0

removes dependency on github.com/konsorten/go-windows-terminal-sequences

Features:
   * a new buffer pool management API has been added
   * a set of `<LogLevel>Fn()` functions have been added

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-30 14:00:16 +02:00
Sebastiaan van Stijn 0eb66c955c go.mod: github.com/containerd/console v1.0.1
full diff: https://github.com/containerd/console/compare/v1.0.0...v1.0.1

Fixes compatibility with current versions of golang.org/x/sys

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-30 13:58:27 +02:00
Akihiro Suda 6e5320ffa8 Merge pull request #2584 from kolyshkin/unified-support
libct/cgroups: support Cgroups.Resources.Unified
2020-09-26 18:48:16 +09:00
Sebastiaan van Stijn 71c10e3c78 vendor: github.com/moby/sys/mountinfo v0.2.0
full diff: https://github.com/moby/sys/compare/mountinfo/v0.1.3...mountinfo/v0.2.0

Bug fixes:

- Fix path unescaping for paths with double quotes

Improvements:

- Mounted: speed up by adding fast paths using openat2 (Linux-only) and stat
- Mounted: relax path requirements (allow relative, non-cleaned paths, symlinks)
- Unescape fstype and source fields
- Documentation improvements

Testing/CI:

- Unit tests: exclude darwin
- CI: run tests under Fedora 32 to test openat2
- TestGetMounts: fix for Ubuntu build system
- Makefile: fix ignoring test failures
- CI: add cross build

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-16 22:52:26 +02:00
Kir Kolyshkin a3f91b9864 vendor: bump runtime-spec
... to include unified resources support.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-09-16 10:23:12 -07:00
Kir Kolyshkin b682e8cf2d vendor: bump fileutils to v0.5.0
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-09-10 10:36:54 -07:00
Akihiro Suda 6dfbe9b807 support CAP_PERFMON, CAP_BPF, and CAP_CHECKPOINT_RESTORE
CAP_PERFMON and CAP_BPF were introduced in kernel 5.8: https://kernelnewbies.org/Linux_5.8#Introduce_CAP_BPF_and_CAP_PERFMON_security_capabilities

CAP_CHECKPOINT_RESTORE was merged on the master recently and will be available in the next version of the kernel. https://github.com/torvalds/linux/commit/124ea650d3072b005457faed69909221c2905a1f

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-08-15 15:47:47 +09:00
Akihiro Suda 234d15ecd0 Merge pull request #2520 from thaJeztah/bump_runtime_spec
vendor: update runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6
2020-08-04 14:05:33 +09:00
Akihiro Suda 78d02e8563 Merge pull request #2534 from adrianreber/go-criu-4-1-0
Pass location of CRIU binary to go-criu
2020-08-03 16:21:50 +09:00
Adrian Reber 267b7148cb Upgrade go-criu to 4.1.0
Signed-off-by: Adrian Reber <areber@redhat.com>
2020-07-31 11:14:15 +02:00
Sebastiaan van Stijn 901dccf05d vendor: update runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-30 22:08:54 +02:00
John Hwang 5935296367 Update go.mod
Signed-off-by: John Hwang <john.f.hwang@gmail.com>
2020-07-30 05:28:39 -07:00
Sebastiaan van Stijn f49adb5277 vendor: update cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775
full diff: https://github.com/cilium/ebpf/compare/a9f01edf17e3...1c8d4c9ef775

drops support for go1.12, and removes dependency on the golang.org/x/xerrors
transitional package.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-02 14:48:23 +02:00
Akihiro Suda cd4b71c27a Merge pull request #2409 from adrianreber/go-criu-4-0-0
Update to latest go-criu
2020-05-21 01:39:09 +09:00
Adrian Reber 944e057025 Update to latest go-criu (4.0.2)
This updates to the latest version of go-criu (4.0.2) which is based on
CRIU 3.14.

As go-criu provides an existing way to query the CRIU binary for its
version this also removes all the code from runc to handle CRIU version
checking and now relies on go-criu.

An important side effect of this change is that this raises the minimum
CRIU version to 3.0.0 as that is the first CRIU version that supports
CRIU version queries via RPC in contrast to parsing the output of
'criu --version'

CRIU 3.0 has been released in April of 2017.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-05-20 13:49:38 +02:00
Giuseppe Scrivano 510c79f9cf vendor: update runtime-specs to 237cc4f519e
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-05-20 09:11:54 +02:00
Alice Frosi 828e4ad89d epbf: update github.com/cilium/ebpf
Update ebpf to include PR https://github.com/cilium/ebpf/pull/91.
The update is needed to fix #2316.

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2020-05-08 14:20:19 +02:00
Sebastiaan van Stijn b48bbdd08d vendor: opencontainers/selinux v1.5.1, update deprecated uses
full diff: https://github.com/opencontainers/selinux/v1.4.0...v1.5.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-05 15:53:40 +02:00
Sebastiaan van Stijn e8bece65a9 vendor: sirupsen/logrus v1.6.0
full diff: https://github.com/sirupsen/logrus/compare/v1.5.0...v1.6.0

- Add flag to disable quotes in TextFormatter
- Revert "fix race conditions on entry"
    - fixes Deadlock during Entry.Infof after upgrade to v1.5.0
    - fixes Deadlock when using WithField inside of hook
    - fixes Overly-aggressive mutex locks

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-04 02:24:03 +02:00
Akihiro Suda dfc1b0cd51 update vendor
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-03-28 04:22:06 +09:00
Mrunal Patel 53ad1d5100 Merge pull request #2256 from kolyshkin/mountinfo-alt
Use faster mountinfo parser (part 1)
2020-03-27 11:36:51 -07:00
Kir Kolyshkin c7ab2c036b libcontainer: switch to moby/sys/mountinfo package
Delete libcontainer/mount in favor of github.com/moby/sys/mountinfo,
which is fast mountinfo parser.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-03-21 10:33:43 -07:00
Akihiro Suda 492d525e55 vendor: update go-systemd and godbus
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-03-16 13:26:03 +09:00
Odin Ugedal 69e8fb2a74 Add support for GO Modules
This removes vndr, and swiches to native Go Modules instead. All modules
are kept on the old version.

Keeps the vendor/ dir, so everything is backwards compatible.

Signed-off-by: Odin Ugedal <odin@ugedal.com>
2020-03-07 09:29:29 +01:00