]> git.proxmox.com Git - mirror_ubuntu-eoan-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)
commit303def35f64e37bcd5401d202889f5fbc0241179
tree2ec1213038df81591e3b99242116a3ae5239e4fe
parent1cb61381e72ea2426511c0fb63176baf952bcd9f
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