Bug 1380300

Summary: SELinux is preventing systemd-sleep from 'create' accesses on the file state.
Product: [Fedora] Fedora Reporter: Alex Tucker <alex>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: high    
Version: 24CC: dominick.grift, dwalsh, jan.teichmann, joshua.rich, lvrabec, mgrepl, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:dec254d503744aca63457d80ddf92fd0a235e192d86c013b4cdcb5bc30b5cde9;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-07 21:53:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Alex Tucker 2016-09-29 08:50:48 UTC
Description of problem:
Putting laptop to sleep by closing the lid.
SELinux is preventing systemd-sleep from 'create' accesses on the file state.

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

If you believe that systemd-sleep should be allowed create access on the state 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 'systemd-sleep' --raw | audit2allow -M my-systemdsleep
# semodule -X 300 -i my-systemdsleep.pp

Additional Information:
Source Context                system_u:system_r:init_t:s0
Target Context                system_u:object_r:sysfs_t:s0
Target Objects                state [ file ]
Source                        systemd-sleep
Source Path                   systemd-sleep
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-191.16.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.7.4-200.fc24.x86_64 #1 SMP Thu
                              Sep 15 18:42:09 UTC 2016 x86_64 x86_64
Alert Count                   6
First Seen                    2016-09-08 22:16:32 BST
Last Seen                     2016-09-28 21:55:07 BST
Local ID                      c89c507e-ab7d-4623-a44e-d795afb681da

Raw Audit Messages
type=AVC msg=audit(1475096107.866:944): avc:  denied  { create } for  pid=2066 comm="systemd-sleep" name="state" scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=file permissive=0


Hash: systemd-sleep,init_t,sysfs_t,file,create

Version-Release number of selected component:
selinux-policy-3.13.1-191.16.fc24.noarch

Additional info:
reporter:       libreport-2.7.2
hashmarkername: setroubleshoot
kernel:         4.7.4-200.fc24.x86_64
type:           libreport

Comment 1 Joshua Rich 2016-10-19 01:50:25 UTC
Description of problem:
Should this be allowed?  I got this alert after waking my computer my sleep, having plugged in all more usual peripherals from being on the road.

Version-Release number of selected component:
selinux-policy-3.13.1-191.18.fc24.noarch

Additional info:
reporter:       libreport-2.7.2
hashmarkername: setroubleshoot
kernel:         4.7.7-200.fc24.x86_64
type:           libreport

Comment 2 Alex Tucker 2016-10-19 09:10:41 UTC
Appears to be duplicated in https://bugzilla.redhat.com/show_bug.cgi?id=1383872.  Having tried the semanage instructions in the comment https://bugzilla.redhat.com/show_bug.cgi?id=1383872#c1 from Miroslav, the AVC notices appear to have stopped.

Alex.

Comment 3 Lukas Vrabec 2016-11-07 21:53:07 UTC
Related to BZ #1383872 closing this as NOTABUG