]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit143586412d9a8e045a4f2511df2176bfa708c4d4
tree825c4684143951754d5490aec16495733e0c6a48
parent26bb41767e1079dcb7988d5be7a645323703cbcc
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