]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
bpf: pass sk to helper functions
authorWillem de Bruijn <willemb@google.com>
Tue, 11 Apr 2017 18:08:08 +0000 (14:08 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 11 Apr 2017 18:54:19 +0000 (14:54 -0400)
commit8f917bba0042f1e3b7693743fbe9782709e936e7
tree5adc788308ed37a25a9911c42149638052f24b47
parentcb6bf9cfdb5e26dfb7eb9b955b2f24d82703e27d
bpf: pass sk to helper functions

BPF helper functions access socket fields through skb->sk. This is not
set in ingress cgroup and socket filters. The association is only made
in skb_set_owner_r once the filter has accepted the packet. Sk is
available as socket lookup has taken place.

Temporarily set skb->sk to sk in these cases.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/bpf/cgroup.c
net/core/filter.c