Bug 1290705 - SELinux prevents ipset from creating a netlink socket
SELinux prevents ipset from creating a netlink socket
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy (Show other bugs)
6.7
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Simon Sekidde
Milos Malik
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-11 03:32 EST by Milos Malik
Modified: 2016-05-10 16:03 EDT (History)
7 users (show)

See Also:
Fixed In Version: selinux-policy-3.7.19-288.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-10 16:03:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Milos Malik 2015-12-11 03:32:02 EST
Description of problem:
 * seen on i686 and x86_64 machines

Version-Release number of selected component (if applicable):
selinux-policy-3.7.19-285.el6.noarch
selinux-policy-doc-3.7.19-285.el6.noarch
selinux-policy-minimum-3.7.19-285.el6.noarch
selinux-policy-mls-3.7.19-285.el6.noarch
selinux-policy-targeted-3.7.19-285.el6.noarch
shorewall-4.5.4-1.el6.noarch
shorewall6-4.5.4-1.el6.noarch
shorewall6-lite-4.5.4-1.el6.noarch
shorewall-core-4.5.4-1.el6.noarch
shorewall-lite-4.5.4-1.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. get a RHEL-6.7 machine (active targeted policy)
2. run following automated TC:
 * /CoreOS/selinux-policy/Regression/shorewall-and-similar
3. search for SELinux denials

Actual results (enforcing mode):
----
type=SYSCALL msg=audit(12/11/2015 09:25:44.083:253) : arch=x86_64 syscall=socket success=no exit=-13(Permission denied) a0=netlink a1=SOCK_RAW a2=pup a3=0x10 items=0 ppid=15752 pid=15753 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=1 comm=ipset exe=/usr/sbin/ipset subj=unconfined_u:system_r:shorewall_t:s0 key=(null) 
type=AVC msg=audit(12/11/2015 09:25:44.083:253) : avc:  denied  { create } for  pid=15753 comm=ipset scontext=unconfined_u:system_r:shorewall_t:s0 tcontext=unconfined_u:system_r:shorewall_t:s0 tclass=netlink_socket 
----

Expected results:
 * no SELinux denials
Comment 1 Milos Malik 2015-12-11 03:34:18 EST
Actual results (permissive mode):
----
type=SYSCALL msg=audit(12/11/2015 09:32:45.694:363) : arch=x86_64 syscall=socket success=yes exit=3 a0=netlink a1=SOCK_RAW a2=pup a3=0x10 items=0 ppid=23865 pid=23866 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=1 comm=ipset exe=/usr/sbin/ipset subj=unconfined_u:system_r:shorewall_t:s0 key=(null) 
type=AVC msg=audit(12/11/2015 09:32:45.694:363) : avc:  denied  { create } for  pid=23866 comm=ipset scontext=unconfined_u:system_r:shorewall_t:s0 tcontext=unconfined_u:system_r:shorewall_t:s0 tclass=netlink_socket 
----
type=SOCKADDR msg=audit(12/11/2015 09:32:45.694:364) : saddr=netlink pid:0 
type=SYSCALL msg=audit(12/11/2015 09:32:45.694:364) : arch=x86_64 syscall=bind success=yes exit=0 a0=0x3 a1=0x21a85e4 a2=0xc a3=0x10 items=0 ppid=23865 pid=23866 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=1 comm=ipset exe=/usr/sbin/ipset subj=unconfined_u:system_r:shorewall_t:s0 key=(null) 
type=AVC msg=audit(12/11/2015 09:32:45.694:364) : avc:  denied  { bind } for  pid=23866 comm=ipset scontext=unconfined_u:system_r:shorewall_t:s0 tcontext=unconfined_u:system_r:shorewall_t:s0 tclass=netlink_socket 
----
type=SOCKADDR msg=audit(12/11/2015 09:32:45.694:365) : saddr=netlink pid:23866 
type=SYSCALL msg=audit(12/11/2015 09:32:45.694:365) : arch=x86_64 syscall=getsockname success=yes exit=0 a0=0x3 a1=0x21a85e4 a2=0x7fffaf24f19c a3=0x10 items=0 ppid=23865 pid=23866 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=1 comm=ipset exe=/usr/sbin/ipset subj=unconfined_u:system_r:shorewall_t:s0 key=(null) 
type=AVC msg=audit(12/11/2015 09:32:45.694:365) : avc:  denied  { getattr } for  pid=23866 comm=ipset scontext=unconfined_u:system_r:shorewall_t:s0 tcontext=unconfined_u:system_r:shorewall_t:s0 tclass=netlink_socket 
----
Comment 6 Milos Malik 2016-01-12 04:52:48 EST
It's my mistake that the { module_request } denial was not reported sooner. Unfortunately, the domain_kernel_load_modules boolean was enabled on my VMs.
Comment 7 Simon Sekidde 2016-01-12 12:59:22 EST
(In reply to Milos Malik from comment #6)
> It's my mistake that the { module_request } denial was not reported sooner.
> Unfortunately, the domain_kernel_load_modules boolean was enabled on my VMs.

No problem. Patch sent

commit 0e99bf718ff6c058ffdd07462aed2dabfddd4aa7
Author: Simon Sekidde <ssekidde@redhat.com>
Date:   Tue Jan 12 12:54:27 2016 -0500

    Allow shorewall request kernel load module
Comment 11 errata-xmlrpc 2016-05-10 16:03:46 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0763.html

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