[ovs-dev] [PATCH] rhel: Fix support for root user using DPDK

Stokes, Ian ian.stokes at intel.com
Tue Jan 30 14:50:47 UTC 2018


> -----Original Message-----
> From: ovs-dev-bounces at openvswitch.org [mailto:ovs-dev-
> bounces at openvswitch.org] On Behalf Of Marcos Felipe Schwarz
> Sent: Sunday, January 28, 2018 2:42 AM
> To: dev at openvswitch.org
> Subject: [ovs-dev] [PATCH] rhel: Fix support for root user using DPDK
> 
> Since 2.8.0 OVS runs as non-root user on rhel distros, but the current
> implementation breaks the ability to run as root with DPDK and as a
> consequence there is no way possible to use UIO drivers on kernel 4.0 and
> newer [1, 2].
> [1]
> http://dpdk.org/browse/dpdk/commit/?id=cdc242f260e766bd95a658b5e0686a62ec0
> 4f5b0
> [2] https://www.kernel.org/doc/Documentation/vm/pagemap.txt
> 
> Signed-off-by: Marcos Schwarz <marcos.f.sch at gmail.com>

Hi Marcos,

Thanks for this, normally a fix will include the fixes tag for the commit message.

I spotted Aaron acked this already but had issues with applying to the head of master, I had the same issue, if you can rebase and add the fixes tag I'll add this to DPDK_MERGE and backport it for the 2.9 branch.

Thanks
Ian
> ---
>  lib/daemon-unix.c                                   | 3 ++-
>  rhel/usr_lib_systemd_system_ovs-vswitchd.service.in | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/daemon-unix.c b/lib/daemon-unix.c index
> adb549c98..06528e9ab 100644
> --- a/lib/daemon-unix.c
> +++ b/lib/daemon-unix.c
> @@ -1047,5 +1047,6 @@ daemon_set_new_user(const char *user_spec)
>          }
>      }
> 
> -    switch_user = true;
> +    if (!uid_verify(uid) || !gid_verify(gid))
> +        switch_user = true;
>  }
> diff --git a/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in b/rhel/
> usr_lib_systemd_system_ovs-vswitchd.service.in
> index c6d9aa1b8..9b01c9271 100644
> --- a/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in
> +++ b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in
> @@ -14,7 +14,7 @@ Environment=HOME=/var/run/openvswitch
>  EnvironmentFile=/etc/openvswitch/default.conf
>  EnvironmentFile=-/etc/sysconfig/openvswitch
>  @begin_dpdk@
> -ExecStartPre=-/usr/bin/chown :hugetlbfs /dev/hugepages
> +ExecStartPre=-/bin/sh -c '/usr/bin/chown :${OVS_USER_ID##*:}
> /dev/hugepages'
>  ExecStartPre=-/usr/bin/chmod 0775 /dev/hugepages  @end_dpdk@
> ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
> --
> 2.14.3
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev


More information about the dev mailing list