Bug 1119766

Summary: SELinux is preventing accounts-daemon from 'getattr' accesses on the file /etc/passwd.
Product: [Fedora] Fedora Reporter: Alexander Kurtakov <akurtako>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dominick.grift, dwalsh, lvrabec, mgrepl, mikhail.v.gavrilov, vondruch
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:416090ac85f115a4fdbc34d2e8d04ba95a71582db97000625da333ad11596389
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-15 22:39:58 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 Alexander Kurtakov 2014-07-15 13:10:38 UTC
Description of problem:
SELinux is preventing accounts-daemon from 'getattr' accesses on the file /etc/passwd.

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If you want to fix the label. 
/etc/passwd default label should be passwd_file_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /etc/passwd

*****  Plugin catchall (1.49 confidence) suggests   **************************

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

Additional Information:
Source Context                system_u:system_r:accountsd_t:s0
Target Context                system_u:object_r:tmpfs_t:s0
Target Objects                /etc/passwd [ file ]
Source                        accounts-daemon
Source Path                   accounts-daemon
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           setup-2.9.0-2.fc21.noarch
Policy RPM                    selinux-policy-3.13.1-63.fc21.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.16.0-0.rc4.git3.1.fc22.x86_64 #1
                              SMP Fri Jul 11 17:08:34 UTC 2014 x86_64 x86_64
Alert Count                   13
First Seen                    2014-07-15 15:32:31 EEST
Last Seen                     2014-07-15 16:09:18 EEST
Local ID                      d8528d5e-b71e-473e-949b-9f30308e0426

Raw Audit Messages
type=AVC msg=audit(1405429758.250:516): avc:  denied  { getattr } for  pid=624 comm="accounts-daemon" path="/etc/passwd" dev="dm-0" ino=131589 scontext=system_u:system_r:accountsd_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=1


Hash: accounts-daemon,accountsd_t,tmpfs_t,file,getattr

Version-Release number of selected component:
selinux-policy-3.13.1-63.fc21.noarch

Additional info:
reporter:       libreport-2.2.3
hashmarkername: setroubleshoot
kernel:         3.16.0-0.rc4.git3.1.fc22.x86_64
type:           libreport

Comment 1 Daniel Walsh 2014-07-15 22:39:58 UTC
Seems like your system is mislabled.  THere was a Rawhide/F21 bug that could have cuased this.

touch /.autorelabel; reboot

Should fix the problem

Comment 2 Daniel Walsh 2014-07-15 22:40:26 UTC
*** Bug 1119768 has been marked as a duplicate of this bug. ***

Comment 3 Miroslav Grepl 2014-07-16 07:54:26 UTC
This is caused by a systemd bug which should be fixed.

Comment 4 Miroslav Grepl 2014-07-16 07:54:36 UTC
*** Bug 1118986 has been marked as a duplicate of this bug. ***

Comment 5 Vít Ondruch 2014-07-16 08:00:35 UTC
(In reply to Miroslav Grepl from comment #3)
> This is caused by a systemd bug which should be fixed.

Out of curiosity, could you please give us some reference to this bug? Thanks.

Comment 6 Vít Ondruch 2019-08-13 13:31:36 UTC
Description of problem:
I was running mock:

~~~
$ rpm -q mock
mock-1.4.17-1.fc31.noarch
~~~

Version-Release number of selected component:
selinux-policy-3.14.4-29.fc31.noarch

Additional info:
reporter:       libreport-2.10.1
hashmarkername: setroubleshoot
kernel:         5.2.8-200.fc30.x86_64
type:           libreport