Skip to content

SELinux: Relabel the confext and sysexts correctly - #4385

Merged
chewi merged 1 commit into
mainfrom
chewi/relabel-exts
Nov 17, 2026
Merged

chewi merged 1 commit into
mainfrom
chewi/relabel-exts

Conversation

@chewi

@chewi chewi commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

We have been relabelling /etc (for the confext) already, but this was broken in CI and other systems where SELinux was enabled on the host, even when it was permissive.

We were previously not relabelling sysexts at all, but they were still picking up the container_file_t label from Docker.

systemd-repart was silently dropping our labels because they couldn't be applied to its staging directory within Docker's overlay. The staging directory needs to be on a bind mount instead.

This is basically a subset of #1517. Relabelling the entire system still results in heavy breakage.

How to use

Run ls -lZ against locations like /etc and /usr/bin/docker*. There should be no instance of container_file_t.

Testing done

I have manually inspected the CI build. Kola passed for amd64 on Jenkins, when combined with the ZFS fixes, which were previously still failing without these additional changes. The ZFS fixes will follow in #4377.

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)
  • Inspected CI output for image differences: /boot and /usr size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.

@chewi chewi self-assigned this Nov 17, 2026
@chewi
chewi requested a review from a team as a code owner November 17, 2026 11:50
Copilot AI balanced review requested due to automatic review settings November 17, 2026 11:50

This comment was marked as resolved.

This comment was marked as resolved.

We have been relabelling /etc (for the confext) already, but this was
broken in CI and other systems where SELinux was enabled on the host,
even when it was permissive.

We were previously not relabelling sysexts at all, but they were still
picking up the container_file_t label from Docker.

systemd-repart was silently dropping our labels because they couldn't be
applied to its staging directory within Docker's overlay. The staging
directory needs to be on a bind mount instead.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
@chewi
chewi force-pushed the chewi/relabel-exts branch from 3c751d7 to 3049fd5 Compare November 17, 2026 13:03
Copilot AI balanced review requested due to automatic review settings November 17, 2026 13:03

Copilot AI left a comment

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.

🔵 Needs a closer look

SELinux label preservation, execution domains, and standalone boot and container behavior require human validation on SELinux-enabled builders because the reported amd64 Kola run also includes separate ZFS fixes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@tormath1 tormath1 left a comment

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.

That looks good to me - I think this might solve some calico denials as well (projectcalico/calico#13685 (comment))

@chewi
chewi merged commit 8d3c008 into main Nov 17, 2026
2 of 3 checks passed
@chewi
chewi deleted the chewi/relabel-exts branch November 17, 2026 14:53

This branch is waiting to be deployed

1 waiting deployment
development — 3049fd5d Waiting Nov 17, 2026 by chewi via Wait for approval #6153
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.

4 participants