Bug 1529997

Summary: SELinux is preventing snapd from 'read' accesses on the directory /var/cache/snapd. Preventing a lot of accesses from snapd.
Product: [Fedora] Fedora Reporter: Leonardo Avellar <leonardoggavellar>
Component: snapdAssignee: Zygmunt Krynicki <me>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: alexanderfunkner, dwalsh, lvrabec, me, mgrepl, mohos.nas, ngompa13, plautrba, pmoore, steffen
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:02b29a12013f7dff5f9aeec64aaae99e641a9b0ccf3baa7b3a0b59fd14eb9fe2;VARIANT_ID=workstation;
Fixed In Version: snapd-2.33.1-1.fc27 snapd-2.33.1-1.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-01 22:22:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Leonardo Avellar 2017-12-31 19:00:59 UTC
Description of problem:
Was trying to update my system and the snapd package popped on SELinux Troubleshooter
SELinux is preventing snapd from 'read' accesses on the directory /var/cache/snapd.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that snapd should be allowed read access on the snapd directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'snapd' --raw | audit2allow -M my-snapd
# semodule -X 300 -i my-snapd.pp

Additional Information:
Source Context                system_u:system_r:snappy_t:s0
Target Context                system_u:object_r:var_t:s0
Target Objects                /var/cache/snapd [ dir ]
Source                        snapd
Source Path                   snapd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           snapd-2.29.4-3.fc27.x86_64
Policy RPM                    selinux-policy-3.13.1-283.17.fc27.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.14.8-300.fc27.x86_64 #1 SMP Wed
                              Dec 20 19:00:18 UTC 2017 x86_64 x86_64
Alert Count                   1
First Seen                    2017-12-31 16:48:39 -02
Last Seen                     2017-12-31 16:48:39 -02
Local ID                      2f8871de-ba24-449d-9464-7d352ce517a0

Raw Audit Messages
type=AVC msg=audit(1514746119.317:612): avc:  denied  { read } for  pid=7295 comm="snapd" name="snapd" dev="dm-0" ino=4334865 scontext=system_u:system_r:snappy_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=dir permissive=1


Hash: snapd,snappy_t,var_t,dir,read

Version-Release number of selected component:
selinux-policy-3.13.1-283.17.fc27.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.3
hashmarkername: setroubleshoot
kernel:         4.14.8-300.fc27.x86_64
type:           libreport

Comment 1 Steffen Scheib 2018-02-08 11:03:14 UTC
Description of problem:
Installed snapd (sudo dnf install snapd). During the installation process several SELinux denials are raised

Version-Release number of selected component:
selinux-policy-3.13.1-283.24.fc27.noarch

Additional info:
reporter:       libreport-2.9.3
hashmarkername: setroubleshoot
kernel:         4.14.16-300.fc27.x86_64
type:           libreport

Comment 2 Fedora Update System 2018-06-22 15:03:06 UTC
snapd-glib-1.41-1.fc28 snapd-2.33.1-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-942eec912c

Comment 3 Fedora Update System 2018-06-22 15:04:18 UTC
snapd-glib-1.41-1.fc27 snapd-2.33.1-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-1330056acb

Comment 4 Fedora Update System 2018-06-23 18:55:35 UTC
snapd-2.33.1-1.fc27, snapd-glib-1.41-1.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-1330056acb

Comment 5 Fedora Update System 2018-06-23 21:21:01 UTC
snapd-2.33.1-1.fc28, snapd-glib-1.41-1.fc28 has been pushed to the Fedora 28 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-942eec912c

Comment 6 Fedora Update System 2018-07-01 22:22:21 UTC
snapd-2.33.1-1.fc27, snapd-glib-1.41-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2018-07-01 22:35:20 UTC
snapd-2.33.1-1.fc28, snapd-glib-1.41-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.