bpf: Make bpf_cgroup_acquire() KF_RCU | KF_RET_NULL
authorDavid Vernet <void@manifault.com>
Tue, 11 Apr 2023 04:16:31 +0000 (23:16 -0500)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 12 Apr 2023 19:57:54 +0000 (12:57 -0700)
commit1d71283987c729dceccce834a864c27301ba155e
treec0c136a59b58c940a30c09783288b1cedb35624e
parent10fd5f70c397782a97f411f25bfb312ea92b55bc
bpf: Make bpf_cgroup_acquire() KF_RCU | KF_RET_NULL

struct cgroup is already an RCU-safe type in the verifier. We can
therefore update bpf_cgroup_acquire() to be KF_RCU | KF_RET_NULL, and
subsequently remove bpf_cgroup_kptr_get(). This patch does the first of
these by updating bpf_cgroup_acquire() to be KF_RCU | KF_RET_NULL, and
also updates selftests accordingly.

Signed-off-by: David Vernet <void@manifault.com>
Link: https://lore.kernel.org/r/20230411041633.179404-1-void@manifault.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/helpers.c
tools/testing/selftests/bpf/progs/cgrp_kfunc_common.h
tools/testing/selftests/bpf/progs/cgrp_kfunc_failure.c
tools/testing/selftests/bpf/progs/cgrp_kfunc_success.c