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

Ignore relabeling ENOSUP failure #343

Merged
merged 1 commit into from Jun 25, 2019

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Jun 12, 2019

Some file systems like NFS do not support labeling. We should ignore these failures
and continue on. SELinux policy might need to be adjusted to allow access, but the
relabeling can not be fixed.

Signed-off-by: Daniel J Walsh dwalsh@redhat.com

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Some file systems like NFS do not support labeling.  We should ignore these failures
and continue on. SELinux policy might need to be adjusted to allow access, but the
relabeling can not be fixed.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
@rhatdan
Copy link
Member Author

rhatdan commented Jun 12, 2019

@@ -51,7 +52,7 @@ func (daemon *Daemon) createContainerPlatformSpecificSettings(container *contain
return err
}

if err := label.Relabel(v.Path(), container.MountLabel, true); err != nil {
if err := label.Relabel(v.Path(), container.MountLabel, true); err != nil && err != syscall.ENOTSUP {

Choose a reason for hiding this comment

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

Outside of nfs, is there ever a time when we'd get a ENOTSUP and want to return that as an error?

Copy link
Member Author

Choose a reason for hiding this comment

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

Relabelling of volumes is our attempt to change the builtin labels to something that the container can use. If the volume is not relabeled in the worse case, the container will fail to be able to use the volume and throw a permission denied error and generate AVCs.

Which is better then failing, when the policy might allow the container to use the unrelabeled content, as it would with NFS.

I believe this is in upstream docker now, to ignore ENOSUP. Other relabelling code in this repo ignore the ENOSUP error.

@TomSweeneyRedHat
Copy link

Change LGTM, I'm just a little leery that we might be letting things through that shouldn't be let through. Fix one, make another bug type of thing.

@rhatdan rhatdan merged commit 9a5735e into projectatomic:docker-1.13.1-rhel Jun 25, 2019
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.

None yet

2 participants