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

Do not force any selinux context on volumeDir #12942

Merged
merged 1 commit into from
Jun 27, 2017

Conversation

eparis
Copy link
Member

@eparis eparis commented Feb 13, 2017

docker should be able to handle all of this correctly without the two
problems in this patch.

  1. It hard codes svirt_sandbox_file_t, which is actually policy
    specific, even if basically everyone uses our reference policy.

  2. It means that things under that directory could (if they can break
    out of their mount namespace) see this directory.

docker doesn't require this anymore. So remove this custom hack.

xref https://bugzilla.redhat.com/show_bug.cgi?id=1421738

@eparis
Copy link
Member Author

eparis commented Feb 13, 2017

[test] lets see what I break...

@rhatdan
Copy link
Contributor

rhatdan commented Feb 14, 2017

Also we are no longer using svirt_sandbox_file_t and svirt_lxc_net_t, we are now using container_t and container_file_t. Just to prove the point.

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 3, 2017
@eparis eparis force-pushed the no-chcon-volume-dir branch 2 times, most recently from 322d840 to 05302d7 Compare May 11, 2017 21:15
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 11, 2017
@eparis
Copy link
Member Author

eparis commented May 12, 2017

@pmorie what do you think?

Copy link
Contributor

@pmorie pmorie left a comment

Choose a reason for hiding this comment

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

Generally LGTM; a couple questions

@@ -66,20 +66,6 @@ If this shows up in your build logs, restart docker and then resubmit a build:
$ sudo systemctl restart docker
$ oc start-build --from-build=<your build identifier>

Another item seen stems from how OpenShift operates in a SELinux environment. The SELinux policy requires that host directories that are bind mounted have the svirt_sandbox_file_t label. Generally
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we need to keep this note and change the label to container_file_t

@@ -108,10 +108,6 @@ ownership/permissions.
For volume permission problems please consult the Persistent Storage section
of the Administrator's Guide.

In the case of SELinux this may be resolved on the node by running:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be okay to remove, unless for some reason we are expecting people having trouble with hostpath PVs (which they should never be using anyway) to look here for a solution

@pmorie
Copy link
Contributor

pmorie commented Jun 2, 2017

Actually, I am cool with this. [merge]

@eparis
Copy link
Member Author

eparis commented Jun 2, 2017

removed the tag from sdodson. I'm scared this will break something and will tag it after this sprint is closed.

@sdodson
Copy link
Member

sdodson commented Jun 2, 2017

ok, upcomingrelease'ing my bug that depends on this

@eparis
Copy link
Member Author

eparis commented Jun 5, 2017

[merge]

@eparis
Copy link
Member Author

eparis commented Jun 5, 2017

[merge] you stoopid flaky thing

@eparis
Copy link
Member Author

eparis commented Jun 6, 2017

[merge] you flaky thing

@eparis
Copy link
Member Author

eparis commented Jun 8, 2017

[merge] again. because? peanuts.

@sdodson
Copy link
Member

sdodson commented Jun 8, 2017

It seems to pretty consistently fail on building the node unit test, do the tests just need to be updated?

@eparis
Copy link
Member Author

eparis commented Jun 20, 2017

[merge][severity: bug]
(last set of tests are gone :-()

docker should be able to handle all of this correctly without the
two problems in this patch.

It hard codes svirt_sandbox_file_t, which is actually policy
specific, even if basically everyone uses our reference policy.

It means that things under that directory could (if they can break
out of their mount namespace) see this directory.

docker doesn't require this anymore. So remove this custom hack.
@sjenning
Copy link
Contributor

[merge][severity: bug]

@sjenning
Copy link
Contributor

@sjenning
Copy link
Contributor

@eparis this requires a blocker merge tag. IIUC this is a blocker fix. please confirm.

@eparis
Copy link
Member Author

eparis commented Jun 21, 2017

[merge][severity: blocker]

1 similar comment
@sjenning
Copy link
Contributor

[merge][severity: blocker]

@eparis
Copy link
Member Author

eparis commented Jun 22, 2017

[test]
at this point lets UpcomingRelease the BZ and remind me to merge by hand monday morning.

@sdodson
Copy link
Member

sdodson commented Jun 26, 2017

[merge][severity:blocker]

@deads2k
Copy link
Contributor

deads2k commented Jun 26, 2017

test_pull_request_origin_extended_conformance_gce -- failed, aborting job.

@deads2k
Copy link
Contributor

deads2k commented Jun 26, 2017

re[merge]

@deads2k
Copy link
Contributor

deads2k commented Jun 26, 2017

re[test]

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 88e4c71

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/2626/) (Base Commit: 496129f) (PR Branch Commit: 88e4c71)

@eparis
Copy link
Member Author

eparis commented Jun 27, 2017

[merge] last time. then by hand.

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 88e4c71

@openshift-bot
Copy link
Contributor

openshift-bot commented Jun 27, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/1151/) (Base Commit: c7d9fb8) (PR Branch Commit: 88e4c71) (Extended Tests: blocker, bug) (Image: devenv-rhel7_6403)

@openshift-bot openshift-bot merged commit d0ed5a3 into openshift:master Jun 27, 2017
@@ -1182,7 +1182,7 @@ func SetupHostPathVolumes(c kcoreclient.PersistentVolumeInterface, prefix, capac
return volumes, err
}
if _, err = exec.LookPath("chcon"); err == nil {
err := exec.Command("chcon", "-t", "svirt_sandbox_file_t", dir).Run()
err := exec.Command("chcon", "-t", "container_file_t", dir).Run()
Copy link
Contributor

Choose a reason for hiding this comment

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

/me shakes fist at @eparis

@adelton
Copy link
Contributor

adelton commented Sep 8, 2017

Just to cross reference, the fallout of this change is https://bugzilla.redhat.com/show_bug.cgi?id=1481617 and possibly also #15750.

@eparis eparis deleted the no-chcon-volume-dir branch September 6, 2018 14:08
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.

10 participants