From 1b8ebdcaa87736bdfda8185b6223365853caab2c Mon Sep 17 00:00:00 2001 From: Roman Gushchin Date: Sat, 28 Nov 2020 10:50:26 +0800 Subject: [PATCH] bpf: don't allow create maps of per-cpu cgroup local storages mainline inclusion from mainline-v4.20-rc1 commit c6fdcd6e0cc4dc316e3eb261025fb0abd69540b9 category: feature bugzilla: 43460 CVE: NA --------------------------------------- Explicitly forbid creating map of per-cpu cgroup local storages. This behavior matches the behavior of shared cgroup storages. Signed-off-by: Roman Gushchin Acked-by: Song Liu Cc: Daniel Borkmann Cc: Alexei Starovoitov Signed-off-by: Daniel Borkmann Signed-off-by: liuxin Reviewed-by: Cheng Jian Signed-off-by: Yang Yingliang --- 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 9670ee5ee74e..52378d3e34b3 100644 --- a/kernel/bpf/map_in_map.c +++ b/kernel/bpf/map_in_map.c @@ -25,7 +25,8 @@ struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd) * in the verifier is not enough. */ if (inner_map->map_type == BPF_MAP_TYPE_PROG_ARRAY || - inner_map->map_type == BPF_MAP_TYPE_CGROUP_STORAGE) { + inner_map->map_type == BPF_MAP_TYPE_CGROUP_STORAGE || + inner_map->map_type == BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE) { fdput(f); return ERR_PTR(-ENOTSUPP); } -- GitLab