bpf: Expose bpf_get_socket_cookie to tracing programs
authorFlorent Revest <revest@chromium.org>
Wed, 10 Feb 2021 11:14:03 +0000 (12:14 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 12 Feb 2021 01:44:41 +0000 (17:44 -0800)
commitc5dbb89fc2ac013afe67b9e4fcb3743c02b567cd
tree717c986e70611b002a57850957d7132121c7ec9f
parent07881ccbf40cc7893869f3f170301889ddca54ac
bpf: Expose bpf_get_socket_cookie to tracing programs

This needs a new helper that:
- can work in a sleepable context (using sock_gen_cookie)
- takes a struct sock pointer and checks that it's not NULL

Signed-off-by: Florent Revest <revest@chromium.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: KP Singh <kpsingh@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210210111406.785541-2-revest@chromium.org
include/linux/bpf.h
include/uapi/linux/bpf.h
kernel/trace/bpf_trace.c
net/core/filter.c
tools/include/uapi/linux/bpf.h