Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

sys-apps/policycoreutils: update correct SELinux store#1502

Merged
t-lo merged 3 commits intomainfrom
t-lo/fix-semodule-in-policycoreutils-postinst
Dec 16, 2021
Merged

sys-apps/policycoreutils: update correct SELinux store#1502
t-lo merged 3 commits intomainfrom
t-lo/fix-semodule-in-policycoreutils-postinst

Conversation

@t-lo
Copy link
Copy Markdown
Contributor

@t-lo t-lo commented Dec 15, 2021

The policycoreutils ebuild calls semodule in postinst to update SELinux stores.
It does not, however, tells semodule the correct ROOT to use, so builds that go into /build/[arch]-usr end up updating the SDK's store.
Fixes
libsemanage.semanage_commit_sandbox: Error while renaming /var/lib/selinux/targeted/active to /var/lib/selinux/targeted/previous. (Invalid cross-device link)
observed when using the SDK Container to build the OS image.
It now also updates the correct store, which it previously did not.

We should consider cherry-picking this patch to flatcar-3033, flatcar-3066, and flatcar-3087.


CI (running): http://jenkins.infra.kinvolk.io:8080/job/os/job/manifest/4397/cldsv/

@t-lo t-lo requested a review from a team December 15, 2021 17:00
t-lo and others added 2 commits December 16, 2021 13:56
The policycoreutils ebuild calls `semodule` in postinst to update SELinux stores.
It does not, however, tells `semodule` the correct ROOT to use, so builds that go into `/build/[arch]-usr` end up updating the SDK's store.
Fixes 
   libsemanage.semanage_commit_sandbox: Error while renaming /var/lib/selinux/targeted/active to /var/lib/selinux/targeted/previous. (Invalid cross-device link)
observed when using the SDK Container to build the OS image.
It now also updates the correct store, which it previously did not.
Co-authored-by: Krzesimir Nowak <knowak@microsoft.com>
@t-lo t-lo force-pushed the t-lo/fix-semodule-in-policycoreutils-postinst branch from e83a107 to d0123d5 Compare December 16, 2021 12:57
@t-lo
Copy link
Copy Markdown
Contributor Author

t-lo commented Dec 16, 2021

Rebased on latest main (for the containerd-1.5.8 tarball checksum fix).

Copy link
Copy Markdown
Contributor

@krnowak krnowak left a comment

Choose a reason for hiding this comment

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

Looks good (if it fixes your issue and CI is fine).

Copy link
Copy Markdown
Contributor

@sayanchowdhury sayanchowdhury left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
@t-lo
Copy link
Copy Markdown
Contributor Author

t-lo commented Dec 16, 2021

Added a bugfix changelog file.

@t-lo
Copy link
Copy Markdown
Contributor Author

t-lo commented Dec 16, 2021

CI run successful, will merge and cherry-pick for flatcar-3033, flatcar-3066, and flatcar-3087.

@t-lo t-lo merged commit 282c561 into main Dec 16, 2021
t-lo added a commit that referenced this pull request Dec 16, 2021
sys-apps/policycoreutils: update correct SELinux store by t-lo
t-lo added a commit that referenced this pull request Dec 16, 2021
sys-apps/policycoreutils: update correct SELinux store by t-lo
t-lo added a commit that referenced this pull request Dec 16, 2021
sys-apps/policycoreutils: update correct SELinux store by t-lo
@t-lo t-lo deleted the t-lo/fix-semodule-in-policycoreutils-postinst branch December 16, 2021 17:53
t-lo added a commit to t-lo/gentoo that referenced this pull request Dec 16, 2021
The policycoreutils ebuild calls 'semodule' in postinst to update
SELinux stores. It does not, however, tells semodule the correct ROOT
to use, so installing policycoreutils in a crossdev environment will
actually update the *host's* store.

This patch adds '-S "${ROOT:-/}"' to the 'semodule' call so the correct
environment is updated.

First seen + fixed in Flatcar Container Linux:
flatcar-archive/coreos-overlay#1502

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Dec 17, 2021
The policycoreutils ebuild calls 'semodule' in postinst to update
SELinux stores. It does not, however, tells semodule the correct ROOT
to use, so installing policycoreutils in a crossdev environment will
actually update the *host's* store.

This patch adds '-S "${ROOT:-/}"' to the 'semodule' call so the correct
environment is updated.

First seen + fixed in Flatcar Container Linux:
flatcar-archive/coreos-overlay#1502

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
Closes: #23332
Signed-off-by: Sam James <sam@gentoo.org>
pothos added a commit that referenced this pull request Jan 3, 2022
The used changelog entry format in
#1502 is not really
useful for the release notes. This paragraph is good for the PR
description or a commit message, but here should be a bullet point for
the release notes.
Replace the paragraph by a release notes bullet point.
@@ -0,0 +1,10 @@
The policycoreutils ebuild calls semodule in postinst to update SELinux stores.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This changelog entry format is not really useful for the release notes. This paragraph is good for the PR description or a commit message, but here should be a bullet point for the release notes, e.g., - SDK: Fixed build error popping up in the new SDK Container because policycoreutils used the wrong ROOT to update the SELinux store ([PR#1502](https://github.com/flatcar-linux/coreos-overlay/pull/1502))
I'll file a PR for that here: #1537

pothos added a commit that referenced this pull request Jan 25, 2022
The used changelog entry format in
#1502 is not really
useful for the release notes. This paragraph is good for the PR
description or a commit message, but here should be a bullet point for
the release notes.
Replace the paragraph by a release notes bullet point.
pothos added a commit that referenced this pull request Jan 25, 2022
The used changelog entry format in
#1502 is not really
useful for the release notes. This paragraph is good for the PR
description or a commit message, but here should be a bullet point for
the release notes.
Replace the paragraph by a release notes bullet point.
t-lo pushed a commit to flatcar/scripts that referenced this pull request Apr 13, 2023
The used changelog entry format in
flatcar-archive/coreos-overlay#1502 is not really
useful for the release notes. This paragraph is good for the PR
description or a commit message, but here should be a bullet point for
the release notes.
Replace the paragraph by a release notes bullet point.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants