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

restorecon doesn't work in ostree native container builds #4516

Closed
solopasha opened this issue Jul 24, 2023 · 2 comments
Closed

restorecon doesn't work in ostree native container builds #4516

solopasha opened this issue Jul 24, 2023 · 2 comments

Comments

@solopasha
Copy link

Host system details

State: idle
Deployments:
● ostree-unverified-image:containers-storage:localhost/swtpm-test
                   Digest: sha256:142d1951e54e6cdb10cfe7f385d1be569772f8928b73ac5708625ed87e37d553
                  Version: 38.20230724.0 (2023-07-24T13:18:51Z)
          LayeredPackages: langpacks-en
 
  fedora:fedora/38/x86_64/silverblue
                  Version: 38.20230724.0 (2023-07-24T00:47:54Z)
               BaseCommit: 536e6f48f3b1ce98b250ec8247e6d8947dd256e8d8fc738092f8b313114787f2
             GPGSignature: Valid signature by 6A51BBABBA3D5467B6171221809A8D7CEB10B464
          LayeredPackages: langpacks-en

Expected vs actual behavior

Actual:

swtpm gets an incorrect SELinux label when layered in a container build preventing VMs with an emulated tpm from starting.

ls -Z /usr/bin/swtpm
system_u:object_r:bin_t:s0 /usr/bin/swtpm

Expected:

ls -Z /usr/bin/swtpm 
system_u:object_r:swtpm_exec_t:s0 /usr/bin/swtpm

Steps to reproduce it

  1. Containerfile:
FROM quay.io/fedora-ostree-desktops/base:38
RUN rpm-ostree install swtpm && \
    ostree container commit

  1. podman build -t swtpm-test .
  2. rpm-ostree rebase ostree-unverified-image:containers-storage:localhost/swtpm-test
  3. boot into the deployment
  4. ls -Z /usr/bin/swtpm

Would you like to work on the issue?

No, sorry.

@jpeeler
Copy link

jpeeler commented Aug 1, 2023

Probably related to ostreedev/ostree-rs-ext#510.

@cgwalters
Copy link
Member

Yeah, this is a duplicate of that issue.

@cgwalters cgwalters closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants