Bug 557873 - SELinux is preventing /sbin/iptables-multi access to a leaked tcp_socket file descriptor.
Summary: SELinux is preventing /sbin/iptables-multi access to a leaked tcp_socket file...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 12
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:928f4d7e1d2...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-22 18:43 UTC by vatican2003
Modified: 2010-02-11 14:40 UTC (History)
3 users (show)

Fixed In Version: 3.6.32-84.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-02-11 14:40:28 UTC


Attachments (Terms of Use)

Description vatican2003 2010-01-22 18:43:04 UTC
Summary:

SELinux is preventing /sbin/iptables-multi access to a leaked tcp_socket file
descriptor.

Detailed Description:

[iptables has a permissive type (iptables_t). This access was not denied.]

SELinux denied access requested by the iptables command. It looks like this is
either a leaked descriptor or iptables 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 tcp_socket. 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://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385)

Additional Information:

Source Context                system_u:system_r:iptables_t:SystemLow
Target Context                system_u:system_r:initrc_t:SystemLow
Target Objects                tcp_socket [ tcp_socket ]
Source                        iptables
Source Path                   /sbin/iptables-multi
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           iptables-1.4.5-1.fc12
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.32-66.fc12
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   leaks
Host Name                     (removed)
Platform                      Linux (removed) 2.6.31.9-174.fc12.x86_64 #1 SMP Mon
                              Dec 21 05:33:33 UTC 2009 x86_64 x86_64
Alert Count                   4369
First Seen                    Tue 10 Nov 2009 06:46:43 PM EST
Last Seen                     Tue 12 Jan 2010 07:21:19 PM EST
Local ID                      d74224b9-a5d3-4b10-802b-dd19bcf8e7da
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1263342079.68:53160): avc:  denied  { read write } for  pid=26484 comm="iptables" path="socket:[17007]" dev=sockfs ino=17007 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:system_r:initrc_t:s0 tclass=tcp_socket

node=(removed) type=AVC msg=audit(1263342079.68:53160): avc:  denied  { read write } for  pid=26484 comm="iptables" path="socket:[17008]" dev=sockfs ino=17008 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:system_r:initrc_t:s0 tclass=udp_socket

node=(removed) type=AVC msg=audit(1263342079.68:53160): avc:  denied  { read write } for  pid=26484 comm="iptables" path="socket:[17009]" dev=sockfs ino=17009 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:system_r:initrc_t:s0 tclass=udp_socket

node=(removed) type=AVC msg=audit(1263342079.68:53160): avc:  denied  { read write } for  pid=26484 comm="iptables" path="socket:[17010]" dev=sockfs ino=17010 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:system_r:initrc_t:s0 tclass=udp_socket

node=(removed) type=SYSCALL msg=audit(1263342079.68:53160): arch=c000003e syscall=59 success=yes exit=0 a0=608a24 a1=7fff773aed90 a2=7fff773af148 a3=37be817230 items=0 ppid=2099 pid=26484 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="iptables" exe="/sbin/iptables-multi" subj=system_u:system_r:iptables_t:s0 key=(null)



Hash String generated from  selinux-policy-3.6.32-66.fc12,leaks,iptables,iptables_t,initrc_t,tcp_socket,read,write
audit2allow suggests:

#============= iptables_t ==============
allow iptables_t initrc_t:tcp_socket { read write };
allow iptables_t initrc_t:udp_socket { read write };

Comment 1 Miroslav Grepl 2010-01-25 09:41:16 UTC
Looks like a process is running as initrc_t and leaking file descriptors
to iptables.

What process is running as initrc_t?

# ps -eZ | grep initrc_t

Comment 2 Daniel Walsh 2010-01-25 19:33:12 UTC
Were you using a tool to manipulate firewall rules?

Comment 3 odog502 2010-02-03 01:33:06 UTC
I have this same problem.  It happens when I try to use Cisco AnyConnect VPN Client so that I can work remotely from home.  This problem is preventing me from being able to log in to the office.  The SELinux alert is accompanied with the error I get from Cisco: "The VPN client agent SSL engine encountered an error.  Close all sensitive networked applications."

My error is identical to the one above except for this line:

Policy RPM                    selinux-policy-3.6.32-78.fc12

Comment 4 odog502 2010-02-03 01:41:30 UTC
Also, in my case, this is a fresh install of fedora 12.  The only thing I have done with this system is download all the software updates.  It worked neither before nor after the updates.

I did a search on the error that I got from Cisco and this was the only thing I found:
http://blog.sarathonline.com/2008/06/cisco-anyconnect-client-on-ubuntu-fails.html

I wasn't able to solve my problem the proposed solutions in the above link either.

Comment 5 Daniel Walsh 2010-02-03 13:17:53 UTC
odog502, I don't believe SELinux is your problem.  If you put the machine in permissive mode, I bet the connection will still fail.

If you read the AVC message closely, you will see the name/value pair success=yes, this means the system call that triggered the AVC was successful, meaning SELinux actually did not cause a syscall to fail.  

Miroslav, add 

init_dontaudit_script_leaks(iptables_t)


########################################
## <summary>
##	dontaudit read and write an leaked init scrip file descriptors
## </summary>
## <param name="domain">
##	<summary>
##	The type of the process performing this action.
##	</summary>
## </param>
#
interface(`init_dontaudit_script_leaks',`
	gen_require(`
		type initrc_t;
	')

	dontaudit $1 initrc_t:tcp_socket { read write };
	dontaudit $1 initrc_t:udp_socket { read write };
	dontaudit $1 initrc_t:unix_dgram_socket { read write };
	dontaudit $1 initrc_t:unix_stream_socket { read write };
	dontaudit $1 initrc_t:shm rw_shm_perms;
	init_dontaudit_use_script_ptys($1)
	init_dontaudit_use_script_fds($1)
')

Comment 6 Miroslav Grepl 2010-02-03 13:32:07 UTC
Fixed in selinux-policy-3.6.32-81.fc12

Comment 7 Fedora Update System 2010-02-03 23:18:27 UTC
selinux-policy-3.6.32-82.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-82.fc12

Comment 8 Fedora Update System 2010-02-05 01:42:51 UTC
selinux-policy-3.6.32-84.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2010-1492

Comment 9 Fedora Update System 2010-02-11 14:35:33 UTC
selinux-policy-3.6.32-84.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


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