-
Notifications
You must be signed in to change notification settings - Fork 882
SElinux not correctly working with overlayfs #1727
Comments
From irc discussion, @cyrus-mc is using stage1-coreos.aci |
hmm, is this the v0.10.0 release from GitHub, or did you build it yourself? |
I've gotten the same issue when using rkt v0.10.0 and v0.11.0 (from releases page) on Fedora 23. I have to disable SELinux to run pods. Run output:
Full audit logs here. Interesting part:
|
@mjg59 any ideas here? |
From OOB communication with @mjg59 we can say that So, either we add a disable-selinux option to configure or we wait until Fedora policy gets fixed. Another issue might be that we expect overlays to support selinux and CoreOS has a patched kernel for that. |
The overlay fs patch for SELinux support is here with others in the series. |
The command
So it is systemd inside the container trying to read libselinux.so.1 inside the container.
They are using the same inode because the first one is the overlay fs lower directory, and the second one is in the overlay fs mount. |
Same error without using overlay fs:
|
You can not use SELinux and Overlay at this time. Well I guess you could label everything under /var/lib/rkt/pods as system_u:object_r:svirt_sandbox_file_t:s0 and it might work better. Not sure how you disable SELinux for rkt process separation, but you might have to. Red Hat Kernel Engineers continue to look to improve OverlayFS with SELinux but nothing so far. |
@rhatdan I tested as well with Then, I tried:
So it works a bit further but still fails.
|
This looks like this content "systemd dir" and "tty chr_file" are being created by the user process on /tmp and then somehow being used within the container. I guess rkt guys will need to figure out what is happening, I have not used rkt. |
Currently only pod level selinux context is supported, besides when running selinux, for now we will not be able to use the overlay fs except for coreos, see: rkt/rkt#1727 (comment). Conflicts: pkg/kubelet/rkt/rkt.go
Removing from specific milestone as still dependent on external work. |
Currently only pod level selinux context is supported, besides when running selinux, for now we will not be able to use the overlay fs except for coreos, see: rkt/rkt#1727 (comment).
Automatic merge from submit-queue rkt: Add pod selinux support. Currently only pod level selinux context is supported, besides when running selinux, we will not be able to use the overlay fs, see: rkt/rkt#1727 (comment). cc @kubernetes/sig-node @alban @mjg59 @pmorie
Currently only pod level selinux context is supported, besides when running selinux, for now we will not be able to use the overlay fs except for coreos, see: rkt/rkt#1727 (comment).
am having this same issue in Fedora 23 |
The fixes (fedora-selinux/selinux-policy#100 and fedora-selinux/selinux-policy#108) are in Fedora 24. There's one more fix (fedora-selinux/selinux-policy#114) which I'm not sure it's included in 24, but it is in Rawhide. |
The pending kernel patches for SELinux + Overlayfs: /cc @mjg59 |
Yes, it currently looks like this will land in 4.9 kernel. |
is this resolved? |
SELinux and Overlayfs are currently working in the Fedora Rawhide Kernel and Fedora 25. |
Overlayfs supports selinux since Linux 4.9. The related commits are the following:
|
Environment
OS: CentOS 7.1
Kernel: 3.10.0
rkt: 0.10.0
systemd: 208
When trying to start any container, with selinux set to Enforcing I received the following error:
/usr/lib/systemd/systemd: error while loading shared libraries: libselinux.so.1: cannot open shared object file: Permission denied
Disabling selinux (disabled or Permissive) solved the issue.
The text was updated successfully, but these errors were encountered: