Bug 609962

Summary: SELinux is preventing /usr/libexec/gdm-session-worker "read write" access to /home/user
Product: Red Hat Enterprise Linux 6 Reporter: Lubos Kocman <lkocman>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: mgrepl
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-01 14:57:10 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 Lubos Kocman 2010-07-01 11:14:05 UTC
Summary:

SELinux is preventing /usr/libexec/gdm-session-worker "read write" access to
/home/lkocman.

Detailed Description:

[gdm-session-wor has a permissive type (xdm_t). This access was not denied.]

SELinux denied access requested by gdm-session-wor. /home/lkocman may be a
mislabeled. /home/lkocman default SELinux type is user_home_dir_t, but its
current type is home_root_t. Changing this file back to the default type, may
fix your problem.

File contexts can be assigned to a file in the following ways.

  * Files created in a directory receive the file context of the parent
    directory by default.
  * The SELinux policy might override the default label inherited from the
    parent directory by specifying a process running in context A which creates
    a file in a directory labeled B will instead create the file with label C.
    An example of this would be the dhcp client running with the dhclient_t type
    and creating a file in the directory /etc. This file would normally receive
    the etc_t type due to parental inheritance but instead the file is labeled
    with the net_conf_t type because the SELinux policy specifies this.
  * Users can change the file context on a file using tools such as chcon, or
    restorecon.

This file could have been mislabeled either by user error, or if an normally
confined application was run under the wrong domain.

However, this might also indicate a bug in SELinux because the file should not
have been labeled with this type.

If you believe this is a bug, please file a bug report against this package.

Allowing Access:

You can restore the default system context to this file by executing the
restorecon command. restorecon '/home/lkocman', if this file is a directory, you
can recursively restore using restorecon -R '/home/lkocman'.

Fix Command:

/sbin/restorecon '/home/lkocman'

Additional Information:

Source Context                system_u:system_r:xdm_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:home_root_t:s0
Target Objects                /home/lkocman [ dir ]
Source                        gdm-session-wor
Source Path                   /usr/libexec/gdm-session-worker
Port                          <Unknown>
Host                          dhcp-27-216.brq.redhat.com
Source RPM Packages           gdm-2.30.2-9.el6
Target RPM Packages           
Policy RPM                    selinux-policy-3.7.19-27.el6
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   restorecon
Host Name                     dhcp-27-216.brq.redhat.com
Platform                      Linux dhcp-27-216.brq.redhat.com
                              2.6.32-37.el6pcmring1.x86_64 #1 SMP Wed Jun 23
                              08:36:36 EDT 2010 x86_64 x86_64
Alert Count                   4
First Seen                    Wed 30 Jun 2010 11:08:24 AM CEST
Last Seen                     Thu 01 Jul 2010 09:19:23 AM CEST
Local ID                      6c85c516-2066-43f8-b906-ed2f08b8cdcc
Line Numbers                  

Raw Audit Messages            

node=dhcp-27-216.brq.redhat.com type=AVC msg=audit(1277968763.202:16): avc:  denied  { read write } for  pid=8976 comm="gdm-session-wor" name="lkocman" dev=dm-3 ino=258 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:home_root_t:s0 tclass=dir

node=dhcp-27-216.brq.redhat.com type=SYSCALL msg=audit(1277968763.202:16): arch=c000003e syscall=21 success=yes exit=68719476864 a0=776b60 a1=7 a2=20 a3=a0 items=0 ppid=8958 pid=8976 auid=500 uid=500 gid=100 euid=500 suid=500 fsuid=500 egid=100 sgid=100 fsgid=100 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)



Additional info:

bash-4.1$ ls -ladZ /home/lkocman
drwx------. lkocman users unconfined_u:object_r:home_root_t:s0 /home/lkocman

Comment 2 RHEL Program Management 2010-07-01 11:23:11 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 3 Miroslav Grepl 2010-07-01 14:57:10 UTC
Lubos,
execute

restorecon -R -v /home

Should fix. Not sure how it happened.