Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1759554 - Blocking the D-Bus autostart of fwupd on fresh installs [NEEDINFO]
Summary: Blocking the D-Bus autostart of fwupd on fresh installs
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 34
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Richard Fiľo
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-08 13:34 UTC by Richard Hughes
Modified: 2021-02-09 16:15 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-24 20:12:00 UTC
Type: Bug
Embargoed:
zpytela: needinfo? (rfilo)


Attachments (Terms of Use)

Description Richard Hughes 2019-10-08 13:34:28 UTC
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.

Comment 1 Richard Fiľo 2019-10-11 11:07:02 UTC
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.

Comment 2 Richard Fiľo 2019-11-22 15:11:20 UTC
From the perspective of SELinux policy is not a bug.

Comment 3 Lennart Poettering 2020-11-02 15:35:54 UTC
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?

Comment 4 Zdenek Pytela 2020-11-02 15:56:52 UTC
Richard,

Will you be able to review the new information in this bz?

Comment 5 Richard Hughes 2020-11-02 16:05:34 UTC
Well, /usr/lib/systemd/system/fwupd.service lists CacheDirectory=fwupd so I did rather expect it to work...

Comment 6 Ben Cotton 2020-11-03 16:53:44 UTC
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.

Comment 7 Ben Cotton 2020-11-24 20:12:00 UTC
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.

Comment 8 Timothée Ravier 2020-11-25 14:41:54 UTC
I think this is a valid bug. Re-opening against Rawhide and I will try to look at it.

Comment 9 Milos Malik 2020-12-08 20:13:40 UTC
# 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 
----

Comment 10 Ben Cotton 2021-02-09 16:15:22 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.


Note You need to log in before you can comment on or make changes to this bug.