]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: allow sk_msg programs to read sock fields
authorJohn Fastabend <john.fastabend@gmail.com>
Thu, 17 May 2018 21:16:58 +0000 (14:16 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 18 May 2018 20:44:10 +0000 (22:44 +0200)
commit98aa1c71f79645c9d18a20ad6d37fdbeff601c83
tree2ec1213038df81591e3b99242116a3ae5239e4fe
parentc3f9204d1b1992cd2b0301202a8bcd1207ed2c5d
bpf: allow sk_msg programs to read sock fields

Currently sk_msg programs only have access to the raw data. However,
it is often useful when building policies to have the policies specific
to the socket endpoint. This allows using the socket tuple as input
into filters, etc.

This patch adds ctx access to the sock fields.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/filter.h
include/uapi/linux/bpf.h
kernel/bpf/sockmap.c
net/core/filter.c