Bug 722571

Summary: SELinux is preventing /usr/bin/xdm from 'write' accesses on the file /var/log/xdm.log.
Product: [Fedora] Fedora Reporter: Horst H. von Brand <vonbrand>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:628c49aa5b004a7200baed89857b2fc493da09a9d0f997d514c2e8fe2ef92fed
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-15 17:34: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 Horst H. von Brand 2011-07-15 17:05:49 UTC
SELinux is preventing /usr/bin/xdm from 'write' accesses on the file /var/log/xdm.log.

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

If you believe that xdm should be allowed write access on the xdm.log 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 xdm /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:var_log_t:s0
Target Objects                /var/log/xdm.log [ file ]
Source                        xdm
Source Path                   /usr/bin/xdm
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           xorg-x11-xdm-1.1.10-1.fc16
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-29.1.fc16
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              3.0-0.rc4.git0.2.fc16.x86_64 #1 SMP Wed Jun 22
                              16:27:16 UTC 2011 x86_64 x86_64
Alert Count                   7
First Seen                    Fri 27 May 2011 12:54:31 PM CLT
Last Seen                     Fri 01 Jul 2011 07:22:02 AM CLT
Local ID                      9c3af9b9-1fce-49c9-b177-dd6550fa1507

Raw Audit Messages
type=AVC msg=audit(1309519322.601:39): avc:  denied  { write } for  pid=1115 comm="xdm" name="xdm.log" dev=dm-4 ino=1572995 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_log_t:s0 tclass=file


type=SYSCALL msg=audit(1309519322.601:39): arch=x86_64 syscall=creat success=no exit=EACCES a0=23c5100 a1=1b6 a2=f000 a3=7fffe05d86f0 items=0 ppid=1 pid=1115 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=xdm exe=/usr/bin/xdm subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 key=(null)

Hash: xdm,xdm_t,var_log_t,file,write

audit2allow

#============= xdm_t ==============
allow xdm_t var_log_t:file write;

audit2allow -R

#============= xdm_t ==============
allow xdm_t var_log_t:file write;

Comment 1 Dominick Grift 2011-07-15 17:15:09 UTC
Can you give the output of the following command:

find /var/log -inum 1572995

By the way: xdm (and any other desktop manager) should probably be opening log files for append only...

Comment 2 Dominick Grift 2011-07-15 17:20:45 UTC
file context spec for /var/log/xdm.log was missing. added here:

http://git.fedorahosted.org/git/?p=selinux-policy.git;a=commitdiff;h=4f8ee1f91cae999b74a4234fc145f614bd2e6f2b