Bug 1580125

Summary: SELinux is preventing snapd from 'map' accesses on the file /var/cache/snapd/commands.db.
Product: [Fedora] Fedora Reporter: Knut J BJuland <knutjbj>
Component: snapdAssignee: Zygmunt Krynicki <me>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: dwalsh, lvrabec, martin.gieseking, me, mgrepl, ngompa13, plautrba, pmoore, sudiplinuxchamp
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:479c048d3d1e3c269243cd77712a317c9d4cd648bb2861fd352f7dbeaa329780;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:21:50 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 Knut J BJuland 2018-05-20 12:36:26 UTC
Description of problem:
snap install spotify
SELinux is preventing snapd from 'map' accesses on the file /var/cache/snapd/commands.db.

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

If you believe that snapd should be allowed map access on the commands.db file 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/commands.db [ file ]
Source                        snapd
Source Path                   snapd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.1-24.fc28.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.16.8-300.fc28.x86_64 #1 SMP Wed
                              May 9 20:23:40 UTC 2018 x86_64 x86_64
Alert Count                   1
First Seen                    2018-05-20 14:35:03 CEST
Last Seen                     2018-05-20 14:35:03 CEST
Local ID                      7cc55229-b1b6-4447-8d05-951686440d78

Raw Audit Messages
type=AVC msg=audit(1526819703.295:573): avc:  denied  { map } for  pid=24159 comm="snapd" path="/var/cache/snapd/commands.db" dev="sdc4" ino=2229988 scontext=system_u:system_r:snappy_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=file permissive=1


Hash: snapd,snappy_t,var_t,file,map

Version-Release number of selected component:
selinux-policy-3.14.1-24.fc28.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.5
hashmarkername: setroubleshoot
kernel:         4.16.8-300.fc28.x86_64
type:           libreport

Potential duplicate: bug 1567933

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

Comment 2 Fedora Update System 2018-06-23 22:31:49 UTC
snapd-2.33.1-1.fc28 snapd-glib-1.41-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-07-01 22:21:50 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 4 Fedora Update System 2018-07-01 22:36:31 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.

Comment 5 sudip chatterjee 2018-07-25 07:11:49 UTC
Description of problem:
Installing span packages caused this exception. But no problem in daily usage.

Version-Release number of selected component:
selinux-policy-3.14.1-32.fc28.noarch

Additional info:
reporter:       libreport-2.9.5
hashmarkername: setroubleshoot
kernel:         4.17.6-200.fc28.x86_64
type:           libreport