linux-stable/include
Daniel Borkmann da765a2f59 bpf: Add poke dependency tracking for prog array maps
This work adds program tracking to prog array maps. This is needed such
that upon prog array updates/deletions we can fix up all programs which
make use of this tail call map. We add ops->map_poke_{un,}track()
helpers to maps to maintain the list of programs and ops->map_poke_run()
for triggering the actual update.

bpf_array_aux is extended to contain the list head and poke_mutex in
order to serialize program patching during updates/deletions.
bpf_free_used_maps() will untrack the program shortly before dropping
the reference to the map. For clearing out the prog array once all urefs
are dropped we need to use schedule_work() to have a sleepable context.

The prog_array_map_poke_run() is triggered during updates/deletions and
walks the maintained prog list. It checks in their poke_tabs whether the
map and key is matching and runs the actual bpf_arch_text_poke() for
patching in the nop or new jmp location. Depending on the type of update,
we use one of BPF_MOD_{NOP_TO_JUMP,JUMP_TO_NOP,JUMP_TO_JUMP}.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/1fb364bb3c565b3e415d5ea348f036ff379e779d.1574452833.git.daniel@iogearbox.net
2019-11-24 17:04:11 -08:00
..
acpi cpufreq: Use per-policy frequency QoS 2019-10-21 02:05:21 +02:00
asm-generic timekeeping/vsyscall: Update VDSO data unconditionally 2019-11-04 23:02:53 +01:00
clocksource
crypto
drm drm/shmem: Add docbook comments for drm_gem_shmem_object madvise fields 2019-11-06 17:57:42 -06:00
dt-bindings dt-bindings: net: dp83869: Add TI dp83869 phy 2019-11-14 17:42:43 -08:00
keys
kvm
linux bpf: Add poke dependency tracking for prog array maps 2019-11-24 17:04:11 -08:00
math-emu
media
misc
net net: inet_is_local_reserved_port() should return bool not int 2019-11-22 16:52:47 -08:00
pcmcia
ras
rdma RDMA/uverbs: Prevent potential underflow 2019-10-22 15:05:36 -03:00
scsi
soc net: mscc: ocelot: convert to use ocelot_port_add_txtstamp_skb() 2019-11-21 14:39:02 -08:00
sound ASoC: Fixes for v5.4 2019-10-21 14:05:26 +02:00
target
trace page_pool: Add API to update numa node 2019-11-20 11:47:36 -08:00
uapi Revert "bpf: Emit audit messages upon successful prog load and unload" 2019-11-23 09:56:02 -08:00
vdso
video
xen
Kbuild