bpf: tcp: Support bpf_(get|set)sockopt in bpf tcp iter
This patch allows bpf tcp iter to call bpf_(get|set)sockopt. To allow a specific bpf iter (tcp here) to call a set of helpers, get_func_proto function pointer is added to bpf_iter_reg. The bpf iter is a tracing prog which currently requires CAP_PERFMON or CAP_SYS_ADMIN, so this patch does not impose other capability checks for bpf_(get|set)sockopt. Signed-off-by:Martin KaFai Lau <kafai@fb.com> Signed-off-by:
Andrii Nakryiko <andrii@kernel.org> Reviewed-by:
Eric Dumazet <edumazet@google.com> Acked-by:
Kuniyuki Iwashima <kuniyu@amazon.co.jp> Acked-by:
Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20210701200619.1036715-1-kafai@fb.com
Showing
- include/linux/bpf.h 8 additions, 0 deletionsinclude/linux/bpf.h
- kernel/bpf/bpf_iter.c 22 additions, 0 deletionskernel/bpf/bpf_iter.c
- kernel/trace/bpf_trace.c 6 additions, 1 deletionkernel/trace/bpf_trace.c
- net/core/filter.c 34 additions, 0 deletionsnet/core/filter.c
- net/ipv4/tcp_ipv4.c 15 additions, 0 deletionsnet/ipv4/tcp_ipv4.c
Loading
Please register or sign in to comment