bpf: allocate cgroup storage entries on attaching bpf programs
authorRoman Gushchin <guro@fb.com>
Thu, 2 Aug 2018 21:27:20 +0000 (14:27 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 2 Aug 2018 22:47:32 +0000 (00:47 +0200)
commitd7bf2c10af053191e931b58704cd862fccb7f9de
tree825c4684143951754d5490aec16495733e0c6a48
parentaa0ad5b0391e268bdecf6cda31268388844f8afd
bpf: allocate cgroup storage entries on attaching bpf programs

If a bpf program is using cgroup local storage, allocate
a bpf_cgroup_storage structure automatically on attaching the program
to a cgroup and save the pointer into the corresponding bpf_prog_list
entry.
Analogically, release the cgroup local storage on detaching
of the bpf program.

Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/bpf-cgroup.h
kernel/bpf/cgroup.c