bpf: export bpf_link_inc_not_zero.

[ Upstream commit 67c3e8353f45c27800eecc46e00e8272f063f7d1 ]

bpf_link_inc_not_zero() will be used by kernel modules.  We will use it in
bpf_testmod.c later.

BUG=b/496504997
TEST=presubmit
RELEASE_NOTE=Fixed CVE-2026-23319 in the Linux kernel.

cos-patch: security-moderate
Change-Id: I9052447e90f47593355123e922d175438603ebb2
Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
Link: https://lore.kernel.org/r/20240530065946.979330-5-thinker.li@gmail.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Stable-dep-of: 56145d237385 ("bpf: Fix a UAF issue in bpf_trampoline_link_cgroup_shim")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: chenglongtang <chenglongtang@google.com>
Reviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/143829
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
Reviewed-by: Kevin Liu <zhihuil@google.com>
2 files changed