Bug 673719

Summary: SELinux is preventing /usr/libexec/gdm-session-worker from 'create' accesses on the file .dmrc.Q2X3PV.
Product: [Fedora] Fedora Reporter: Eric Blake <eblake>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 14CC: dwalsh, javadieh.msd, mgrepl, sz.gruszczynski
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:cdf9eda1ef87f72e967a6dfeb80168f68e3ed3192f70af33cfa3592f3b08f828
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-02 08:29:55 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 Eric Blake 2011-01-30 04:37:45 UTC
SELinux is preventing /usr/libexec/gdm-session-worker from 'create' accesses on the file .dmrc.Q2X3PV.

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

If you believe that gdm-session-worker should be allowed create access on the .dmrc.Q2X3PV 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 gdm-session-wor /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:xdm_t:s0-s0:c0.c1023
Target Context                system_u:object_r:user_home_t:s0
Target Objects                .dmrc.Q2X3PV [ file ]
Source                        gdm-session-wor
Source Path                   /usr/libexec/gdm-session-worker
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           gdm-2.32.0-1.fc14
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-25.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.35.10-74.fc14.x86_64 #1 SMP Thu
                              Dec 23 16:04:50 UTC 2010 x86_64 x86_64
Alert Count                   2
First Seen                    Sat 29 Jan 2011 09:29:48 PM MST
Last Seen                     Sat 29 Jan 2011 09:35:56 PM MST
Local ID                      b3cb8fb1-5ecf-4625-89a5-6c32e66dcc94

Raw Audit Messages
type=AVC msg=audit(1296362156.124:24): avc:  denied  { create } for  pid=2515 comm="gdm-session-wor" name=".dmrc.Q2X3PV" scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:user_home_t:s0 tclass=file


type=SYSCALL msg=audit(1296362156.124:24): arch=x86_64 syscall=open success=no exit=EACCES a0=1bc8850 a1=c2 a2=1b6 a3=5858585858582e63 items=0 ppid=2491 pid=2515 auid=14986 uid=14986 gid=14986 euid=14986 suid=14986 fsuid=14986 egid=14986 sgid=14986 fsgid=14986 tty=(none) ses=1 comm=gdm-session-wor exe=/usr/libexec/gdm-session-worker subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 key=(null)

Hash: gdm-session-wor,xdm_t,user_home_t,file,create

audit2allow

#============= xdm_t ==============
allow xdm_t user_home_t:file create;

audit2allow -R

#============= xdm_t ==============
allow xdm_t user_home_t:file create;

Comment 1 Daniel Walsh 2011-02-01 22:52:48 UTC
Looks like somehow .dmrc file got created with the wrong label.

restorecon -R -v ~/.dmrc*

Any idea why this got create with the wrong label?  What is the path to your homedir and what is its label?

ls -lZd ~/

Comment 2 Eric Blake 2011-02-01 23:38:45 UTC
# ls -lZd . .dmrc*
drwxr-xr-x. eblake eblake unconfined_u:object_r:user_home_t:s0 .
-rw-r--r--. eblake eblake system_u:object_r:user_home_t:s0 .dmrc
# pwd
/home/remote/eblake
# cat /etc/selinux/targeted/contexts/files/file_contexts.subs 
/home /home/remote/
# matchpathcon /home/remote/eblake/.dmrc*
/home/remote/eblake/.dmrc	unconfined_u:object_r:user_home_t:s0

On further investigation, I'm wondering if I'm the victim of previous bad advice in bug 626258; because when I tried:

# semanage fcontext -a -e /home /home/remote

it swaps the order of the entries in /etc/selinux/targeted/contexts/files/file_contexts.subs.

Comment 3 Miroslav Grepl 2011-02-02 08:29:55 UTC
Yes,

# semanage fcontext -a -e /home /home/remote

is the correct command in this case.

Comment 4 Miroslav Grepl 2013-07-04 09:07:55 UTC
*** Bug 976997 has been marked as a duplicate of this bug. ***