]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, x86: Attach a cookie to fentry/fexit/fmod_ret/lsm.
authorKui-Feng Lee <kuifeng@fb.com>
Tue, 10 May 2022 20:59:21 +0000 (13:59 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 11 May 2022 04:58:31 +0000 (21:58 -0700)
commit9fcad9db49d9ca82ec760d1448e2eee739aa7692
treeb56024a482d12e1bb739e561d7d60acf9e7f731e
parent2090565d8e6647b9d60d6f173bacf0d53c2be2c3
bpf, x86: Attach a cookie to fentry/fexit/fmod_ret/lsm.

Pass a cookie along with BPF_LINK_CREATE requests.

Add a bpf_cookie field to struct bpf_tracing_link to attach a cookie.
The cookie of a bpf_tracing_link is available by calling
bpf_get_attach_cookie when running the BPF program of the attached
link.

The value of a cookie will be set at bpf_tramp_run_ctx by the
trampoline of the link.

Signed-off-by: Kui-Feng Lee <kuifeng@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220510205923.3206889-4-kuifeng@fb.com
arch/x86/net/bpf_jit_comp.c
include/linux/bpf.h
include/uapi/linux/bpf.h
kernel/bpf/bpf_lsm.c
kernel/bpf/syscall.c
kernel/bpf/trampoline.c
kernel/trace/bpf_trace.c
tools/include/uapi/linux/bpf.h