[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250412170626.3638516-1-kafai.wan@hotmail.com>
Date: Sun, 13 Apr 2025 01:06:24 +0800
From: KaFai Wan <mannkafai@...il.com>
To: martin.lau@...ux.dev,
ast@...nel.org,
daniel@...earbox.net,
andrii@...nel.org,
eddyz87@...il.com,
song@...nel.org,
yonghong.song@...ux.dev,
john.fastabend@...il.com,
kpsingh@...nel.org,
sdf@...ichev.me,
haoluo@...gle.com,
jolsa@...nel.org,
mykolal@...com,
shuah@...nel.org,
memxor@...il.com
Cc: bpf@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org,
kafai.wan@...mail.com,
leon.hwang@...ux.dev
Subject: [PATCH bpf-next 0/2] bpf: Allow access to const void pointer arguments in tracing programs
hi,
Tracing programs can access arguments via BTF [1]. Currently we allow
tracing programs to access pointers to string (char pointer),
void pointers, pointers to structs, and int pointers [2].
If we try to access argument which is pointer to const void like 2nd
argument in kfree, it's an UNKNOWN type, verifier will fail to load.
typedef void (*btf_trace_kfree)(void *, long unsigned int, const void *);
[1] https://lore.kernel.org/bpf/20191016032505.2089704-7-ast@kernel.org/
[2] https://lore.kernel.org/bpf/20211208193245.172141-1-jolsa@kernel.org/
---
KaFai Wan (2):
bpf: Allow access to const void pointer arguments in tracing programs
selftests/bpf: Add test to access const void pointer argument in
tracing program
kernel/bpf/btf.c | 10 +++++++++-
.../selftests/bpf/progs/verifier_btf_ctx_access.c | 9 +++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
--
2.43.0
Powered by blists - more mailing lists