From: Song Liu <song@kernel.org>
To: bpf@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org
Cc: kernel-team@meta.com, andrii@kernel.org, eddyz87@gmail.com,
ast@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev,
viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz,
kpsingh@kernel.org, mattbobrowski@google.com, amir73il@gmail.com,
repnop@google.com, jlayton@kernel.org, josef@toxicpanda.com,
mic@digikod.net, gnoack@google.com, Song Liu <song@kernel.org>
Subject: [PATCH v3 bpf-next 0/4] Make inode storage available to tracing prog
Date: Tue, 12 Nov 2024 16:53:47 -0800 [thread overview]
Message-ID: <20241113005351.2197340-1-song@kernel.org> (raw)
bpf inode local storage can be useful beyond LSM programs. For example,
bcc/libbpf-tools file* can use inode local storage to simplify the logic.
This set makes inode local storage available to tracing program.
1/4 is missing change for bpf task local storage. 2/4 move inode local
storage from security blob to inode.
Similar to task local storage in tracing program, it is necessary to add
recursion prevention logic for inode local storage. Patch 3/4 adds such
logic, and 4/4 add a test for the recursion prevention logic.
Changes v2 => v3:
1. Move bpf_inode_storage_free to i_callback(). (Martin)
2. Fix __bpf_inode_storage_get(). (Martin)
Changes v1 => v2:
1. Rebase.
2. Fix send-email mistake.
Song Liu (4):
bpf: lsm: Remove hook to bpf_task_storage_free
bpf: Make bpf inode storage available to tracing program
bpf: Add recursion prevention logic for inode storage
selftest/bpf: Test inode local storage recursion prevention
fs/inode.c | 2 +
include/linux/bpf.h | 9 +
include/linux/bpf_lsm.h | 29 ---
include/linux/fs.h | 4 +
kernel/bpf/Makefile | 3 +-
kernel/bpf/bpf_inode_storage.c | 185 +++++++++++++-----
kernel/bpf/bpf_lsm.c | 4 -
kernel/trace/bpf_trace.c | 8 +
security/bpf/hooks.c | 7 -
tools/testing/selftests/bpf/DENYLIST.s390x | 1 +
.../bpf/prog_tests/inode_local_storage.c | 72 +++++++
.../bpf/progs/inode_storage_recursion.c | 90 +++++++++
12 files changed, 321 insertions(+), 93 deletions(-)
create mode 100644 tools/testing/selftests/bpf/prog_tests/inode_local_storage.c
create mode 100644 tools/testing/selftests/bpf/progs/inode_storage_recursion.c
--
2.43.5
next reply other threads:[~2024-11-13 0:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 0:53 Song Liu [this message]
2024-11-13 0:53 ` [PATCH v3 bpf-next 1/4] bpf: lsm: Remove hook to bpf_task_storage_free Song Liu
2024-11-13 0:53 ` [PATCH v3 bpf-next 2/4] bpf: Make bpf inode storage available to tracing program Song Liu
2024-11-13 0:53 ` [PATCH v3 bpf-next 3/4] bpf: Add recursion prevention logic for inode storage Song Liu
2024-11-13 0:53 ` [PATCH v3 bpf-next 4/4] selftest/bpf: Test inode local storage recursion prevention Song Liu
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=20241113005351.2197340-1-song@kernel.org \
--to=song@kernel.org \
--cc=amir73il@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=gnoack@google.com \
--cc=jack@suse.cz \
--cc=jlayton@kernel.org \
--cc=josef@toxicpanda.com \
--cc=kernel-team@meta.com \
--cc=kpsingh@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mattbobrowski@google.com \
--cc=mic@digikod.net \
--cc=repnop@google.com \
--cc=viro@zeniv.linux.org.uk \
/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).