summaryrefslogtreecommitdiff
path: root/selinux
diff options
context:
space:
mode:
authorAnsis Atteka <aatteka@nicira.com>2016-01-19 09:59:12 -0800
committerAnsis Atteka <ansisatteka@gmail.com>2016-02-25 17:28:22 -0800
commit9b897c9125ef01377f645fd0eb275c87be21adf0 (patch)
tree14b01acd0592f5ef146ec8bfc5bb6f68914c099b /selinux
parent7daedce44a96edefd5afa683475eb482070e937a (diff)
downloadopenvswitch-9b897c9125ef01377f645fd0eb275c87be21adf0.tar.gz
rhel: provide our own SELinux custom policy package
CentOS, RHEL and Fedora distributions ship with their own Open vSwitch SELinux policy that is too strict and prevents Open vSwitch to work normally out of the box. As a solution, this patch introduces a new package which will "loosen" up "openvswitch_t" SELinux domain so that Open vSwitch could operate normally. Intended use-cases of this package are: 1. to allow users to install newer Open vSwitch on already released Fedora, RHEL and CentOS distributions where the default Open vSwitch SELinux policy that shipped with the corresponding Linux distribution is not up to date and did not anticipate that a newer Open vSwitch version might need to invoke new system calls or need to access certain system resources that it did not before; And 2. to provide alternative means through which Open vSwitch developers can proactively fix SELinux related policy issues without waiting for corresponding Linux distribution maintainers to update their central Open vSwitch SELinux policy. This patch was tested on Fedora 23 and CentOS 7. I verified that now on Fedora 23 Open vSwitch can create a NetLink socket; and that I did not see following error messages: vlog|INFO|opened log file /var/log/openvswitch/ovs-vswitchd.log ovs_numa|INFO|Discovered 2 CPU cores on NUMA node 0 ovs_numa|INFO|Discovered 1 NUMA nodes and 2 CPU cores reconnect|INFO|unix:/var/run/openvswitch/db.sock: connecting... reconnect|INFO|unix:/var/run/openvswitch/db.sock: connected netlink_socket|ERR|fcntl: Permission denied dpif_netlink|ERR|Generic Netlink family 'ovs_datapath' does not exist. The Open vSwitch kernel module is p robably not loaded. dpif|WARN|failed to enumerate system datapaths: Permission denied dpif|WARN|failed to create datapath ovs-system: Permission denied I did not test all Open vSwitch features so there still could be some OVS configuration that would get "Permission denied" errors. Since, Open vSwitch daemons on Ubuntu 15.10 by default run under "unconfined" SELinux domain, then there is no need to create a similar debian package for Ubuntu, because it works on default Ubuntu installation. Signed-off-by: Ansis Atteka <aatteka@nicira.com> Acked-by: Flavio Leitner <fbl@sysclose.com>
Diffstat (limited to 'selinux')
-rw-r--r--selinux/automake.mk9
-rw-r--r--selinux/openvswitch-custom.te9
2 files changed, 18 insertions, 0 deletions
diff --git a/selinux/automake.mk b/selinux/automake.mk
new file mode 100644
index 000000000..1088f3610
--- /dev/null
+++ b/selinux/automake.mk
@@ -0,0 +1,9 @@
+# Copyright (C) 2016 Nicira, Inc.
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved. This file is offered as-is,
+# without warranty of any kind.
+
+EXTRA_DIST += \
+ selinux/openvswitch-custom.te
diff --git a/selinux/openvswitch-custom.te b/selinux/openvswitch-custom.te
new file mode 100644
index 000000000..fc32b97ea
--- /dev/null
+++ b/selinux/openvswitch-custom.te
@@ -0,0 +1,9 @@
+module openvswitch-custom 1.0;
+
+require {
+ type openvswitch_t;
+ class netlink_socket { setopt getopt create connect getattr write read };
+}
+
+#============= openvswitch_t ==============
+allow openvswitch_t self:netlink_socket { setopt getopt create connect getattr write read };