]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf: drop KF_ACQUIRE flag on BPF kfunc bpf_get_root_mem_cgroup()
authorMatt Bobrowski <mattbobrowski@google.com>
Tue, 13 Jan 2026 08:39:48 +0000 (08:39 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 14 Jan 2026 03:19:13 +0000 (19:19 -0800)
commite463b6de9da17995a2ddabf199cc00c65a8a5392
tree1aa82c4f372e9d8491e848f1e92ef78f08da1334
parentf8ade2342e22e7dbc71af496f07c900f8c69dd54
bpf: drop KF_ACQUIRE flag on BPF kfunc bpf_get_root_mem_cgroup()

With the BPF verifier now treating pointers to struct types returned
from BPF kfuncs as implicitly trusted by default, there is no need for
bpf_get_root_mem_cgroup() to be annotated with the KF_ACQUIRE flag.

bpf_get_root_mem_cgroup() does not acquire any references, but rather
simply returns a NULL pointer or a pointer to a struct mem_cgroup
object that is valid for the entire lifetime of the kernel.

This simplifies BPF programs using this kfunc by removing the
requirement to pair the call with bpf_put_mem_cgroup().

Signed-off-by: Matt Bobrowski <mattbobrowski@google.com>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20260113083949.2502978-2-mattbobrowski@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
mm/bpf_memcontrol.c