Description of problem: In a selinux-enabled system a mdadm raid1 array starts resynching after each reboot, because they are marked as not clean. If I run 'setenforce 0' before reboot, the array is successfully marked as clean and does not start being resynching after reboot. Version-Release number of selected component (if applicable): fedora 24 systemd-229-13.fc24.x86_64 selinux-policy-targeted-3.13.1-191.16.fc24.noarch selinux-policy-devel-3.13.1-191.16.fc24.noarch dracut-044-20.fc24.x86_64 mdadm-3.4-2.fc24.x86_64 How reproducible: Always Steps to Reproduce: 1. Install F24 with an intel imsm raid1 2. Reboot Actual results: raid1 starts resync Expected results: raid1 is clean Additional info: with setenforce0 I see in dmesg: -------------------------------------------------------------------------- [ 973.085764] audit: type=1400 audit(1474658067.814:485): avc: denied { write } for pid=25632 comm="mdadm" name="md127.sock" dev="tmpfs" ino=74281 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:mdadm_var_run_t:s0 tclass=sock_file permissive=1 ... [ 973.174343] audit: type=1400 audit(1474658067.903:486): avc: denied { rename } for pid=25634 comm="mdadm" name="map.new" dev="tmpfs" ino=79403 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:mdadm_var_run_t:s0 tclass=file permissive=1 -------------------------------------------------------------------------- md127.sock is the socket used for communication with mdmon process tat updates the metadata. If mdadm can not write to it, mdadm does not update metadata on that the array is clean The filename of .sock file may be different, so it shouldn't ba hardcoded in the policy.
This bug has been raised by the change https://github.com/fedora-selinux/selinux-policy/commit/015047e1d962173e3789af3fad86198a3b5e3ac2 Since this, the domain init_t does not more have rights to files in other domains. I don't know how to fix the security domain of mdadm: it is run by dracut from initramfs. Dracut is not ready now to support selinux labels for initramfs contents, so the context of mdadm does not trnsit from init_t to mdadm_t. But as a workaround adding these rules solved the problem for me: ----------------------------------------------------------------- allow init_t mdadm_var_run_t:file rename; allow init_t mdadm_var_run_t:sock_file { relabelto write }; ----------------------------------------------------------------- May they be added to raid.te of fedora-selinux/selinux-policy ?
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
Created attachment 1206498 [details] This module solves the problem The rules in the previous comment are not sufficient. Use ones from the file attached
Oleg, thanks for the fix. It seems to work.
The bug is not limited to only mdadm. LUKS and even the umount command fail: https://bugzilla.redhat.com/show_bug.cgi?id=1385432
This message is a reminder that Fedora 24 is nearing its end of life. Approximately 2 (two) weeks from now Fedora will stop maintaining and issuing updates for Fedora 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 '24'. 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 24 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 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 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.
Was this fixed?
The 'time based' close of this bug, without applying the patch, seems to block: https://github.com/dracutdevs/dracut/issues/342 it looks as though it may be an EASYFIX as there is a patch in hand
selinux-policy-3.13.1-283.26.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-a9711c96b2
selinux-policy-3.13.1-283.26.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-a9711c96b2
selinux-policy-3.13.1-283.26.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.