]> www.infradead.org Git - users/dwmw2/linux.git/commit
bpf: fix rcu annotations in compute_effective_progs()
authorRoman Gushchin <guro@fb.com>
Fri, 13 Jul 2018 19:41:11 +0000 (12:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:39:36 +0000 (08:39 +0200)
commitf90ccc03b438895bcc4cda3d2d8eac858e0e688e
tree67ac0589d84e71138e2833e2f6e5893a8751b351
parent5e1002ab5c9bde81a0c1eed12f243987e98f7bd0
bpf: fix rcu annotations in compute_effective_progs()

[ Upstream commit 3960f4fd6585608e8cc285d9665821985494e147 ]

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().

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/bpf/cgroup.c