netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 5/7] libbpf: add lsm_cgoup_sock type
Date: Mon, 28 Mar 2022 11:16:42 -0700	[thread overview]
Message-ID: <20220328181644.1748789-6-sdf@google.com> (raw)
In-Reply-To: <20220328181644.1748789-1-sdf@google.com>

lsm_cgroup/ is the prefix for BPF_LSM_CGROUP.

Signed-off-by: Stanislav Fomichev <sdf@google.com>
---
 tools/lib/bpf/libbpf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 809fe209cdcc..195c9f078726 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -8666,6 +8666,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),
@@ -9087,6 +9088,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.35.1.1021.g381101b075-goog


  parent reply	other threads:[~2022-03-28 18:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28 18:16 [PATCH bpf-next 0/7] bpf: cgroup_sock lsm flavor Stanislav Fomichev
2022-03-28 18:16 ` [PATCH bpf-next 1/7] bpf: add bpf_func_t and trampoline helpers Stanislav Fomichev
2022-03-28 18:16 ` [PATCH bpf-next 2/7] bpf: per-cgroup lsm flavor Stanislav Fomichev
2022-03-28 22:36   ` kernel test robot
2022-03-28 22:36   ` kernel test robot
2022-03-28 18:16 ` [PATCH bpf-next 3/7] bpf: minimize number of allocated lsm slots per program Stanislav Fomichev
2022-03-28 18:16 ` [PATCH bpf-next 4/7] bpf: allow writing to a subset of sock fields from lsm progtype Stanislav Fomichev
2022-03-28 18:16 ` Stanislav Fomichev [this message]
2022-03-28 18:16 ` [PATCH bpf-next 6/7] selftests/bpf: lsm_cgroup functional test Stanislav Fomichev
2022-03-28 18:16 ` [PATCH bpf-next 7/7] selftests/bpf: verify lsm_cgroup struct sock access 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=20220328181644.1748789-6-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).