summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorMariusz Dudek <mariuszx.dudek@intel.com>2020-12-03 10:05:45 +0100
committerAlexei Starovoitov <ast@kernel.org>2020-12-03 10:37:59 -0800
commite459f49b4394e2630ea55d5ac7a49402686848fe (patch)
tree2820e6dedca6e7e9da5e5425d74b8460ea50bf05 /samples
parent22e8ebe35a2e30ee19e02c41cacc99c2f896bc4b (diff)
libbpf: Separate XDP program load with xsk socket creation
Add support for separation of eBPF program load and xsk socket creation. This is needed for use-case when you want to privide as little privileges as possible to the data plane application that will handle xsk socket creation and incoming traffic. With this patch the data entity container can be run with only CAP_NET_RAW capability to fulfill its purpose of creating xsk socket and handling packages. In case your umem is larger or equal process limit for MEMLOCK you need either increase the limit or CAP_IPC_LOCK capability. To resolve privileges issue two APIs are introduced: - xsk_setup_xdp_prog - loads the built in XDP program. It can also return xsks_map_fd which is needed by unprivileged process to update xsks_map with AF_XDP socket "fd" - xsk_socket__update_xskmap - inserts an AF_XDP socket into an xskmap for a particular xsk_socket Signed-off-by: Mariusz Dudek <mariuszx.dudek@intel.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Magnus Karlsson <magnus.karlsson@intel.com> Link: https://lore.kernel.org/bpf/20201203090546.11976-2-mariuszx.dudek@intel.com
Diffstat (limited to 'samples')
0 files changed, 0 insertions, 0 deletions