Bug 751851

Summary: SELinux is preventing /sbin/ethtool from 'write' accesses on the file /var/log/tuned/tuned.log.
Product: [Fedora] Fedora Reporter: edo <edosurina>
Component: tunedAssignee: Jan Vcelak <jvcelak>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: dominick.grift, dwalsh, jskarvad, jvcelak, mgrepl, pknirsch, tsmetana, twoerner
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:fe97ed9a47d95446cd0ad801253b1599d3c078abc9e42610e7ffbd2d40cd2820
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-07 19:53:38 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 edo 2011-11-07 19:45:22 UTC
SELinux is preventing /sbin/ethtool from 'write' accesses on the file /var/log/tuned/tuned.log.

*****  Plugin catchall (50.5 confidence) suggests  ***************************

If you believe that ethtool should be allowed write access on the tuned.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 ethtool /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

*****  Plugin leaks (50.5 confidence) suggests  ******************************

If you want to ignore ethtool trying to write access the tuned.log file, because you believe it should not need this access.
Then you should report this as a bug.  
You can generate a local policy module to dontaudit this access.
Do
# grep /sbin/ethtool /var/log/audit/audit.log | audit2allow -D -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:ifconfig_t:s0
Target Context                system_u:object_r:tuned_log_t:s0
Target Objects                /var/log/tuned/tuned.log [ file ]
Source                        ethtool
Source Path                   /sbin/ethtool
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           ethtool-2.6.39-1.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-44.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.40.8-4.fc15.x86_64 #1 SMP Tue Nov 1 18:17:12
                              UTC 2011 x86_64 x86_64
Alert Count                   2
First Seen                    Po  7. november 2011, 17:24:32 CET
Last Seen                     Po  7. november 2011, 17:24:32 CET
Local ID                      e99509ee-52aa-421e-8188-01ef754703af

Raw Audit Messages
type=AVC msg=audit(1320683072.865:82): avc:  denied  { write } for  pid=3624 comm="ethtool" path="/var/log/tuned/tuned.log" dev=dm-1 ino=2097497 scontext=system_u:system_r:ifconfig_t:s0 tcontext=system_u:object_r:tuned_log_t:s0 tclass=file


type=SYSCALL msg=audit(1320683072.865:82): arch=x86_64 syscall=execve success=yes exit=0 a0=204f290 a1=20f0c00 a2=7fff5c464538 a3=1d950a0 items=0 ppid=2392 pid=3624 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=ethtool exe=/sbin/ethtool subj=system_u:system_r:ifconfig_t:s0 key=(null)

Hash: ethtool,ifconfig_t,tuned_log_t,file,write

audit2allow

#============= ifconfig_t ==============
allow ifconfig_t tuned_log_t:file write;

audit2allow -R

#============= ifconfig_t ==============
allow ifconfig_t tuned_log_t:file write;

Comment 1 Daniel Walsh 2011-11-07 21:22:04 UTC
Looks like tuned is leaking a file descriptor to its log file, or it is passing this as stdout?  If it is a leak you should execute 

fcntl(fd, F_SETFD, FD_CLOEXEC)

If this is intentional the log file should be opened for append not write.

Comment 2 Jan Vcelak 2011-11-07 23:20:47 UTC
I have no idea, where this write happens. But it should not. I will take it.

Comment 3 Fedora Admin XMLRPC Client 2012-03-20 10:09:54 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Fedora End Of Life 2012-08-07 19:53:40 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping