From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Gushchin Subject: [PATCH bpf-next 4/9] bpf: don't allow create maps of per-cpu cgroup local storages Date: Fri, 21 Sep 2018 17:14:10 +0000 Message-ID: <20180921171353.11050-4-guro@fb.com> References: <20180921171353.11050-1-guro@fb.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "linux-kernel@vger.kernel.org" , Kernel Team , Roman Gushchin , Daniel Borkmann , Alexei Starovoitov To: "netdev@vger.kernel.org" Return-path: In-Reply-To: <20180921171353.11050-1-guro@fb.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Explicitly forbid creating map of per-cpu cgroup local storages. This behavior matches the behavior of shared cgroup storages. Signed-off-by: Roman Gushchin Cc: Daniel Borkmann Cc: Alexei Starovoitov --- kernel/bpf/map_in_map.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/bpf/map_in_map.c b/kernel/bpf/map_in_map.c index 3bfbf4464416..99d243e1ad6e 100644 --- a/kernel/bpf/map_in_map.c +++ b/kernel/bpf/map_in_map.c @@ -24,7 +24,8 @@ struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd) * in the verifier is not enough. */ if (inner_map->map_type =3D=3D BPF_MAP_TYPE_PROG_ARRAY || - inner_map->map_type =3D=3D BPF_MAP_TYPE_CGROUP_STORAGE) { + inner_map->map_type =3D=3D BPF_MAP_TYPE_CGROUP_STORAGE || + inner_map->map_type =3D=3D BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE) { fdput(f); return ERR_PTR(-ENOTSUPP); } --=20 2.17.1