flightctl-agent loses SELinux context (unlabeled_t) after bootc deployment switch on RHEL 9
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- linux
- Domain
- operating-systems, security
Research direction
Start by reproducing the deployment switch and reboot sequence, then inspect how the bootc switch handles SELinux metadata on /usr and compare with the related issue #1346. Done means /usr/bin/flightctl-agent retains flightctl_agent_exec_t after the switch and reboot, and flightctl-agent.service starts under enforcing SELinux.
Written by the indexing model from the issue text.
Description
Summary
After a bootc deployment switch triggered by an OS image update (flightctl-agent on RHEL 9 bootc, managed via Red Hat Edge Manager / flightctl), /usr/bin/flightctl-agent ends up with SELinux context unlabeled_t on overlay. systemd cannot exec the agent under SELinux enforcing; the service restart-loops and the device stops checking in to management.
On a fresh install before any deployment switch, the same binary has the correct label:
# Before any OS image change
# ls -Z /usr/bin/flightctl-agent
system_u:object_r:flightctl_agent_exec_t:s0 /usr/bin/flightctl-agent
After switch + reboot:
# ls -Z /usr/bin/flightctl-agent
system_u:object_r:unlabeled_t:s0 /usr/bin/flightctl-agent
Example AVC:
avc: denied { execute } for pid=2143 comm="(tl-agent)" name="flightctl-agent" dev="overlay"
scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file
trawcon="system_u:object_r:flightctl_agent_exec_t:s0"
systemd:
flightctl-agent.service: Failed to locate executable /usr/bin/flightctl-agent: Permission denied
flightctl-agent.service: Failed at step EXEC spawning /usr/bin/flightctl-agent: Permission denied
Disabling SELinux works around it. restorecon on /usr does not persist because /usr is read-only on bootc; temporary fix via bootc usr-overlay is lost on reboot.
Reproducibility
Reproduces when switching to the same image content with only a different tag (not caused by image content changes).
Steps to reproduce
- Build a RHEL 9 bootc image that installs
flightctl-agentandflightctl-selinuxfrom the edge-manager 1.2 RPM repo; enableflightctl-agent.serviceand maskbootc-fetch-apply-updates.timer. - Install the device from a bootc/anaconda ISO that points at an initial OS image reference.
- Enroll the device into a flightctl/RHEM 1.2 management service.
- Confirm before update:
ls -Z /usr/bin/flightctl-agentshowsflightctl_agent_exec_t. - Change the device OS image reference in management to a different tag of the same bootc image (or any new bootc image reference).
- After bootc switch/reboot: agent fails;
ls -Z /usr/bin/flightctl-agentshowsunlabeled_t.
Environment
- RHEL 9 bootc (
registry.redhat.io/rhel9/rhel-bootc:9.6) - flightctl / edge-manager 1.2 (server + agent)
- SELinux enforcing
Expected
After deployment switch, /usr/bin/flightctl-agent retains flightctl_agent_exec_t and the agent service starts.
Related
- Possibly same class of SELinux xattr/metadata issues as #1346
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 230
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 42
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bootc-dev/bootc
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
install: improve error message when systemd-boot is selected without composefs backendMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
Maintainers usually reply within 2 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Wait for the IDS correction dialog to settle in the stale-audit testPossibly taken @louistrue claimed this today. Openready
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dutchman-cad/dutchman#874 ·
Maintainers usually reply within 1 day
-
bug good first issue ready
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MartinPTielemans/ilo#3840 ·
Maintainers usually reply within 1 day
-
bug file-compat priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
storytold/wordcraft#7248 · 1 comment ·
Maintainers usually reply within 4 days