UPSTREAM: bpf: fix rcu annotations in compute_effective_progs()
authorRoman Gushchin <guro@fb.com>
Fri, 13 Jul 2018 19:41:11 +0000 (12:41 -0700)
committerCosmin Tanislav <demonsingur@gmail.com>
Thu, 16 May 2024 07:58:26 +0000 (10:58 +0300)
commit6e0eb72f150cf6a6ac00db1126bb8f371b944717
treeeed31953dc2b9749f223ae53019a97cdaf17fd2f
parent26020be5ef6243cbb7cb032c099a9c6fca01758b
UPSTREAM: bpf: fix rcu annotations in compute_effective_progs()

The progs local variable in compute_effective_progs() is marked
as __rcu, which is not correct. This is a local pointer, which
is initialized by bpf_prog_array_alloc(), which also now
returns a generic non-rcu pointer.

The real rcu-protected pointer is *array (array is a pointer
to an RCU-protected pointer), so the assignment should be performed
using rcu_assign_pointer().

Bug: 254441685
Fixes: 324bda9e6c5a ("bpf: multi program support for cgroup+bpf")
Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
(cherry picked from commit 3960f4fd6585608e8cc285d9665821985494e147)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ia76011cab50355b3342e322e05ec77d0229e9e08
kernel/bpf/cgroup.c