If we try to access argument which is pointer to const void, it's an
UNKNOWN type, verifier will fail to load.
Use is_void_or_int_ptr to check if type is void or int pointer.
Add a selftest to check it.
---
KaFai Wan (2):
bpf: Allow access to const void pointer arguments in tracing pro
Adding verifier test for accessing const void pointer argument in
tracing programs.
The test program loads 1st argument of bpf_fentry_test10 function
which is const void pointer and checks that verifier allows that.
Signed-off-by: KaFai Wan
---
net/bpf/test_run.c
On Mon, Apr 14, 2025 at 6:35 PM Jiri Olsa wrote:
>
> On Sun, Apr 13, 2025 at 01:06:26AM +0800, KaFai Wan wrote:
> > Adding verifier test for accessing const void pointer argument in
> > tracing programs.
> >
> > The test program loads 2nd argument of kfree tp_btf w
Adding verifier test for accessing const void pointer argument in
tracing programs.
The test program loads 1st argument of bpf_fentry_test10 function
which is const void pointer and checks that verifier allows that.
Signed-off-by: KaFai Wan
Acked-by: Jiri Olsa
---
net/bpf/test_run.c
() R10=fp0
; asm volatile ("r2 = *(u64 *)(r1 + 8); ");
0: (79) r2 = *(u64 *)(r1 +8)
func 'kfree' arg1 type UNKNOWN is not a struct
Changing the is_int_ptr to void and generic integer check and renaming
it to is_void_or_int_ptr.
Cc: Leon Hwang
Signed-off-by: KaFai Wan
If we try to access argument which is pointer to const void, it's an
UNKNOWN type, verifier will fail to load.
Use is_void_or_int_ptr to check if type is void or int pointer.
Add a selftest to check it.
---
KaFai Wan (2):
bpf: Allow access to const void pointer arguments in tracing pro
;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-...@kernel.org/
[2] https://lore.kernel.org/bpf/20211208193245.172141-1-jo...@kernel.org/
---
KaFai Wan (2):
bpf: Allow a
() R10=fp0
; asm volatile ("r2 = *(u64 *)(r1 + 8); ");
0: (79) r2 = *(u64 *)(r1 +8)
func 'kfree' arg1 type UNKNOWN is not a struct
Adding is_void_ptr to generic void pointer check.
Cc: Leon Hwang
Signed-off-by: KaFai Wan
---
kernel/bpf/btf.c | 10 +-
1 file changed
Adding verifier test for accessing const void pointer argument in
tracing programs.
The test program loads 2nd argument of kfree tp_btf which is
const void pointer and checks that verifier allows that.
Signed-off-by: KaFai Wan
---
.../selftests/bpf/progs/verifier_btf_ctx_access.c| 9
Adding verifier test for accessing const void pointer argument in
tracing programs.
The test program loads 1st argument of bpf_fentry_test10 function
which is const void pointer and checks that verifier allows that.
Signed-off-by: KaFai Wan
---
net/bpf/test_run.c
() R10=fp0
; asm volatile ("r2 = *(u64 *)(r1 + 8); ");
0: (79) r2 = *(u64 *)(r1 +8)
func 'kfree' arg1 type UNKNOWN is not a struct
Changing the is_int_ptr to void and generic integer check and renaming
it to is_void_or_int_ptr.
Cc: Leon Hwang
Signed-off-by: KaFai Wan
---
If we try to access argument which is pointer to const void, it's an
UNKNOWN type, verifier will fail to load.
Use is_void_or_int_ptr to check if type is void or int pointer.
And fix selftests.
---
KaFai Wan (2):
bpf: Allow access to const void pointer arguments in tracing pro
On Mon, Apr 14, 2025 at 6:35 PM Jiri Olsa wrote:
>
> On Sun, Apr 13, 2025 at 01:06:25AM +0800, KaFai Wan wrote:
> > Adding support to access arguments with const void pointer arguments
> > in tracing programs.
> >
> > Currently we allow tracing programs to acce
13 matches
Mail list logo