Bug 238756 - SELinux is preventing /sbin/ifconfig (ifconfig_t) "read write" to eventpoll:[28163] (initrc_t). [NEEDINFO]
SELinux is preventing /sbin/ifconfig (ifconfig_t) "read write" to eventpoll:[...
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: vmware (Show other bugs)
5.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Todd Barr
Todd Barr
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-05-02 15:52 EDT by Scott Bambrough
Modified: 2014-06-02 09:18 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-02 09:18:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
pm-rhel: needinfo? (scottb)


Attachments (Terms of Use)

  None (edit)
Description Scott Bambrough 2007-05-02 15:52:15 EDT
Summary
    SELinux is preventing /sbin/ifconfig (ifconfig_t) "read write" to
    eventpoll:[28163] (initrc_t).

Detailed Description
    SELinux denied access requested by /sbin/ifconfig. It is not expected that
    this access is required by /sbin/ifconfig and this access may signal an
    intrusion attempt. It is also possible that the specific version or
    configuration of the application is causing it to require additional access.

Allowing Access
    You can generate a local policy module to allow this access - see
    http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385 Or you can disable
    SELinux protection altogether. Disabling SELinux protection is not
    recommended. Please file a http://bugzilla.redhat.com/bugzilla/enter_bug.cgi
    against this package.

Additional Information        

Source Context                root:system_r:ifconfig_t
Target Context                root:system_r:initrc_t
Target Objects                eventpoll:[28163] [ unix_stream_socket ]
Affected RPM Packages         net-tools-1.60-73 [application]
Policy RPM                    selinux-policy-2.4.6-30.el5
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   plugins.catchall
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain 2.6.18-8.el5 #1 SMP
                              Fri Jan 26 14:15:21 EST 2007 i686 athlon
Alert Count                   1
Line Numbers                  

Raw Audit Messages            

avc: denied { read, write } for comm="ifconfig" dev=sockfs egid=0 euid=0
exe="/sbin/ifconfig" exit=0 fsgid=0 fsuid=0 gid=0 items=0 name="[28166]"
path="eventpoll:[28163]" pid=5898 scontext=root:system_r:ifconfig_t:s0 sgid=0
subj=root:system_r:ifconfig_t:s0 suid=0 tclass=unix_stream_socket
tcontext=root:system_r:initrc_t:s0 tty=(none) uid=0

I get this installing Xandros Bridgeways on RHEL5 (no updates) in a VMware image.
Comment 1 Radek Vokal 2007-05-14 05:47:58 EDT
This seems to me VMware specific. Reassigning to selinux-policy
Comment 2 Daniel Walsh 2007-05-14 13:39:27 EDT
THis is probably caused by vmware leaking an open file descriptor to a
unix_stream_socket.  This descriptor should be closed on exec.

fsctl(fd, F_SETFD, F_CLOEXEC)

Comment 3 Scott Bambrough 2007-05-15 10:33:29 EDT
I think you mean: fcntl(fd, F_SETFD, F_CLOEXEC)

I doubt this is VMware.  I suspect it is our app (running under VMware) leaking
a descriptor obtained via epoll_create, when ifconfig is exec'ed by it.
Comment 4 Scott Bambrough 2007-09-24 09:25:43 EDT
This has been resolved in our app by using the above technique to prevent the
descriptor leaking when we exec an init script from our app.
Comment 5 Michal Nowak 2009-06-11 06:01:26 EDT
Looks like this is fixed; CLOSE CANTFIX?
Comment 6 Scott Pedigo 2009-07-05 06:02:34 EDT
I also get this report, and it has nothing to do with VMware. It is occurring on a fresh Fedora 11 installation which has been updated with all available updates.

Some things I did which might be relevant are:

(1) installed "ddclient", for periodically updating the dynamic IP address for a subdomain I registered at dynDNS.com. It is configured to get the IP address from the network interface. In /etc/ddclient/ddclient.conf, I have uncommented this line:

## Obtain IP address from network interface (if no firewall or router)
use=if,                     if=eth0             # via interfaces

(2) installed "denyhosts"


Summary:

SELinux is preventing ifconfig (ifconfig_t) "read" security_t.

Detailed Description:

SELinux denied access requested by ifconfig. It is not expected that this access
is required by ifconfig and this access may signal an intrusion attempt. It is
also possible that the specific version or configuration of the application is
causing it to require additional access.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Or you can disable
SELinux protection altogether. Disabling SELinux protection is not recommended.
Please file a bug report (http://bugzilla.redhat.com/bugzilla/enter_bug.cgi)
against this package.

Additional Information:

Source Context                system_u:system_r:ifconfig_t:s0
Target Context                system_u:object_r:security_t:s0
Target Objects                mls [ file ]
Source                        ifconfig
Source Path                   /sbin/ifconfig
Port                          <Unknown>
Host                          icestorm
Source RPM Packages           net-tools-1.60-92.fc11
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.12-53.fc11
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     icestorm
Platform                      Linux icestorm 2.6.29.5-191.fc11.i586 #1 SMP Tue
                              Jun 16 23:11:39 EDT 2009 i686 i686
Alert Count                   3
First Seen                    Fri 03 Jul 2009 03:15:05 PM CEST
Last Seen                     Sat 04 Jul 2009 05:55:42 PM CEST
Local ID                      49aa299a-3d2e-44ef-b8ba-02b3b022f414
Line Numbers                  

Raw Audit Messages            

node=icestorm type=AVC msg=audit(1246722942.947:31390): avc:  denied  { read } for  pid=2601 comm="ifconfig" name="mls" dev=selinuxfs ino=12 scontext=system_u:system_r:ifconfig_t:s0 tcontext=system_u:object_r:security_t:s0 tclass=file

node=icestorm type=SYSCALL msg=audit(1246722942.947:31390): arch=40000003 syscall=5 success=no exit=-13 a0=bfa28ab8 a1=8000 a2=0 a3=bfa28ab8 items=0 ppid=2600 pid=2601 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="ifconfig" exe="/sbin/ifconfig" subj=system_u:system_r:ifconfig_t:s0 key=(null)
Comment 7 Scott Pedigo 2009-07-05 07:52:02 EDT
I found the following explanation here:
http://www.linux-archive.org/fedora-selinux-support/319835-ifconfig-selinux-alert-fedora-11-a.html

"ldd /sbin/ifconfig shows that ifconfig is now linked against libselinux,
and thus runs its constructors. So that is why it is trying to
open /selinux/mls."

As per the instructions in the FAQ linked in the settroubleshoot browser, I extracted the lines containing "avc:  denied" from /var/log/audit/audit.log, pasted them into /tmp/avcs, generated a local policy file with "audit2allow -M local < /tmp/avcs", and imported it into the kernel with "semodule -i local.pp"

The contents of the generated local.te:
module local 1.0;

require {
	type ifconfig_t;
	type NetworkManager_t;
	type device_t;
	type security_t;
	class file read;
}

#============= NetworkManager_t ==============
allow NetworkManager_t device_t:file read;

#============= ifconfig_t ==============
allow ifconfig_t security_t:file read;
Comment 8 Scott Pedigo 2009-07-05 08:11:59 EDT
Granting read access allowed NetworkManager and ifconfig to proceed further, 
whereupon they both then incurred more AVC denials when trying to open something. From the audit.log:

type=AVC msg=audit(1246793563.399:31537): avc:  denied  { open } for  pid=7488 comm="NetworkManager" name="null" dev=tmpfs ino=79542 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:device_t:s0 tclass=file

type=AVC msg=audit(1246793622.385:6): avc:  denied  { open } for  pid=1679 comm="ifconfig" name="mls" dev=selinuxfs ino=12 scontext=system_u:system_r:ifconfig_t:s0 tcontext=system_u:object_r:security_t:s0 tclass=file

So I repeated the steps to also allow open access. After that, I didn't get any more AVC denials when I rebooted the system.

module local 1.0;

require {
	type ifconfig_t;
	type NetworkManager_t;
	type device_t;
	type security_t;
	class file { read open };
}

#============= NetworkManager_t ==============
allow NetworkManager_t device_t:file { read open };

#============= ifconfig_t ==============
allow ifconfig_t security_t:file { read open };
Comment 9 RHEL Product and Program Management 2014-03-07 08:44:13 EST
This bug/component is not included in scope for RHEL-5.11.0 which is the last RHEL5 minor release. This Bugzilla will soon be CLOSED as WONTFIX (at the end of RHEL5.11 development phase (Apr 22, 2014)). Please contact your account manager or support representative in case you need to escalate this bug.
Comment 10 RHEL Product and Program Management 2014-06-02 09:18:38 EDT
Thank you for submitting this request for inclusion in Red Hat Enterprise Linux 5. We've carefully evaluated the request, but are unable to include it in RHEL5 stream. If the issue is critical for your business, please provide additional business justification through the appropriate support channels (https://access.redhat.com/site/support).

Note You need to log in before you can comment on or make changes to this bug.