Bug 1192726
| Summary: | RuntimeDirectory must honor SELinux filesystem labels | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Anthony Messina <amessina> |
| Component: | systemd | Assignee: | systemd-maint |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 21 | CC: | johannbg, jsynacek, lnykryn, msekleta, s, systemd-maint, vpavlin, zbyszek |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | systemd-216-24.fc21 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-04-02 15:37:49 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Fixed upstream in http://cgit.freedesktop.org/systemd/systemd/commit/?id=ca905b2fce. Should be easy enough to backport. systemd-216-23.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/systemd-216-23.fc21 Package systemd-216-24.fc21: * should fix your issue, * was pushed to the Fedora 21 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing systemd-216-24.fc21' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-4991/systemd-216-24.fc21 then log in and leave karma (feedback). systemd-216-24.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report. |
When updating some F21 systemd unit files to use RuntimeDirectory rather than tmpfiles.d, I came across the following issue: When using tmpfiles.d, directories are created with the proper SELinux file contexts. However, when using RuntimeDirectory within a *.service unit, the directories are created with system_u:object_r:init_var_run_t:s0 which generates AVCs similar to the following: type=AVC msg=audit(1423937941.998:14406): avc: denied { write } for pid=16392 comm="asterisk" name="asterisk" dev="tmpfs" ino=3804883 scontext=system_u:system_r:asterisk_t:s0 tcontext=system_u:object_r:init_var_run_t:s0 tclass=dir In this case, the current SELinux policy expects /run/asterisk to be labeled with system_u:object_r:asterisk_var_run_t:s0 Using: systemd-216-17.fc21.x86_64 selinux-policy-3.13.1-105.3.fc21.noarch # /etc/tmpfiles.d/asterisk.conf d /run/asterisk 0755 asterisk asterisk # /etc/systemd system/asterisk.service [Unit] Description=Asterisk PBX and telephony daemon After=network-online.target [Service] Type=simple Environment=HOME=/var/lib/asterisk WorkingDirectory=/var/lib/asterisk User=asterisk Group=asterisk ExecStart=/usr/sbin/asterisk -f -C /etc/asterisk/asterisk.conf ExecStop=/usr/sbin/asterisk -rx 'core stop now' ExecReload=/usr/sbin/asterisk -rx 'core reload' PrivateTmp=true RuntimeDirectory=asterisk RuntimeDirectoryMode=0755 [Install] WantedBy=multi-user.target