From: Stanislav Fomichev <sdf@google.com>
To: netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
Stanislav Fomichev <sdf@google.com>
Subject: [PATCH bpf-next v10 08/11] libbpf: add lsm_cgoup_sock type
Date: Wed, 22 Jun 2022 09:03:43 -0700 [thread overview]
Message-ID: <20220622160346.967594-9-sdf@google.com> (raw)
In-Reply-To: <20220622160346.967594-1-sdf@google.com>
lsm_cgroup/ is the prefix for BPF_LSM_CGROUP.
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
---
tools/lib/bpf/libbpf.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 49e359cd34df..8de7628a199b 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -107,6 +107,7 @@ static const char * const attach_type_name[] = {
[BPF_TRACE_FEXIT] = "trace_fexit",
[BPF_MODIFY_RETURN] = "modify_return",
[BPF_LSM_MAC] = "lsm_mac",
+ [BPF_LSM_CGROUP] = "lsm_cgroup",
[BPF_SK_LOOKUP] = "sk_lookup",
[BPF_TRACE_ITER] = "trace_iter",
[BPF_XDP_DEVMAP] = "xdp_devmap",
@@ -9203,6 +9204,7 @@ static const struct bpf_sec_def section_defs[] = {
SEC_DEF("freplace+", EXT, 0, SEC_ATTACH_BTF, attach_trace),
SEC_DEF("lsm+", LSM, BPF_LSM_MAC, SEC_ATTACH_BTF, attach_lsm),
SEC_DEF("lsm.s+", LSM, BPF_LSM_MAC, SEC_ATTACH_BTF | SEC_SLEEPABLE, attach_lsm),
+ SEC_DEF("lsm_cgroup+", LSM, BPF_LSM_CGROUP, SEC_ATTACH_BTF),
SEC_DEF("iter+", TRACING, BPF_TRACE_ITER, SEC_ATTACH_BTF, attach_iter),
SEC_DEF("iter.s+", TRACING, BPF_TRACE_ITER, SEC_ATTACH_BTF | SEC_SLEEPABLE, attach_iter),
SEC_DEF("syscall", SYSCALL, 0, SEC_SLEEPABLE),
@@ -9656,6 +9658,7 @@ void btf_get_kernel_prefix_kind(enum bpf_attach_type attach_type,
*kind = BTF_KIND_TYPEDEF;
break;
case BPF_LSM_MAC:
+ case BPF_LSM_CGROUP:
*prefix = BTF_LSM_PREFIX;
*kind = BTF_KIND_FUNC;
break;
--
2.37.0.rc0.104.g0611611a94-goog
next prev parent reply other threads:[~2022-06-22 16:04 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-22 16:03 [PATCH bpf-next v10 00/11] bpf: cgroup_sock lsm flavor Stanislav Fomichev
2022-06-22 16:03 ` [PATCH bpf-next v10 01/11] bpf: add bpf_func_t and trampoline helpers Stanislav Fomichev
2022-06-22 16:03 ` [PATCH bpf-next v10 02/11] bpf: convert cgroup_bpf.progs to hlist Stanislav Fomichev
2022-06-22 16:03 ` [PATCH bpf-next v10 03/11] bpf: per-cgroup lsm flavor Stanislav Fomichev
2022-06-23 22:40 ` Martin KaFai Lau
2022-06-22 16:03 ` [PATCH bpf-next v10 04/11] bpf: minimize number of allocated lsm slots per program Stanislav Fomichev
2022-06-23 22:41 ` Martin KaFai Lau
2022-06-22 16:03 ` [PATCH bpf-next v10 05/11] bpf: implement BPF_PROG_QUERY for BPF_LSM_CGROUP Stanislav Fomichev
2022-06-22 16:03 ` [PATCH bpf-next v10 06/11] bpf: expose bpf_{g,s}etsockopt to lsm cgroup Stanislav Fomichev
2022-06-23 22:43 ` Martin KaFai Lau
2022-06-22 16:03 ` [PATCH bpf-next v10 07/11] tools/bpf: Sync btf_ids.h to tools Stanislav Fomichev
2022-06-23 22:54 ` Martin KaFai Lau
2022-06-22 16:03 ` Stanislav Fomichev [this message]
2022-06-23 22:54 ` [PATCH bpf-next v10 08/11] libbpf: add lsm_cgoup_sock type Martin KaFai Lau
2022-06-22 16:03 ` [PATCH bpf-next v10 09/11] libbpf: implement bpf_prog_query_opts Stanislav Fomichev
2022-06-23 22:58 ` Martin KaFai Lau
2022-06-22 16:03 ` [PATCH bpf-next v10 10/11] bpftool: implement cgroup tree for BPF_LSM_CGROUP Stanislav Fomichev
2022-06-23 22:58 ` Martin KaFai Lau
2022-06-22 16:03 ` [PATCH bpf-next v10 11/11] selftests/bpf: lsm_cgroup functional test Stanislav Fomichev
2022-06-23 22:36 ` Martin KaFai Lau
2022-06-23 23:48 ` Stanislav Fomichev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220622160346.967594-9-sdf@google.com \
--to=sdf@google.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).