Description of problem: machined cannot launch containers due Version-Release number of selected component (if applicable): 3.14.4 How reproducible: Very easily. Steps to Reproduce: 1. Create a new systemd-machined container if needed, e.g.: machinectl pull-raw --verify=no https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 centos 2. Try starting the machine, e.g. `machinectl start centos`. Actual results: machinectl fails with the following output: Job for systemd-nspawn failed because the control process exited with error code. See "systemctl status systemd-nspawn" and "journalctl -xe" for details. Expected results: The machine should start. Additional info: Here are the relevant lines from the journal: Oct 09 19:24:44 localhost.localdomain audit[859]: AVC avc: denied { search } for pid=859 comm="systemd-machine" name="5661" dev="proc" ino=82262 scontext=system_u:system_r:systemd_machined_t:s0 tcontext=system_u:system_r:unconfined_se> Oct 09 19:24:44 localhost.localdomain systemd-nspawn[5647]: Failed to register machine: Access denied Oct 09 19:24:44 localhost.localdomain systemd-nspawn[5647]: Parent died too early Oct 09 19:24:44 localhost.localdomain systemd[1]: systemd-nspawn: Main process exited, code=exited, status=1/FAILURE Once this denial is worked around via audit2allow, more appear: type=AVC msg=audit(1570667820.295:558): avc: denied { read } for pid=859 comm="systemd-machine" name="cgroup" dev="proc" ino=87639 scontext=system_u:system_r:systemd_machined_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=file permissive=0 type=AVC msg=audit(1570667892.124:591): avc: denied { open } for pid=859 comm="systemd-machine" path="/proc/6529/cgroup" dev="proc" ino=92371 scontext=system_u:system_r:systemd_machined_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=file permissive=0 The ending audit2allow-generated module that makes `machinectl start` work entirely is: module machined 1.0; require { type unconfined_service_t; type systemd_machined_t; class dir search; class file { open read }; } #============= systemd_machined_t ============== #!!!! This avc is allowed in the current policy allow systemd_machined_t unconfined_service_t:dir search; #!!!! This avc is allowed in the current policy allow systemd_machined_t unconfined_service_t:file read; allow systemd_machined_t unconfined_service_t:file open;
Hi Ryan, Could you please reproduce the scenario and attrach output of: # ps -efZ | grep unconfined_service_t Thanks, Lukas.
(In reply to Lukas Vrabec from comment #1) > Hi Ryan, > > Could you please reproduce the scenario and attrach output of: > > # ps -efZ | grep unconfined_service_t > > Thanks, > Lukas. There are no results other than the grep command itself. Note that machined works by starting a new systemd service in the background (systemd-nspawn@.service) to start the container, so it won't be running as it never actually gets to start.
Just did some more research into this, apparently the unconfined_service_t is actually systemd-nspawn. It's unlabeled so it ends up as unconfined_service_t, but machined doesn't have any permissions to check out unconfined_service_t?
Actually correction, it's sd-stubinit; since it's PID 1, machined probably inspects it to check the status of the container.
This package has changed maintainer in the Fedora. Reassigning to the new maintainer of this component.
This message is a reminder that Fedora 31 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '31'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 31 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
This still definitely applies to F33; the following is now required for machined to work: allow systemd_machined_t unconfined_service_t:dir search; allow systemd_machined_t unconfined_service_t:file { getattr ioctl open read };
I can confirm the same issue exists in Fedora 34 out of the box. I am able to successfully install the systemd-containers package, however, running a container through machinectl would fail with various errors until I worked through multiple SELinux policy adjustments (with the help of the selinux troubleshooter included in fedora server 34). I will include a copy of the SELinux policy adjustments I had to make to successfully run and shell into a systemd container managed through machinectl as soon as I can.
Created attachment 1821666 [details] SELinux Policy Changes for nspawn Comments also include the attribute changes that needed to be applied to folders under /var/lib/machines
I have uploaded the SELinux changes I had to make on Fedora 34 for nspawn to sucessfully run. Tagging need for review since issue is still occurring on Fedora 34.
This message is a reminder that Fedora 33 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '33'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 33 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 33 changed to end-of-life (EOL) status on 2021-11-30. Fedora 33 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days