Bug 622978

Summary: SELinux is preventing /usr/sbin/sendmail.sendmail access to a leaked /opt/lampp/logs/error_log file descriptor.
Product: [Fedora] Fedora Reporter: PRABIN KUMAR DATTA <linux.n.pkd>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: dwalsh, linux.n.pkd, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:30c1508f969db3bd79fe303b5c646ffa12dc16bdd395f3ab263c53197eb38172
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-11 08:56:59 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 PRABIN KUMAR DATTA 2010-08-10 23:26:07 UTC
Summary:

SELinux is preventing /usr/sbin/sendmail.sendmail access to a leaked
/opt/lampp/logs/error_log file descriptor.

Detailed Description:

[sendmail has a permissive type (sendmail_t). This access was not denied.]

SELinux denied access requested by the sendmail command. It looks like this is
either a leaked descriptor or sendmail output was redirected to a file it is not
allowed to access. Leaks usually can be ignored since SELinux is just closing
the leak and reporting the error. The application does not use the descriptor,
so it will run properly. If this is a redirection, you will not get output in
the /opt/lampp/logs/error_log. You should generate a bugzilla on selinux-policy,
and it will get routed to the appropriate package. You can safely ignore this
avc.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://docs.fedoraproject.org/selinux-faq-fc5/#id2961385)

Additional Information:

Source Context                system_u:system_r:sendmail_t:s0
Target Context                system_u:object_r:usr_t:s0
Target Objects                /opt/lampp/logs/error_log [ file ]
Source                        sendmail
Source Path                   /usr/sbin/sendmail.sendmail
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           sendmail-8.14.4-4.fc13
Target RPM Packages           
Policy RPM                    selinux-policy-3.7.19-41.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   leaks
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.33.6-147.2.4.fc13.i686.PAE #1 SMP Fri Jul 23
                              17:21:06 UTC 2010 i686 i686
Alert Count                   1
First Seen                    Wed 11 Aug 2010 01:25:55 AM IST
Last Seen                     Wed 11 Aug 2010 01:25:55 AM IST
Local ID                      8e629946-8226-4e56-a7a0-bb0fc9f81e97
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1281470155.189:21822): avc:  denied  { append } for  pid=3515 comm="sendmail" path="/opt/lampp/logs/error_log" dev=sda5 ino=1440893 scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:usr_t:s0 tclass=file

node=(removed) type=SYSCALL msg=audit(1281470155.189:21822): arch=40000003 syscall=11 success=yes exit=0 a0=94903a8 a1=9490480 a2=948f8b8 a3=9490480 items=0 ppid=1546 pid=3515 auid=4294967295 uid=99 gid=99 euid=99 suid=99 fsuid=99 egid=482 sgid=482 fsgid=482 tty=(none) ses=4294967295 comm="sendmail" exe="/usr/sbin/sendmail.sendmail" subj=system_u:system_r:sendmail_t:s0 key=(null)



Hash String generated from  leaks,sendmail,sendmail_t,usr_t,file,append
audit2allow suggests:

#============= sendmail_t ==============
allow sendmail_t usr_t:file append;

Comment 1 Miroslav Grepl 2010-08-11 08:56:59 UTC
Looks like lampp tool is leaking a file descriptor.

Try to execute

chcon -t var_log_t /opt/lampp/logs/error_log

Should fix.

Comment 2 Daniel Walsh 2010-08-11 12:16:06 UTC
You want to run 

# semanage fcontext -a -t var_log_t '/opt/lampp/logs(/.*)?'

To make this change permanent.