Skip to content
This repository has been archived by the owner on Oct 10, 2020. It is now read-only.

syscontainers: correctly setup the rootfs SELinux label #1185

Conversation

giuseppe
Copy link
Collaborator

The files inside the container are labelled by Skopeo when the image is
pulled to the OSTree storage.

Instead the root directory is created by atomic and by default it gets
the label "unconfined_u:object_r:container_share_t:s0".

Make sure we label it with the same label of '/'.

We have changed the way files are labelled by Skopeo but we forgot to change

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1544175

Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com

@giuseppe
Copy link
Collaborator Author

this is an urgent fix for running Open Shift with system containers, we should get it in a release

@giuseppe giuseppe force-pushed the syscontainers-create-root-correct-label branch from e6273d9 to 5559fa5 Compare February 13, 2018 12:49
@rhatdan
Copy link
Member

rhatdan commented Feb 13, 2018

LGTM

@cgwalters
Copy link
Member

Commit message looks slightly truncated...forgot to change "this"? Otherwise looks sane to me.

The files inside the container are labelled by Skopeo when the image is
pulled to the OSTree storage.

Instead the root directory is created by atomic and by default it gets
the label "unconfined_u:object_r:container_share_t:s0".

Make sure we label the rootfs with the same label of '/'.

We have changed the way files are labelled by Skopeo but we forgot to
change the label for the rootfs created by atomic.  This patch ensures
the SELinux label for the rootfs is set.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1544175

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@giuseppe giuseppe force-pushed the syscontainers-create-root-correct-label branch from 5559fa5 to 4ea5d5a Compare February 14, 2018 13:29
@giuseppe
Copy link
Collaborator Author

Thanks for the review, I've might have pressed C-k by mistake while editing the commit message. Fixed now.

@ashcrow
Copy link
Contributor

ashcrow commented Feb 14, 2018

The failure is the common flake in test_storage.sh

Copy link
Contributor

@ashcrow ashcrow left a comment

Choose a reason for hiding this comment

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

LGTM

@giuseppe
Copy link
Collaborator Author

can someone r+ it? :-)

@cgwalters
Copy link
Member

@rh-atomic-bot r+ 4ea5d5a

@rh-atomic-bot
Copy link

⌛ Testing commit 4ea5d5a with merge 3c02fee...

rh-atomic-bot pushed a commit that referenced this pull request Feb 14, 2018
The files inside the container are labelled by Skopeo when the image is
pulled to the OSTree storage.

Instead the root directory is created by atomic and by default it gets
the label "unconfined_u:object_r:container_share_t:s0".

Make sure we label the rootfs with the same label of '/'.

We have changed the way files are labelled by Skopeo but we forgot to
change the label for the rootfs created by atomic.  This patch ensures
the SELinux label for the rootfs is set.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1544175

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1185
Approved by: cgwalters
@rh-atomic-bot
Copy link

💔 Test failed - status-papr

@ashcrow
Copy link
Contributor

ashcrow commented Feb 14, 2018

bot, retry

@giuseppe
Copy link
Collaborator Author

@rh-atomic-bot retry

@rh-atomic-bot
Copy link

⌛ Testing commit 4ea5d5a with merge 279d4d4...

@rh-atomic-bot
Copy link

☀️ Test successful - status-papr
Approved by: cgwalters
Pushing 279d4d4 to master...

@giuseppe
Copy link
Collaborator Author

can we get a new build? This change is critical to run Open Shift as a system container

eyusupov pushed a commit to eyusupov/atomic that referenced this pull request Mar 10, 2018
The files inside the container are labelled by Skopeo when the image is
pulled to the OSTree storage.

Instead the root directory is created by atomic and by default it gets
the label "unconfined_u:object_r:container_share_t:s0".

Make sure we label the rootfs with the same label of '/'.

We have changed the way files are labelled by Skopeo but we forgot to
change the label for the rootfs created by atomic.  This patch ensures
the SELinux label for the rootfs is set.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1544175

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: projectatomic#1185
Approved by: cgwalters
miabbott added a commit to miabbott/atomic-host-tests that referenced this pull request Mar 12, 2018
Two major changes here:

1)  Pin the system containers to a previous version that was working

2)  Make sure that 'atomic 1.22' is installed on the host

The new requirement on 'atomic 1.22' is to resolve the following issue
with SELinux labeling - projectatomic/atomic#1185

This is only a temporary change; once the latest versions of the
system containers are known to be working, we can revert a lot of
this.
mike-nguyen pushed a commit to projectatomic/atomic-host-tests that referenced this pull request Mar 13, 2018
Two major changes here:

1)  Pin the system containers to a previous version that was working

2)  Make sure that 'atomic 1.22' is installed on the host

The new requirement on 'atomic 1.22' is to resolve the following issue
with SELinux labeling - projectatomic/atomic#1185

This is only a temporary change; once the latest versions of the
system containers are known to be working, we can revert a lot of
this.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants