cgroupv2: ebpf: ignore inaccessible existing programs#3055
Merged
AkihiroSuda merged 2 commits intoopencontainers:masterfrom Jul 14, 2021
cyphar:cgroup-bpf-replace-selinux
Merged
cgroupv2: ebpf: ignore inaccessible existing programs#3055AkihiroSuda merged 2 commits intoopencontainers:masterfrom cyphar:cgroup-bpf-replace-selinux
AkihiroSuda merged 2 commits intoopencontainers:masterfrom
cyphar:cgroup-bpf-replace-selinux
Conversation
Member
Author
|
This was a regression in 1.0.0. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
|
Nice! Should we mark this one as a draft, waiting for 0.6.2 (or whatever the next version is) of cilium/ebpf to be released? |
Member
Author
|
Sure, I marked it as a draft (though not sure when they'll do a release). |
This was referenced Jul 8, 2021
Closed
Contributor
Filed cilium/ebpf#340, hope they will cut a release soon. |
AkihiroSuda
reviewed
Jul 12, 2021
We need to update the eBPF library so that we can get the raw syscall errors from bpf(2) syscalls using errors.Is. Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This is necessary in order for runc to be able to configure device cgroups with --systemd-cgroup on distributions that have very strict SELinux policies such as openSUSE MicroOS[1]. The core issue here is that systemd is adding its own BPF policy that has an SELinux label such that runc cannot interact with it. In order to work around this, we can just ignore the policy -- in theory this behaviour is not correct but given that the most obvious case (--systemd-cgroup) will still handle updates correctly, this logic is reasonable. [1]: https://bugzilla.suse.com/show_bug.cgi?id=1182428 Fixes: d0f2c25 ("cgroup2: devices: replace all existing filters when attaching") Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
AkihiroSuda
approved these changes
Jul 14, 2021
This was referenced Jul 20, 2021
Member
|
Got a report that the fix may not be sufficient, and errors still pop up (I asked them to open a ticket in this repository); moby/moby#42677 (comment) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is necessary in order for runc to be able to configure device
cgroups with --systemd-cgroup on distributions that have very strict
SELinux policies such as openSUSE MicroOS.
The core issue here is that systemd is adding its own BPF policy that
has an SELinux label such that runc cannot interact with it. In order to
work around this, we can just ignore the policy -- in theory this
behaviour is not correct but given that the most obvious case
(--systemd-cgroup) will still handle updates correctly, this logic is
reasonable.
Fixes: d0f2c25 ("cgroup2: devices: replace all existing filters when attaching")
Signed-off-by: Aleksa Sarai cyphar@cyphar.com
Changelog Entry
1.0 backport: #3087