Description of problem: type=AVC msg=audit(1570055823.561:216): avc: denied { create } for pid=1942 comm="(fwupd)" name="fwupd" scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=dir permissive=0 Version-Release number of selected component (if applicable): selinux-policy-3.14.4-36.fc31 How reproducible: Always on a freshly installed system, rather than a system upgraded from F30. Steps to Reproduce: 1. Install F31 beta 2. Observe failure to start fwupd Expected results: I would think that systemd should be allowed to create /var/cache/fwupd for fwupd. Additional info: Although we can workaround this issue by creating and owning the directory in fwupd, I think it's still valid to do "rm -rf /var/cache/*" and have a working system -- it seems a bad idea to encode a known GOTCHA for the poor user who is probably just trying to make their system boot after / ran out of space.
Fix is reinstall fwupd package or you can make directory /var/cache/fwupd/ and start fwupd. It will not be fixed in SELinux policy package. From the perspective of SELinux policy is very powerful allow systemd create directories labeled var_t.
From the perspective of SELinux policy is not a bug.
We have CacheDirectory= and tmpfiles.d/ precisely to make stuff in /var/cache/ non-essential so that it can be flushed out and be recreated automatically on next service start or at reboot. If Selinux maintainers intend to break that, that would suck massively. We also have "systemctl clean --what=cache foobar.service" has high-level, user-friendly operation to flush out the cache dirs. Please don't tell me that selinux breaks that too?
Richard, Will you be able to review the new information in this bz?
Well, /usr/lib/systemd/system/fwupd.service lists CacheDirectory=fwupd so I did rather expect it to work...
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.
I think this is a valid bug. Re-opening against Rawhide and I will try to look at it.
# rpm -qa selinux-policy\* fwupd\* | sort fwupd-1.5.2-1.fc33.x86_64 fwupd-plugin-flashrom-1.5.2-1.fc33.x86_64 fwupd-plugin-modem-manager-1.5.2-1.fc33.x86_64 selinux-policy-3.14.6-30.fc33.noarch selinux-policy-devel-3.14.6-30.fc33.noarch selinux-policy-minimum-3.14.6-30.fc33.noarch selinux-policy-mls-3.14.6-30.fc33.noarch selinux-policy-sandbox-3.14.6-30.fc33.noarch selinux-policy-targeted-3.14.6-30.fc33.noarch # grep -i CacheDir /usr/lib/systemd/system/*.service /usr/lib/systemd/system/fwupd-refresh.service:CacheDirectory=fwupdmgr /usr/lib/systemd/system/fwupd.service:CacheDirectory=fwupd /usr/lib/systemd/system/gssproxy.service:Environment=KRB5RCACHEDIR=/var/lib/gssproxy/rcache /usr/lib/systemd/system/osbuild-composer.service:CacheDirectory=osbuild-composer /usr/lib/systemd/system/osbuild-remote-worker@.service:CacheDirectory=osbuild-worker /usr/lib/systemd/system/osbuild-worker@.service:CacheDirectory=osbuild-worker # systemctl clean --what=cache fwupd-refresh.service # systemctl clean --what=cache fwupd.service ---- type=PROCTITLE msg=audit(12/08/2020 21:09:36.651:3275) : proctitle=(sd-rmrf) type=PATH msg=audit(12/08/2020 21:09:36.651:3275) : item=1 name=/var/cache/private/fwupdmgr inode=295187 dev=fc:02 mode=dir,755 ouid=unknown(62803) ogid=unknown(62803) rdev=00:00 obj=system_u:object_r:var_t:s0 nametype=DELETE cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=PATH msg=audit(12/08/2020 21:09:36.651:3275) : item=0 name=/var/cache/private/ inode=265075 dev=fc:02 mode=dir,700 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:var_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=CWD msg=audit(12/08/2020 21:09:36.651:3275) : cwd=/ type=SYSCALL msg=audit(12/08/2020 21:09:36.651:3275) : arch=x86_64 syscall=rmdir success=no exit=EACCES(Permission denied) a0=0x562975bcbbb0 a1=0x0 a2=0x7fd21283fa60 a3=0x8 items=2 ppid=1 pid=78242 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=(sd-rmrf) exe=/usr/lib/systemd/systemd subj=system_u:system_r:init_t:s0 key=(null) type=AVC msg=audit(12/08/2020 21:09:36.651:3275) : avc: denied { rmdir } for pid=78242 comm=(sd-rmrf) name=fwupdmgr dev="vda2" ino=295187 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=dir permissive=0 ---- type=PROCTITLE msg=audit(12/08/2020 21:09:42.860:3279) : proctitle=(sd-rmrf) type=PATH msg=audit(12/08/2020 21:09:42.860:3279) : item=1 name=quirks.xmlb inode=265342 dev=fc:02 mode=file,644 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:fwupd_cache_t:s0 nametype=DELETE cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=PATH msg=audit(12/08/2020 21:09:42.860:3279) : item=0 name=/ inode=286745 dev=fc:02 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:fwupd_cache_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=CWD msg=audit(12/08/2020 21:09:42.860:3279) : cwd=/ type=SYSCALL msg=audit(12/08/2020 21:09:42.860:3279) : arch=x86_64 syscall=unlinkat success=no exit=EACCES(Permission denied) a0=0x16 a1=0x562975a23d0b a2=0x0 a3=0x8 items=2 ppid=1 pid=78256 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=(sd-rmrf) exe=/usr/lib/systemd/systemd subj=system_u:system_r:init_t:s0 key=(null) type=AVC msg=audit(12/08/2020 21:09:42.860:3279) : avc: denied { remove_name } for pid=78256 comm=(sd-rmrf) name=quirks.xmlb dev="vda2" ino=265342 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:fwupd_cache_t:s0 tclass=dir permissive=0 ---- type=PROCTITLE msg=audit(12/08/2020 21:09:42.860:3280) : proctitle=(sd-rmrf) type=PATH msg=audit(12/08/2020 21:09:42.860:3280) : item=1 name=metainfo.xmlb inode=265330 dev=fc:02 mode=file,644 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:fwupd_cache_t:s0 nametype=DELETE cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=PATH msg=audit(12/08/2020 21:09:42.860:3280) : item=0 name=/ inode=286745 dev=fc:02 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:fwupd_cache_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=CWD msg=audit(12/08/2020 21:09:42.860:3280) : cwd=/ type=SYSCALL msg=audit(12/08/2020 21:09:42.860:3280) : arch=x86_64 syscall=unlinkat success=no exit=EACCES(Permission denied) a0=0x16 a1=0x562975a23d43 a2=0x0 a3=0x8 items=2 ppid=1 pid=78256 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=(sd-rmrf) exe=/usr/lib/systemd/systemd subj=system_u:system_r:init_t:s0 key=(null) type=AVC msg=audit(12/08/2020 21:09:42.860:3280) : avc: denied { remove_name } for pid=78256 comm=(sd-rmrf) name=metainfo.xmlb dev="vda2" ino=265330 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:fwupd_cache_t:s0 tclass=dir permissive=0 ---- type=PROCTITLE msg=audit(12/08/2020 21:09:42.860:3281) : proctitle=(sd-rmrf) type=PATH msg=audit(12/08/2020 21:09:42.860:3281) : item=1 name=metadata.xmlb inode=265345 dev=fc:02 mode=file,644 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:fwupd_cache_t:s0 nametype=DELETE cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=PATH msg=audit(12/08/2020 21:09:42.860:3281) : item=0 name=/ inode=286745 dev=fc:02 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:fwupd_cache_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=CWD msg=audit(12/08/2020 21:09:42.860:3281) : cwd=/ type=SYSCALL msg=audit(12/08/2020 21:09:42.860:3281) : arch=x86_64 syscall=unlinkat success=no exit=EACCES(Permission denied) a0=0x16 a1=0x562975a23d6b a2=0x0 a3=0x8 items=2 ppid=1 pid=78256 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=(sd-rmrf) exe=/usr/lib/systemd/systemd subj=system_u:system_r:init_t:s0 key=(null) type=AVC msg=audit(12/08/2020 21:09:42.860:3281) : avc: denied { remove_name } for pid=78256 comm=(sd-rmrf) name=metadata.xmlb dev="vda2" ino=265345 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:fwupd_cache_t:s0 tclass=dir permissive=0 ---- type=PROCTITLE msg=audit(12/08/2020 21:09:42.860:3282) : proctitle=(sd-rmrf) type=PATH msg=audit(12/08/2020 21:09:42.860:3282) : item=1 name=/var/cache/fwupd inode=286745 dev=fc:02 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:fwupd_cache_t:s0 nametype=DELETE cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=PATH msg=audit(12/08/2020 21:09:42.860:3282) : item=0 name=/var/cache/ inode=262569 dev=fc:02 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:var_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=CWD msg=audit(12/08/2020 21:09:42.860:3282) : cwd=/ type=SYSCALL msg=audit(12/08/2020 21:09:42.860:3282) : arch=x86_64 syscall=rmdir success=no exit=EACCES(Permission denied) a0=0x562975c74190 a1=0x0 a2=0x7fd21283fa60 a3=0x8 items=2 ppid=1 pid=78256 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=(sd-rmrf) exe=/usr/lib/systemd/systemd subj=system_u:system_r:init_t:s0 key=(null) type=AVC msg=audit(12/08/2020 21:09:42.860:3282) : avc: denied { rmdir } for pid=78256 comm=(sd-rmrf) name=fwupd dev="vda2" ino=286745 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:fwupd_cache_t:s0 tclass=dir permissive=0 ----
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle. Changing version to 34.
PR:https://github.com/fedora-selinux/selinux-policy/pull/839
Hi guys, I tested systemctl start fwupd.service on F34 during first start and also after cleaning cache and I didn't find any AVC's denials and dir was created properly. So I made PR only on second issue, that was discussed here. Patrik
FEDORA-2021-ad4033a9b0 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-ad4033a9b0
FEDORA-2021-ad4033a9b0 has been pushed to the Fedora 34 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-ad4033a9b0` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-ad4033a9b0 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-ad4033a9b0 has been pushed to the Fedora 34 stable repository. If problem still persists, please make note of it in this bug report.
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days