cri: selinux relabel /dev/shm
Address an issue originally seen in the k3s 1.3 and 1.4 forks of containerd/cri, https://github.com/rancher/k3s/issues/2240 Even with updated container-selinux policy, container-local /dev/shm will get mounted with container_runtime_tmpfs_t because it is a tmpfs created by the runtime and not the container (thus, container_runtime_t transition rules apply). The relabel mitigates such, allowing envoy proxy to work correctly (and other programs that wish to write to their /dev/shm) under selinux. Tested locally with: - SELINUX=Enforcing vagrant up --provision-with=shell,selinux,test-integration - SELINUX=Enforcing CRITEST_ARGS=--ginkgo.skip='HostIpc is true' vagrant up --provision-with=shell,selinux,test-cri - SELINUX=Permissive CRITEST_ARGS=--ginkgo.focus='HostIpc is true' vagrant up --provision-with=shell,selinux,test-cri Signed-off-by: Jacob Blain Christen <jacob@rancher.com>
This commit is contained in:
parent
ac61e58cdd
commit
e8d8ae3b97
@ -102,6 +102,7 @@ func (c *criService) containerMounts(sandboxID string, config *runtime.Container
|
||||
ContainerPath: devShm,
|
||||
HostPath: sandboxDevShm,
|
||||
Readonly: false,
|
||||
SelinuxRelabel: true,
|
||||
})
|
||||
}
|
||||
return mounts
|
||||
|
Loading…
Reference in New Issue
Block a user