Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backport 1.18] cri: pull in updated /dev/shm fix #2508

Conversation

dweomer
Copy link
Contributor

@dweomer dweomer commented Nov 12, 2020

Proposed Changes

Do not relabel container /dev/shm when it is host /dev/shm.

Types of Changes

bugfix

Verification

kubectl run envoy --image=envoyproxy/envoy:v1.14.1
pod/envoy created
# after some seconds, should get a running pod:
kubectl get pod
NAME    READY   STATUS    RESTARTS   AGE
envoy   1/1     Running   0          18s

Additionally, with HostIPC=true:

kubectl run envoy --image=envoyproxy/envoy:v1.14.1 --overrides='{ "apiVersion": "v1", "spec": { "hostIPC" : true} }'
pod/envoy created
# after some seconds, should get a running pod:
kubectl get pod
NAME    READY   STATUS    RESTARTS   AGE
envoy   1/1     Running   0          18s

And a directory listing of /dev/shm should look like:

ls -alZ /dev/shm/
drwxrwxrwt. root root system_u:object_r:tmpfs_t:s0     .
drwxr-xr-x. root root system_u:object_r:device_t:s0    ..
-rw-------. root root system_u:object_r:container_file_t:s0 envoy_shared_memory_0

Specifically, /dev/shm should NOT have the container_file_t context label.

Linked Issues

#2240

Further Comments

Backports containerd/cri#1605 to 1.3

Do not relabel container /dev/shm when it is host /dev/shm.

Signed-off-by: Jacob Blain Christen <[email protected]>
Copy link
Contributor

@galal-hussein galal-hussein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dweomer dweomer merged commit 507a5e6 into k3s-io:release-1.18 Nov 12, 2020
@dweomer dweomer deleted the fix/2240/1.18/selinux-relabel-dev-shm-but-not-with-host-ipc branch November 12, 2020 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants