linux/include
Toke Høiland-Jørgensen 92234c8f15 xdp: Support specifying expected existing program when attaching XDP
While it is currently possible for userspace to specify that an existing
XDP program should not be replaced when attaching to an interface, there is
no mechanism to safely replace a specific XDP program with another.

This patch adds a new netlink attribute, IFLA_XDP_EXPECTED_FD, which can be
set along with IFLA_XDP_FD. If set, the kernel will check that the program
currently loaded on the interface matches the expected one, and fail the
operation if it does not. This corresponds to a 'cmpxchg' memory operation.
Setting the new attribute with a negative value means that no program is
expected to be attached, which corresponds to setting the UPDATE_IF_NOEXIST
flag.

A new companion flag, XDP_FLAGS_REPLACE, is also added to explicitly
request checking of the EXPECTED_FD attribute. This is needed for userspace
to discover whether the kernel supports the new attribute.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/bpf/158515700640.92963.3551295145441017022.stgit@toke.dk
2020-03-28 14:24:41 -07:00
..
acpi ACPI fixes for 5.6-rc4 2020-02-28 09:02:18 -08:00
asm-generic bpf: Support llvm-objcopy for vmlinux BTF 2020-03-19 12:32:38 +01:00
clocksource
crypto crypto: x86/curve25519 - support assemblers with no adx support 2020-03-05 18:28:09 +11:00
drm drm/dp_mst: Use full_pbn instead of available_pbn for bandwidth checks 2020-03-12 19:07:24 -04:00
dt-bindings ARM: SoC: late updates 2020-02-08 14:17:27 -08:00
keys
kunit
kvm
linux xdp: Support specifying expected existing program when attaching XDP 2020-03-28 14:24:41 -07:00
math-emu
media
misc
net bpf: Allow to retrieve cgroup v1 classid from v2 hooks 2020-03-27 19:40:38 -07:00
pcmcia
ras
rdma
scsi scsi: Revert "target: iscsi: Wait for all commands to finish before freeing a session" 2020-02-14 17:13:54 -05:00
soc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-03-12 22:34:48 -07:00
sound ASoC: Fixes for v5.6 2020-03-07 07:24:36 +01:00
target
trace bpf: Reliably preserve btf_trace_xxx types 2020-03-02 16:49:55 -08:00
uapi xdp: Support specifying expected existing program when attaching XDP 2020-03-28 14:24:41 -07:00
vdso
video
xen xen/xenbus: fix locking 2020-03-05 09:42:23 -06:00