Bug 699671

Summary: SELinux is preventing /usr/libexec/gdm-session-worker from 'getattr' accesses on the file /home/sahutsd/.dmrc.
Product: [Fedora] Fedora Reporter: E. Dean Sahutske <lberns1>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 14CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:4849199c45413068f7398496ea57a4f13f9b5cb32b39e94ce0aeeab9c0e890f8
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-26 14:56:43 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 E. Dean Sahutske 2011-04-26 10:23:03 UTC
SELinux is preventing /usr/libexec/gdm-session-worker from 'getattr' accesses on the file /home/sahutsd/.dmrc.

*****  Plugin restorecon (82.4 confidence) suggests  *************************

If you want to fix the label. 
/home/sahutsd/.dmrc default label should be xdm_home_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /home/sahutsd/.dmrc

*****  Plugin file (7.05 confidence) suggests  *******************************

If you think this is caused by a badly mislabeled machine.
Then you need to fully relabel.
Do
touch /.autorelabel; reboot

*****  Plugin file (7.05 confidence) suggests  *******************************

If you think this is caused by a badly mislabeled machine.
Then you need to fully relabel.
Do
touch /.autorelabel; reboot

*****  Plugin catchall_labels (4.59 confidence) suggests  ********************

If you want to allow gdm-session-worker to have getattr access on the .dmrc file
Then you need to change the label on /home/sahutsd/.dmrc
Do
# semanage fcontext -a -t FILE_TYPE '/home/sahutsd/.dmrc'
where FILE_TYPE is one of the following: udev_tbl_t, user_home_t, pulseaudio_exec_t, gconf_etc_t, abrt_var_run_t, mount_exec_t, pam_exec_t, shell_exec_t, consolekit_log_t, krb5_home_t, proc_afs_t, var_lib_t, updpwd_exec_t, oddjob_mkhomedir_exec_t, xserver_log_t, dbusd_etc_t, xdm_tmp_t, user_home_t, sysctl_crypto_t, xserver_t, configfile, domain, userdomain, fusermount_exec_t, rpm_var_cache_t, faillog_t, lastlog_t, abrt_t, proc_net_t, lib_t, var_log_t, chkpwd_exec_t, policykit_reload_t, xdm_etc_t, xdm_log_t, gnome_home_type, hostname_exec_t, samba_var_t, abrt_helper_exec_t, initrc_var_run_t, pam_var_run_t, rpm_var_lib_t, xdm_var_lib_t, xdm_var_run_t, net_conf_t, init_exec_t, ld_so_t, anon_inodefs_t, gconf_home_t, sysctl_kernel_t, etc_runtime_t, openct_var_run_t, config_usr_t, textrel_shlib_t, user_cron_spool_t, alsa_exec_t, pcscd_var_run_t, consoletype_exec_t, xkb_var_lib_t, shutdown_exec_t, admin_home_t, rpm_script_tmp_t, xdm_rw_etc_t, accountsd_var_lib_t, xdm_exec_t, xdm_home_t, xdm_lock_t, pam_var_console_t, system_dbusd_var_lib_t, cgroup_t, rpm_tmp_t, policykit_auth_exec_t, bin_t, cert_t, selinux_config_t, lib_t, logfile, usr_t, var_t, wtmp_t, ld_so_cache_t, xserver_exec_t, default_context_t, pam_console_exec_t, noxattrfs, sssd_public_t, hwdata_t, locale_t, var_auth_t, dbusd_exec_t, user_tmp_t, user_fonts_t, user_tmpfs_t, etc_t, logfile, fonts_t, proc_t, sysfs_t, loadkeys_exec_t, xdm_t, xdm_dbusd_t, xdm_spool_t, fonts_cache_t, krb5_keytab_t, ssh_agent_exec_t, system_cronjob_var_lib_t, crack_db_t, ssh_home_t, policykit_var_lib_t, krb5_conf_t, user_tmp_t, xserver_tmpfs_t, alsa_etc_rw_t, iceauth_home_t, plymouth_exec_t, xauth_exec_t, xauth_home_t, sysctl_dev_t, sysctl_net_t, auth_cache_t, rpm_exec_t, xdm_tmpfs_t, security_t, file_context_t, shell_exec_t, xsession_exec_t, krb5_host_rcache_t, security_t. 
Then execute: 
restorecon -v '/home/sahutsd/.dmrc'


*****  Plugin catchall (1.31 confidence) suggests  ***************************

If you believe that gdm-session-worker should be allowed getattr access on the .dmrc 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:file_t:s0
Target Objects                /home/sahutsd/.dmrc [ file ]
Source                        gdm-session-wor
Source Path                   /usr/libexec/gdm-session-worker
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           gdm-2.32.1-2.fc14
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-37.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux chet 2.6.35.11-83.fc14.i686.PAE #1 SMP Mon
                              Feb 7 06:57:55 UTC 2011 i686 i686
Alert Count                   1
First Seen                    Sat 02 Apr 2011 07:52:10 PM EDT
Last Seen                     Sat 02 Apr 2011 07:52:10 PM EDT
Local ID                      f8343208-4d06-46af-b16d-f1e2d44b59c4

Raw Audit Messages
type=AVC msg=audit(1301788330.690:31453): avc:  denied  { getattr } for  pid=1993 comm="gdm-session-wor" path="/home/sahutsd/.dmrc" dev=dm-2 ino=390840 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:file_t:s0 tclass=file


type=SYSCALL msg=audit(1301788330.690:31453): arch=i386 syscall=stat64 success=no exit=EACCES a0=85ccc40 a1=bffaa38c a2=741ff4 a3=3 items=0 ppid=1971 pid=1993 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 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,file_t,file,getattr

audit2allow

#============= xdm_t ==============
allow xdm_t file_t:file getattr;

audit2allow -R

#============= xdm_t ==============
allow xdm_t file_t:file getattr;

Comment 1 Daniel Walsh 2011-04-26 14:56:43 UTC
Your homedir needs labeles added.

restorecon -R -v /home 

Should fix, if you just added a homedir without labels.   Otherwise if the whole system has file_t then  you need a full relabel

touch /.autorelabel; reboot

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

Comment 2 E. Dean Sahutske 2011-04-26 15:02:30 UTC
Thanks Daniel