Bug 1551738 - snapper causes selinux denials after dnf update
Summary: snapper causes selinux denials after dnf update
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-05 21:08 UTC by Nathaniel McCallum
Modified: 2019-11-27 19:22 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-27 19:22:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openSUSE snapper issues 396 0 None None None Never

Description Nathaniel McCallum 2018-03-05 21:08:42 UTC
The log contains this:

type=AVC msg=audit(1520283864.179:516): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/etc/NetworkManager/dispatcher.d/no-wait.d/10-ifcfg-rh-routes.sh" dev="nvme0n1p5" ino=184919 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:NetworkManager_initrc_exec_t:s0 tclass=lnk_file permissive=1
type=AVC msg=audit(1520283864.239:519): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/etc/firewalld/firewalld.conf" dev="nvme0n1p5" ino=581 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:firewalld_etc_rw_t:s0 tclass=lnk_file permissive=1
type=AVC msg=audit(1520283864.249:520): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/etc/gdm/Xsession" dev="nvme0n1p5" ino=237758 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:xdm_etc_t:s0 tclass=lnk_file permissive=1
type=AVC msg=audit(1520283864.254:521): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/etc/httpd/logs" dev="nvme0n1p5" ino=215993 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:httpd_log_t:s0 tclass=lnk_file permissive=1
type=AVC msg=audit(1520283864.254:522): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/etc/httpd/modules" dev="nvme0n1p5" ino=215994 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:httpd_modules_t:s0 tclass=lnk_file permissive=1
type=AVC msg=audit(1520283864.254:523): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/etc/httpd/run" dev="nvme0n1p5" ino=215995 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:httpd_config_t:s0 tclass=lnk_file permissive=1
type=AVC msg=audit(1520283864.298:524): avc:  denied  { fowner } for  pid=16026 comm="snapperd" capability=3  scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tclass=capability permissive=1
type=AVC msg=audit(1520283864.330:525): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/etc/systemd/system/basic.target.wants/dnf-makecache.timer" dev="nvme0n1p5" ino=1634 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:systemd_unit_file_t:s0 tclass=lnk_file permissive=1
type=AVC msg=audit(1520283864.331:526): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/etc/systemd/system/default.target" dev="nvme0n1p5" ino=158716 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:systemd_unit_file_t:s0 tclass=lnk_file permissive=1
type=AVC msg=audit(1520283865.066:531): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/usr/lib/modules/4.15.4-300.fc27.x86_64/build" dev="nvme0n1p5" ino=196118 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:modules_object_t:s0 tclass=lnk_file permissive=1
type=AVC msg=audit(1520283866.920:532): avc:  denied  { fowner } for  pid=16026 comm="snapperd" capability=3  scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tclass=capability permissive=1
type=AVC msg=audit(1520283867.212:533): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/usr/share/cups/charsets/pdf.utf-8" dev="nvme0n1p5" ino=187662 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:cupsd_etc_t:s0 tclass=lnk_file permissive=1
type=AVC msg=audit(1520283876.038:534): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/var/cache/PackageKit/27/metadata/alunux-budgie-desktop-stable/gpgdir/S.gpg-agent" dev="nvme0n1p5" ino=356678 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:rpm_var_cache_t:s0 tclass=sock_file permissive=1
type=AVC msg=audit(1520283876.038:535): avc:  denied  { read } for  pid=16026 comm="snapperd" name="S.gpg-agent" dev="nvme0n1p5" ino=356678 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:rpm_var_cache_t:s0 tclass=sock_file permissive=1
type=AVC msg=audit(1520283876.038:536): avc:  denied  { open } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/var/cache/PackageKit/27/metadata/alunux-budgie-desktop-stable/gpgdir/S.gpg-agent" dev="nvme0n1p5" ino=356678 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:rpm_var_cache_t:s0 tclass=sock_file permissive=1
type=AVC msg=audit(1520283876.127:537): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/var/cache/dnf/fedora-cisco-openh264-94af0d6c80009071/pubring/S.gpg-agent" dev="nvme0n1p5" ino=275102 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:rpm_var_cache_t:s0 tclass=sock_file permissive=1
type=AVC msg=audit(1520283876.127:538): avc:  denied  { read } for  pid=16026 comm="snapperd" name="S.gpg-agent" dev="nvme0n1p5" ino=275102 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:rpm_var_cache_t:s0 tclass=sock_file permissive=1
type=AVC msg=audit(1520283876.127:539): avc:  denied  { open } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/var/cache/dnf/fedora-cisco-openh264-94af0d6c80009071/pubring/S.gpg-agent" dev="nvme0n1p5" ino=275102 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:rpm_var_cache_t:s0 tclass=sock_file permissive=1
type=AVC msg=audit(1520283876.168:540): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/var/lib/dbus/machine-id" dev="nvme0n1p5" ino=149261 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:system_dbusd_var_lib_t:s0 tclass=lnk_file permissive=1
type=AVC msg=audit(1520283876.756:541): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/var/lib/gssproxy/default.sock" dev="nvme0n1p5" ino=459245 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:gssproxy_var_lib_t:s0 tclass=sock_file permissive=1
type=AVC msg=audit(1520283876.756:542): avc:  denied  { read } for  pid=16026 comm="snapperd" name="default.sock" dev="nvme0n1p5" ino=459245 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:gssproxy_var_lib_t:s0 tclass=sock_file permissive=1
type=AVC msg=audit(1520283876.756:543): avc:  denied  { open } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/var/lib/gssproxy/default.sock" dev="nvme0n1p5" ino=459245 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:gssproxy_var_lib_t:s0 tclass=sock_file permissive=1
type=AVC msg=audit(1520283876.892:544): avc:  denied  { read } for  pid=16026 comm="snapperd" name="nss" dev="nvme0n1p5" ino=459273 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sssd_var_lib_t:s0 tclass=sock_file permissive=1
type=AVC msg=audit(1520283876.896:545): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/var/lock" dev="nvme0n1p5" ino=148873 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_lock_t:s0 tclass=lnk_file permissive=1
type=AVC msg=audit(1520283876.902:546): avc:  denied  { getattr } for  pid=16026 comm="snapperd" path="/.snapshots/103/snapshot/var/mail" dev="nvme0n1p5" ino=148874 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:mail_spool_t:s0 tclass=lnk_file permissive=1
type=AVC msg=audit(1520283876.938:547): avc:  denied  { fowner } for  pid=16026 comm="snapperd" capability=3  scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tclass=capability permissive=1


audit2allow gives me this:

#============= snapperd_t ==============
allow snapperd_t NetworkManager_initrc_exec_t:lnk_file getattr;
allow snapperd_t cupsd_etc_t:lnk_file getattr;
allow snapperd_t firewalld_etc_rw_t:lnk_file getattr;
allow snapperd_t gssproxy_var_lib_t:sock_file { getattr open read };
allow snapperd_t httpd_config_t:lnk_file getattr;
allow snapperd_t httpd_log_t:lnk_file getattr;
allow snapperd_t httpd_modules_t:lnk_file getattr;
allow snapperd_t mail_spool_t:lnk_file getattr;
allow snapperd_t modules_object_t:lnk_file getattr;
allow snapperd_t rpm_var_cache_t:sock_file { getattr open read };
allow snapperd_t self:capability fowner;
allow snapperd_t sssd_var_lib_t:sock_file read;
allow snapperd_t system_dbusd_var_lib_t:lnk_file getattr;
allow snapperd_t systemd_unit_file_t:lnk_file getattr;
allow snapperd_t var_lock_t:lnk_file getattr;
allow snapperd_t xdm_etc_t:lnk_file getattr;

Is it really correct for snapperd to have access to all of these files? If not, we need to fix snapperd. Otherwise, we need to update the selinux policy.

Comment 1 Nathaniel McCallum 2018-03-08 16:08:10 UTC
It basically seems like snapper should have access to getattr on everything. But I'm still not sure why it is attempting to open() and read() on sockets.

Comment 2 Fedora Update System 2018-03-12 18:12:07 UTC
selinux-policy-3.13.1-283.28.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-32ebae3424

Comment 3 Fedora Update System 2018-03-12 18:18:54 UTC
selinux-policy-3.13.1-283.28.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-32ebae3424

Comment 4 Fedora Update System 2018-03-14 01:35:32 UTC
selinux-policy-3.13.1-283.28.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-32ebae3424

Comment 5 Fedora Update System 2018-03-20 18:17:02 UTC
selinux-policy-3.13.1-283.28.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 6 Nathaniel McCallum 2018-03-20 21:13:19 UTC
This needs to be fixed on Fedora 28 and rawhide too.

Comment 7 Jan Kurik 2018-08-14 11:07:46 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 8 Ben Cotton 2019-10-31 20:44:54 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
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 '29'.

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 29 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 9 Ben Cotton 2019-11-27 19:22:19 UTC
Fedora 29 changed to end-of-life (EOL) status on 2019-11-26. Fedora 29 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.


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