OpenCloudOS-Kernel/kernel/bpf/preload
Toke Høiland-Jørgensen 3aac1ead5e bpf: Move prog->aux->linked_prog and trampoline into bpf_link on attach
In preparation for allowing multiple attachments of freplace programs, move
the references to the target program and trampoline into the
bpf_tracing_link structure when that is created. To do this atomically,
introduce a new mutex in prog->aux to protect writing to the two pointers
to target prog and trampoline, and rename the members to make it clear that
they are related.

With this change, it is no longer possible to attach the same tracing
program multiple times (detaching in-between), since the reference from the
tracing program to the target disappears on the first attach. However,
since the next patch will let the caller supply an attach target, that will
also make it possible to attach to the same place multiple times.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/160138355059.48470.2503076992210324984.stgit@toke.dk
2020-09-29 13:09:23 -07:00
..
iterators bpf: Move prog->aux->linked_prog and trampoline into bpf_link on attach 2020-09-29 13:09:23 -07:00
.gitignore bpf/preload: Make sure Makefile cleans up after itself, and add .gitignore 2020-09-29 11:15:01 -07:00
Kconfig bpf: Disallow BPF_PRELOAD in allmodconfig builds 2020-08-25 15:23:46 -07:00
Makefile bpf/preload: Make sure Makefile cleans up after itself, and add .gitignore 2020-09-29 11:15:01 -07:00
bpf_preload.h bpf: Add kernel module with user mode driver that populates bpffs. 2020-08-20 16:02:36 +02:00
bpf_preload_kern.c bpf: Add kernel module with user mode driver that populates bpffs. 2020-08-20 16:02:36 +02:00
bpf_preload_umd_blob.S bpf: Add kernel module with user mode driver that populates bpffs. 2020-08-20 16:02:36 +02:00