From: Levi Zim via B4 Relay <devnull+rsworktech.outlook.com@kernel.org>
To: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@fomichev.me>,
Hao Luo <haoluo@google.com>, Jiri Olsa <jolsa@kernel.org>,
Matt Bobrowski <mattbobrowski@google.com>,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Mykola Lysenko <mykolal@fb.com>, Shuah Khan <shuah@kernel.org>
Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-trace-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org,
Andrii Nakryiko <andrii.nakryiko@gmail.com>,
Levi Zim <rsworktech@outlook.com>
Subject: [PATCH 0/7] bpf: Add probe_read_{kernel,user}_dynptr and copy_from_user_dynptr
Date: Sat, 25 Jan 2025 16:23:35 +0800 [thread overview]
Message-ID: <20250125-bpf_dynptr_probe-v1-0-c3cb121f6951@outlook.com> (raw)
This series introduce the dynptr counterpart of the
bpf_probe_read_{kernel,user} helpers and bpf_copy_from_user helper.
These helpers are helpful for reading variable-length data from kernel
memory into dynptr without going through an intermediate buffer.
Link: https://lore.kernel.org/bpf/MEYP282MB2312CFCE5F7712FDE313215AC64D2@MEYP282MB2312.AUSP282.PROD.OUTLOOK.COM/
Suggested-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Signed-off-by: Levi Zim <rsworktech@outlook.com>
---
Levi Zim (7):
bpf: Implement bpf_probe_read_kernel_dynptr helper
bpf: Implement bpf_probe_read_user_dynptr helper
bpf: Implement bpf_copy_from_user_dynptr helper
tools headers UAPI: Update tools's copy of bpf.h header
selftests/bpf: probe_read_kernel_dynptr test
selftests/bpf: probe_read_user_dynptr test
selftests/bpf: copy_from_user_dynptr test
include/linux/bpf.h | 3 +
include/uapi/linux/bpf.h | 49 ++++++++++
kernel/bpf/helpers.c | 53 ++++++++++-
kernel/trace/bpf_trace.c | 72 ++++++++++++++
tools/include/uapi/linux/bpf.h | 49 ++++++++++
tools/testing/selftests/bpf/prog_tests/dynptr.c | 45 ++++++++-
tools/testing/selftests/bpf/progs/dynptr_success.c | 106 +++++++++++++++++++++
7 files changed, 374 insertions(+), 3 deletions(-)
---
base-commit: d0d106a2bd21499901299160744e5fe9f4c83ddb
change-id: 20250124-bpf_dynptr_probe-ab483c554f1a
Best regards,
--
Levi Zim <rsworktech@outlook.com>
next reply other threads:[~2025-01-25 8:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-25 8:23 Levi Zim via B4 Relay [this message]
2025-01-25 8:23 ` [PATCH 1/7] bpf: Implement bpf_probe_read_kernel_dynptr helper Levi Zim via B4 Relay
2025-01-25 8:23 ` [PATCH 2/7] bpf: Implement bpf_probe_read_user_dynptr helper Levi Zim via B4 Relay
2025-01-25 8:23 ` [PATCH 3/7] bpf: Implement bpf_copy_from_user_dynptr helper Levi Zim via B4 Relay
2025-01-25 8:23 ` [PATCH 4/7] tools headers UAPI: Update tools's copy of bpf.h header Levi Zim via B4 Relay
2025-01-25 8:23 ` [PATCH 5/7] selftests/bpf: probe_read_kernel_dynptr test Levi Zim via B4 Relay
2025-01-25 8:23 ` [PATCH 6/7] selftests/bpf: probe_read_user_dynptr test Levi Zim via B4 Relay
2025-01-25 8:23 ` [PATCH 7/7] selftests/bpf: copy_from_user_dynptr test Levi Zim via B4 Relay
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=20250125-bpf_dynptr_probe-v1-0-c3cb121f6951@outlook.com \
--to=devnull+rsworktech.outlook.com@kernel.org \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mathieu.desnoyers@efficios.com \
--cc=mattbobrowski@google.com \
--cc=mhiramat@kernel.org \
--cc=mykolal@fb.com \
--cc=rostedt@goodmis.org \
--cc=rsworktech@outlook.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/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
all inboxes | Powered by JetHome®