summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAaron Conole <aconole@redhat.com>2023-03-16 08:00:39 -0400
committerIlya Maximets <i.maximets@ovn.org>2023-03-22 18:56:02 +0100
commit07cf5810de8da12c700324bc421bde92376abe06 (patch)
treecae90caceda929ae05aa2028bb023f64c6f69bfd /tests
parente90a0727f17f6ad915a32735a8c0b282f2c8cd6f (diff)
downloadopenvswitch-07cf5810de8da12c700324bc421bde92376abe06.tar.gz
dpdk: Allow retaining CAP_SYS_RAWIO privileges.
Open vSwitch generally tries to let the underlying operating system managed the low level details of hardware, for example DMA mapping, bus arbitration, etc. However, when using DPDK, the underlying operating system yields control of many of these details to userspace for management. In the case of some DPDK port drivers, configuring rte_flow or even allocating resources may require access to iopl/ioperm calls, which are guarded by the CAP_SYS_RAWIO privilege on linux systems. These calls are dangerous, and can allow a process to completely compromise a system. However, they are needed in the case of some userspace driver code which manages the hardware (for example, the mlx implementation of backend support for rte_flow). Here, we create an opt-in flag passed to the command line to allow this access. We need to do this before ever accessing the database, because we want to drop all privileges asap, and cannot wait for a connection to the database to be established and functional before dropping. There may be distribution specific ways to do capability management as well (using for example, systemd), but they are not as universal to the vswitchd as a flag. Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Aaron Conole <aconole@redhat.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Acked-by: Gaetan Rivet <gaetanr@nvidia.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/test-netflow.c2
-rw-r--r--tests/test-sflow.c2
-rw-r--r--tests/test-unixctl.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/tests/test-netflow.c b/tests/test-netflow.c
index d2322d450..7f89cfcae 100644
--- a/tests/test-netflow.c
+++ b/tests/test-netflow.c
@@ -195,7 +195,7 @@ test_netflow_main(int argc, char *argv[])
}
daemon_save_fd(STDOUT_FILENO);
- daemonize_start(false);
+ daemonize_start(false, false);
error = unixctl_server_create(NULL, &server);
if (error) {
diff --git a/tests/test-sflow.c b/tests/test-sflow.c
index 460d4d6c5..3c617bdd1 100644
--- a/tests/test-sflow.c
+++ b/tests/test-sflow.c
@@ -709,7 +709,7 @@ test_sflow_main(int argc, char *argv[])
}
daemon_save_fd(STDOUT_FILENO);
- daemonize_start(false);
+ daemonize_start(false, false);
error = unixctl_server_create(NULL, &server);
if (error) {
diff --git a/tests/test-unixctl.c b/tests/test-unixctl.c
index 3eadf54cd..9e8982789 100644
--- a/tests/test-unixctl.c
+++ b/tests/test-unixctl.c
@@ -83,7 +83,7 @@ test_unixctl_main(int argc, char *argv[])
fatal_ignore_sigpipe();
parse_options(&argc, &argv, &unixctl_path);
- daemonize_start(false);
+ daemonize_start(false, false);
int retval = unixctl_server_create(unixctl_path, &unixctl);
if (retval) {
exit(EXIT_FAILURE);