Bug 1401131
| Summary: | [3.3] Secrets getting mounted in container with out rootcontext getting added to mount. | |||
|---|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Ryan Howe <rhowe> | |
| Component: | Node | Assignee: | Paul Morie <pmorie> | |
| Status: | CLOSED ERRATA | QA Contact: | Zhang Cheng <chezhang> | |
| Severity: | high | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 3.3.0 | CC: | agoldste, aos-bugs, decarr, dma, ekuric, eparis, jeder, jokerman, mmccomas | |
| Target Milestone: | --- | Keywords: | Reopened | |
| Target Release: | 3.3.1 | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | Bug Fix | ||
| Doc Text: |
A race condition in the libcontainer SELinux library could have resulted in secret mount points being created without the rootcontext properly set resulting in failures to read the secret. The race condition has been addressed ensuring appropriate access to secrets.
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 1403244 (view as bug list) | Environment: | ||
| Last Closed: | 2017-01-26 20:42:48 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1403244 | |||
|
Description
Ryan Howe
2016-12-02 22:26:09 UTC
Paul and I were chatting today. He said offhand "This is impossible unless SelinuxEnabled() is lying to us." So I decided to go see if SelinuxEnabled() could be lying to us. Low and behold... The function did this: ``` 1. if valueInitialized 2. return value 3. valueInitialized = true 4. value = determineValue() 5. return value ``` So another caller racing while this call was between lines 3 and 4 could get the wrong value!!! https://github.com/opencontainers/runc/pull/1216 This could also explain why it happens only on startup as once the caller finishes line 4 things will work correctly... Still a lot of steps in the process to get this fixed code propagated everywhere it needs to propagate to get a test build, but it could be explaining the "impossible" problem. We need patches for origin/master and kube. @decarr, can you track that? ASSIGNED until it's merged into ose/enterprise-3.3. I think we need patches for the following: ose/enterprise-3.3 (https://github.com/openshift/ose/pull/501) origin/release-1.4 origin/master kubernetes/release-1.5 kubernetes/master @chezhang, help verify this bug on 3.3.1 Verify on openshift v3.3.1.7 Steps: 1. Create a rc oc create -f https://raw.githubusercontent.com/mdshuai/testfile-openshift/master/k8s/rc-with-emptdir.yaml 2. Scale rc replicas=5 and wait all pod is running [root@ip-172-18-5-182 ~]# oc scale rc/hello-pod --replicas=5 replicationcontroller "hello-pod" scaled [root@ip-172-18-5-182 ~]# oc get pod NAME READY STATUS RESTARTS AGE hello-pod-77io7 1/1 Running 0 13m hello-pod-gt6r6 1/1 Running 0 13m hello-pod-gvllb 1/1 Running 0 13m hello-pod-vfvm7 1/1 Running 0 14m hello-pod-xu7yq 1/1 Running 0 13m 3. On node check all mounted secrets has correct context [root@ip-172-18-5-182 ~]# mount|grep pods tmpfs on /var/lib/origin/openshift.local.volumes/pods/e55f13ee-c809-11e6-a7e2-0e942c8fa67e/volumes/kubernetes.io~secret/builder-token-81dcw type tmpfs (rw,relatime,rootcontext=system_u:object_r:svirt_sandbox_file_t:s0,seclabel) tmpfs on /var/lib/origin/openshift.local.volumes/pods/e55f13ee-c809-11e6-a7e2-0e942c8fa67e/volumes/kubernetes.io~secret/builder-dockercfg-jo3kj-push type tmpfs (rw,relatime,rootcontext=system_u:object_r:svirt_sandbox_file_t:s0,seclabel) tmpfs on /var/lib/origin/openshift.local.volumes/pods/06dc0b5d-c80a-11e6-a7e2-0e942c8fa67e/volumes/kubernetes.io~secret/default-token-sn9do type tmpfs (rw,relatime,rootcontext="system_u:object_r:svirt_sandbox_file_t:s0:c7,c8",seclabel) tmpfs on /var/lib/origin/openshift.local.volumes/pods/0b10e794-c80a-11e6-a7e2-0e942c8fa67e/volumes/kubernetes.io~secret/default-token-sn9do type tmpfs (rw,relatime,rootcontext="system_u:object_r:svirt_sandbox_file_t:s0:c7,c8",seclabel) tmpfs on /var/lib/origin/openshift.local.volumes/pods/0b0f366b-c80a-11e6-a7e2-0e942c8fa67e/volumes/kubernetes.io~secret/default-token-sn9do type tmpfs (rw,relatime,rootcontext="system_u:object_r:svirt_sandbox_file_t:s0:c7,c8",seclabel) tmpfs on /var/lib/origin/openshift.local.volumes/pods/0b0ee35a-c80a-11e6-a7e2-0e942c8fa67e/volumes/kubernetes.io~secret/default-token-sn9do type tmpfs (rw,relatime,rootcontext="system_u:object_r:svirt_sandbox_file_t:s0:c7,c8",seclabel) tmpfs on /var/lib/origin/openshift.local.volumes/pods/0b13e92c-c80a-11e6-a7e2-0e942c8fa67e/volumes/kubernetes.io~secret/default-token-sn9do type tmpfs (rw,relatime,rootcontext="system_u:object_r:svirt_sandbox_file_t:s0:c7,c8",seclabel) tmpfs on /var/lib/origin/openshift.local.volumes/pods/41b2f1c0-c80a-11e6-a7e2-0e942c8fa67e/volumes/kubernetes.io~secret/default-token-5ze2c type tmpfs (rw,relatime,rootcontext="system_u:object_r:svirt_sandbox_file_t:s0:c2,c8",seclabel) tmpfs on /var/lib/origin/openshift.local.volumes/pods/067587df-c80b-11e6-a7e2-0e942c8fa67e/volumes/kubernetes.io~secret/default-token-5ze2c type tmpfs (rw,relatime,rootcontext="system_u:object_r:svirt_sandbox_file_t:s0:c2,c8",seclabel) Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:0199 |