Bug 560246 - SELinux is preventing iptables (iptables_t) "read write" initrc_t.
Summary: SELinux is preventing iptables (iptables_t) "read write" initrc_t.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-30 15:33 UTC by Jerry Amundson
Modified: 2010-03-23 23:28 UTC (History)
3 users (show)

Fixed In Version: selinux-policy-3.6.12-95.fc11
Clone Of:
Environment:
Last Closed: 2010-03-23 23:28:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jerry Amundson 2010-01-30 15:33:09 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:
once

Steps to Reproduce:
1.establish vpn tunnel with Cisco AnyConnect VPN Client
2.
3.
  
Actual results:
avc

Expected results:
no avc

Additional info:

Summary:

SELinux is preventing iptables (iptables_t) "read write" initrc_t.

Detailed Description:

SELinux denied access requested by iptables. It is not expected that this access
is required by iptables 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                unconfined_u:system_r:iptables_t:s0
Target Context                unconfined_u:system_r:initrc_t:s0
Target Objects                socket [ tcp_socket ]
Source                        iptables
Source Path                   /sbin/iptables
Port                          <Unknown>
Host                          jerry-D600-home
Source RPM Packages           iptables-1.4.3.1-1.fc11
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.12-93.fc11
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     jerry-D600-home
Platform                      Linux jerry-D600-home 2.6.30.10-105.2.4.fc11.i586
                              #1 SMP Tue Jan 19 22:31:48 UTC 2010 i686 i686
Alert Count                   89
First Seen                    Sat 30 Jan 2010 09:25:37 AM CST
Last Seen                     Sat 30 Jan 2010 09:25:37 AM CST
Local ID                      44189619-b8a9-4b5c-9672-1a26f7634358
Line Numbers                  

Raw Audit Messages            

node=jerry-D600-home type=AVC msg=audit(1264865137.294:69): avc:  denied  { read write } for  pid=3118 comm="iptables" path="socket:[148308]" dev=sockfs ino=148308 scontext=unconfined_u:system_r:iptables_t:s0 tcontext=unconfined_u:system_r:initrc_t:s0 tclass=tcp_socket

node=jerry-D600-home type=AVC msg=audit(1264865137.294:69): avc:  denied  { read write } for  pid=3118 comm="iptables" path="socket:[152070]" dev=sockfs ino=152070 scontext=unconfined_u:system_r:iptables_t:s0 tcontext=unconfined_u:system_r:initrc_t:s0 tclass=tcp_socket

node=jerry-D600-home type=AVC msg=audit(1264865137.294:69): avc:  denied  { read write } for  pid=3118 comm="iptables" path="/dev/net/tun" dev=tmpfs ino=2492 scontext=unconfined_u:system_r:iptables_t:s0 tcontext=system_u:object_r:tun_tap_device_t:s0 tclass=chr_file

node=jerry-D600-home type=SYSCALL msg=audit(1264865137.294:69): arch=40000003 syscall=11 success=yes exit=0 a0=9b85bc4 a1=9b85c18 a2=bf9211ec a3=bf920f10 items=0 ppid=3059 pid=3118 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=1 comm="iptables" exe="/sbin/iptables" subj=unconfined_u:system_r:iptables_t:s0 key=(null)

Comment 1 Miroslav Grepl 2010-02-01 10:59:28 UTC
What process is running as initrc_t?

# ps -eZ | grep initrc_t    


Were you using a tool to manipulate firewall rules?

Comment 2 long 2010-02-01 22:20:54 UTC
I'm getting the same error.

[long@shibby ~]$ ps -eZ | grep initrc_t
system_u:system_r:initrc_t:s0    2040 ?        00:00:00 ddclient
system_u:system_r:initrc_t:s0    2143 ?        00:00:05 preload
unconfined_u:system_r:initrc_t:s0 30376 ?      00:00:00 vpnagentd

The Cisco VPN client tries to manipulate the firewall rules apparently.

Comment 3 Daniel Walsh 2010-02-02 13:38:51 UTC
So the problem is ddclient or vpnagentd is leaking the file descriptor.

Bugs should be opened against those tools, but since we do not ship them, we should probably dontaudit the leaks.

Miroslav add

init_dontaudit_leaks(iptables_t)
corenet_dontaudit_rw_tun_tap_dev(iptables_t)


########################################
## <summary>
##	dontaudit Read and write the TUN/TAP virtual network device.
## </summary>
## <param name="domain">
##	<summary>
##	The domain allowed access.
##	</summary>
## </param>
#
interface(`corenet_dontaudit_rw_tun_tap_dev',`
	gen_require(`
		type tun_tap_device_t;
	')

	dontaudit $1 tun_tap_device_t:chr_file { read write };
')


########################################
## <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: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 4 Miroslav Grepl 2010-02-02 14:28:23 UTC
Fixed in selinux-policy-3.6.32-81.fc12

Comment 5 Miroslav Grepl 2010-02-15 10:57:39 UTC
Fixed in selinux-policy-3.6.12-95.fc11

Comment 6 Fedora Update System 2010-02-19 17:11:46 UTC
selinux-policy-3.6.12-95.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.12-95.fc11

Comment 7 Fedora Update System 2010-02-23 05:32:40 UTC
selinux-policy-3.6.12-95.fc11 has been pushed to the Fedora 11 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/F11/FEDORA-2010-2591

Comment 8 Fedora Update System 2010-03-23 23:28:18 UTC
selinux-policy-3.6.12-95.fc11 has been pushed to the Fedora 11 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.