-
- Downloads
bpf: Add a bpf_sock_from_file helper
While eBPF programs can check whether a file is a socket by file->f_op == &socket_file_ops, they cannot convert the void private_data pointer to a struct socket BTF pointer. In order to do this a new helper wrapping sock_from_file is added. This is useful to tracing programs but also other program types inheriting this set of helpers such as iterators or LSM programs. Signed-off-by:Florent Revest <revest@google.com> Signed-off-by:
Daniel Borkmann <daniel@iogearbox.net> Acked-by:
KP Singh <kpsingh@google.com> Acked-by:
Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/20201204113609.1850150-2-revest@google.com
Showing
- include/uapi/linux/bpf.h 9 additions, 0 deletionsinclude/uapi/linux/bpf.h
- kernel/trace/bpf_trace.c 20 additions, 0 deletionskernel/trace/bpf_trace.c
- scripts/bpf_helpers_doc.py 4 additions, 0 deletionsscripts/bpf_helpers_doc.py
- tools/include/uapi/linux/bpf.h 9 additions, 0 deletionstools/include/uapi/linux/bpf.h
Loading
Please register or sign in to comment