[20.10 backport] rootless: avoid /run/xtables.lock EACCES on SELinux hosts ; disable overlay2 if running with SELinux ; fix "x509: certificate signed by unknown authority" on openSUSE Tumbleweed #42462
Merged
thaJeztah merged 3 commits intomoby:20.10from Jul 15, 2021
Conversation
This was referenced Jun 4, 2021
Previously, running dockerd-rootless.sh on SELinux-enabled hosts was failing with "can't open lock file /run/xtables.lock: Permission denied" error. (issue 41230). This commit avoids hitting the error by relabeling /run in the RootlessKit child. The actual /run on the parent is unaffected. https://github.com/containers/podman/blob/e6fc34b71aa9d876b1218efe90e14f8b912b0603/libpod/networking_linux.go#L396-L401 Tested on Fedora 34 Signed-off-by: Akihiro Suda <[email protected]> (cherry picked from commit cdaf82b) Signed-off-by: Akihiro Suda <[email protected]>
Kernel 5.11 introduced support for rootless overlayfs, but incompatible with SELinux. On the other hand, fuse-overlayfs is compatible. Close issue 42333 Signed-off-by: Akihiro Suda <[email protected]> (cherry picked from commit 4300a52) Signed-off-by: Akihiro Suda <[email protected]>
…SUSE Tumbleweed openSUSE Tumbleweed was facing "x509: certificate signed by unknown authority" error, as `/etc/ssl/ca-bundle.pem` is provided as a symlink to `../../var/lib/ca-certificates/ca-bundle.pem`, which was not supported by `rootlesskit --copy-up=/etc` . See rootless-containers/rootlesskit issues 225 Signed-off-by: Akihiro Suda <[email protected]> (cherry picked from commit 8610d8c) Signed-off-by: Akihiro Suda <[email protected]>
60a9a80 to
b9cf7b7
Compare
Member
Author
|
@tonistiigi PTAL |
tonistiigi
approved these changes
Jul 13, 2021
3 tasks
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.
Backport
#42199 (
dockerd-rootless.sh: avoid /run/xtables.lock EACCES on SELinux hosts)- What I did
Fix #41230
- How I did it
Previously, running dockerd-rootless.sh on SELinux-enabled hosts was failing with
can't open lock file /run/xtables.lock: Permission deniederror. (issue #41230).This commit avoids hitting the error by relabeling /run in the RootlessKit child.
The actual /run on the parent is unaffected.
https://github.com/containers/podman/blob/e6fc34b71aa9d876b1218efe90e14f8b912b0603/libpod/networking_linux.go#L396-L401
- How to verify it
can't open lock file /run/xtables.lock: Permission deniederror- Description for the changelog
dockerd-rootless.sh: avoid
can't open lock file /run/xtables.lock: Permission deniederrorSELinux hosts- A picture of a cute animal (not mandatory but encouraged)
🐧
#42334 (
rootless: disable overlay2 if running with SELinux)- What I did
Close #42333 (
rootless+overlay2 (kernel 5.11)+SELinux: mkdir /home/<USER>/.local/share/docker/overlay2/<CID>-init/merged/dev: permission denied.)- How I did it
Disable overlay2 when
$_DOCKERD_ROOTLESS_SELINUXis set.We can't rely on
go-selinux.GetEnabled()because RootlessKit doesn't mount /sys/fs/selinux in the child: rootless-containers/rootlesskit#94- How to verify it
docker infoshowsfuse-overlayfsas the default storage driver on rootless, while retainingoverlay2on rootfuldocker run hello-worldworks on rootless- Description for the changelog
rootless: disable overlay2 if running with SELinux
- A picture of a cute animal (not mandatory but encouraged)
🐧
#42457 (
rootless: fix "x509: certificate signed by unknown authority" on openSUSE Tumbleweed)- What I did
Fix "x509: certificate signed by unknown authority" error on openSUSE Tumbleweed.
openSUSE Tumbleweed was facing this error, as
/etc/ssl/ca-bundle.pemis provided as a symlink to../../var/lib/ca-certificates/ca-bundle.pem, which was not supported byrootlesskit --copy-up=/etc.See rootless-containers/rootlesskit#225
- How I did it
By bind-mounting
/etc/sslfrom the parent namespace into the child.- How to verify it
Run
docker --context=rootless pull hello-worldon an openSUSE Tumbleweed host.- Description for the changelog
rootless: fix "x509: certificate signed by unknown authority" on openSUSE Tumbleweed
- A picture of a cute animal (not mandatory but encouraged)
🐧