Bug 1520102

Summary: SELinux is preventing snapd from 'getattr' accesses on the file /proc/<pid>/stat.
Product: [Fedora] Fedora Reporter: Max <maxpatera>
Component: snapdAssignee: Zygmunt Krynicki <me>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: dwalsh, lvrabec, martin.gieseking, me, mgrepl, ngompa13, plautrba, pmoore, steffen
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:4df7704fd89418c1dc2d69e52be737c6dfbb38d077c40330a18ce30e876d9a4d;
Fixed In Version: snapd-2.32.4-1.fc28 snapd-2.32.4-1.fc26 snapd-2.32.4-1.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-17 00:20:38 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 Max 2017-12-03 00:53:28 UTC
Description of problem:
I am trying to install snap hello-world, but when I try, I get this error and the installation freezes.
SELinux is preventing snapd from 'getattr' accesses on the file /proc/<pid>/stat.

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

If you believe that snapd should be allowed getattr access on the stat 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                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Objects                /proc/<pid>/stat [ file ]
Source                        snapd
Source Path                   snapd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-283.16.fc27.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.13.13-300.fc27.x86_64 #1 SMP Wed
                              Nov 15 15:47:50 UTC 2017 x86_64 x86_64
Alert Count                   1
First Seen                    2017-12-02 16:48:49 PST
Last Seen                     2017-12-02 16:48:49 PST
Local ID                      31e7b6b8-9755-41c6-af9e-aaf3e317a720

Raw Audit Messages
type=AVC msg=audit(1512262129.547:2888): avc:  denied  { getattr } for  pid=1483 comm="snapd" path="/proc/1852/stat" dev="proc" ino=9668616 scontext=system_u:system_r:snappy_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=file permissive=1


Hash: snapd,snappy_t,unconfined_t,file,getattr

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

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

Comment 1 Lukas Vrabec 2017-12-11 16:29:22 UTC
This shoudl be fixed in snappy component.

Comment 2 Steffen Scheib 2018-02-08 11:23:25 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 3 Fedora Update System 2018-04-13 01:34:40 UTC
snapd-glib-1.39-1.fc28 snapd-2.32.4-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-4f5c007eb3

Comment 4 Fedora Update System 2018-04-13 01:37:22 UTC
snapd-glib-1.39-1.fc27 snapd-2.32.4-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-dd3f9d4285

Comment 5 Fedora Update System 2018-04-13 01:39:50 UTC
snapd-glib-1.39-1.fc26 snapd-2.32.4-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-eed204f119

Comment 6 Fedora Update System 2018-04-15 02:24:26 UTC
snapd-2.32.4-1.fc28, snapd-glib-1.39-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-4f5c007eb3

Comment 7 Fedora Update System 2018-04-15 16:21:33 UTC
snapd-2.32.4-1.fc27, snapd-glib-1.39-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-dd3f9d4285

Comment 8 Fedora Update System 2018-04-15 21:43:56 UTC
snapd-2.32.4-1.fc26, snapd-glib-1.39-1.fc26 has been pushed to the Fedora 26 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-eed204f119

Comment 9 Fedora Update System 2018-04-17 00:20:38 UTC
snapd-2.32.4-1.fc28, snapd-glib-1.39-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 10 Fedora Update System 2018-04-27 22:59:14 UTC
snapd-2.32.4-1.fc26, snapd-glib-1.39-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2018-04-27 23:37:58 UTC
snapd-2.32.4-1.fc27, snapd-glib-1.39-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.