Bug 1309896

Summary: SELinux is preventing systemd-logind from 'setattr' accesses on the directory inhibit.
Product: [Fedora] Fedora Reporter: Joachim Frieben <jfrieben>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:ff2eb3df0d352877bb4c126a521f5b7d25d8b1182ddfb2cbb31544db9668b25e;VARIANT_ID=workstation;
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-19 10:36:18 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 Joachim Frieben 2016-02-18 22:25:39 UTC
Description of problem:
SELinux is preventing systemd-logind from 'setattr' accesses on the directory inhibit.

*****  Plugin catchall_labels (83.8 confidence) suggests   *******************

If you want to allow systemd-logind to have setattr access on the inhibit directory
Then you need to change the label on inhibit
Do
# semanage fcontext -a -t FILE_TYPE 'inhibit'
where FILE_TYPE is one of the following: abrt_var_cache_t, cgroup_t, config_home_t, fusefs_t, gkeyringd_tmp_t, gstreamer_home_t, kdbusfs_t, mozilla_plugin_tmp_t, mozilla_plugin_tmpfs_t, systemd_logind_inhibit_var_run_t, systemd_logind_sessions_t, systemd_logind_var_lib_t, systemd_logind_var_run_t, user_tmp_t, var_auth_t. 
Then execute: 
restorecon -v 'inhibit'


*****  Plugin catchall (17.1 confidence) suggests   **************************

If you believe that systemd-logind should be allowed setattr access on the inhibit 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:
# grep systemd-logind /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:systemd_logind_t:s0
Target Context                system_u:object_r:default_t:s0
Target Objects                inhibit [ dir ]
Source                        systemd-logind
Source Path                   systemd-logind
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-171.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 4.5.0-0.rc4.git1.2.fc24.x86_64 #1
                              SMP Wed Feb 17 16:11:54 UTC 2016 x86_64 x86_64
Alert Count                   2
First Seen                    2016-02-18 22:44:48 CET
Last Seen                     2016-02-18 23:21:20 CET
Local ID                      16a08f17-6874-44ba-b52a-71c63965f256

Raw Audit Messages
type=AVC msg=audit(1455834080.383:167): avc:  denied  { setattr } for  pid=750 comm="systemd-logind" name="inhibit" dev="tmpfs" ino=20504 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:object_r:default_t:s0 tclass=dir permissive=1


Hash: systemd-logind,systemd_logind_t,default_t,dir,setattr

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

Additional info:
reporter:       libreport-2.6.4
hashmarkername: setroubleshoot
kernel:         4.5.0-0.rc4.git1.2.fc24.x86_64
type:           libreport

Comment 1 Joachim Frieben 2016-02-19 08:25:51 UTC
Issue is absent after fully relabeling the file system. However, after a fresh network install from the Fedora development tree in a virtual machine like in this case, this should not be necessary - an anaconda issue? Maybe a full relabeling should be triggered by anaconda after install.

Comment 2 Miroslav Grepl 2016-02-19 10:36:18 UTC

*** This bug has been marked as a duplicate of bug 1308771 ***