Bug 710764

Summary: SELinux is preventing /usr/libexec/gdm-session-worker from read, append access on the file /space/home/schulze/.xsession-errors.
Product: [Fedora] Fedora Reporter: Markus Schulze <ms>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:ebf8dfafedf435b3e2ae43a70a88bc467c13f06cacf4104757b025b373ed41e7
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-05 07:21:54 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 Markus Schulze 2011-06-04 16:43:46 UTC
SELinux is preventing /usr/libexec/gdm-session-worker from read, append access on the file /space/home/schulze/.xsession-errors.

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

If you want to allow gdm-session-worker to have read append access on the .xsession-errors file
Then you need to change the label on /space/home/schulze/.xsession-errors
Do
# semanage fcontext -a -t FILE_TYPE '/space/home/schulze/.xsession-errors'
where FILE_TYPE is one of the following: xdm_tmp_t, faillog_t, lastlog_t, xdm_log_t, gnome_home_type, initrc_var_run_t, pam_var_run_t, xdm_var_lib_t, xdm_var_run_t, etc_runtime_t, anon_inodefs_t, gconf_home_t, pcscd_var_run_t, xkb_var_lib_t, xdm_rw_etc_t, xdm_home_t, xdm_lock_t, pam_var_console_t, user_cron_spool_t, cgroup_t, wtmp_t, locale_t, var_auth_t, sysfs_t, xdm_t, user_fonts_t, user_tmpfs_t, xdm_spool_t, fonts_cache_t, user_tmp_t, xserver_tmpfs_t, xauth_home_t, auth_cache_t, xdm_tmpfs_t, security_t, xserver_log_t, proc_afs_t, krb5_host_rcache_t, security_t. 
Then execute: 
restorecon -v '/space/home/schulze/.xsession-errors'


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

If you believe that gdm-session-worker should be allowed read append access on the .xsession-errors 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:default_t:s0
Target Objects                /space/home/schulze/.xsession-errors [ file ]
Source                        gdm-session-wor
Source Path                   /usr/libexec/gdm-session-worker
Port                          <Unbekannt>
Host                          (removed)
Source RPM Packages           gdm-3.0.0-3.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-26.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.6-27.fc15.i686 #1 SMP Sun May
                              15 17:57:13 UTC 2011 i686 i686
Alert Count                   3
First Seen                    Fr 03 Jun 2011 21:42:47 CEST
Last Seen                     Sa 04 Jun 2011 16:42:37 CEST
Local ID                      49b618a7-12d3-4589-b07a-640671b3a8d1

Raw Audit Messages
type=AVC msg=audit(1307198557.339:56): avc:  denied  { read append } for  pid=1677 comm="gdm-session-wor" name=".xsession-errors" dev=sdb1 ino=29147228 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:default_t:s0 tclass=file


type=SYSCALL msg=audit(1307198557.339:56): arch=i386 syscall=open success=no exit=EACCES a0=9d17098 a1=442 a2=180 a3=9d17080 items=0 ppid=1547 pid=1677 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,default_t,file,read,append

audit2allow

#============= xdm_t ==============
allow xdm_t default_t:file { read append };

audit2allow -R

#============= xdm_t ==============
allow xdm_t default_t:file { read append };

Comment 1 Dominick Grift 2011-06-04 17:51:18 UTC
semanage fcontext -a -t home_root_t /space
semanage fcontext -a -e /home /space/home
restorecon -R -v /space

resource: man semanage

Comment 2 Miroslav Grepl 2011-06-05 07:28:05 UTC
*** Bug 710655 has been marked as a duplicate of this bug. ***