diff options
author | 2020-07-28 17:31:03 -0700 | |
---|---|---|
committer | 2020-07-31 00:43:49 +0200 | |
commit | f7c6cb1d9728dea9d9f131ef57303d6821afb0f8 (patch) | |
tree | efcd85c497731da021576fe64c411bfbb3045eee /net/ipv6 | |
parent | selftests/bpf: Test bpf_iter buffer access with negative offset (diff) | |
download | wireguard-linux-f7c6cb1d9728dea9d9f131ef57303d6821afb0f8.tar.xz wireguard-linux-f7c6cb1d9728dea9d9f131ef57303d6821afb0f8.zip |
bpf: Expose socket storage to BPF_PROG_TYPE_CGROUP_SOCK
This lets us use socket storage from the following hooks:
* BPF_CGROUP_INET_SOCK_CREATE
* BPF_CGROUP_INET_SOCK_RELEASE
* BPF_CGROUP_INET4_POST_BIND
* BPF_CGROUP_INET6_POST_BIND
Using existing 'bpf_sk_storage_get_proto' doesn't work because
second argument is ARG_PTR_TO_SOCKET. Even though
BPF_PROG_TYPE_CGROUP_SOCK hooks operate on 'struct bpf_sock',
the verifier still considers it as a PTR_TO_CTX.
That's why I'm adding another 'bpf_sk_storage_get_cg_sock_proto'
definition strictly for BPF_PROG_TYPE_CGROUP_SOCK which accepts
ARG_PTR_TO_CTX which is really 'struct sock' for this program type.
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20200729003104.1280813-1-sdf@google.com
Diffstat (limited to 'net/ipv6')
0 files changed, 0 insertions, 0 deletions