Commit 1271a40
bpf: Allow access to const void pointer arguments in tracing programs
Adding support to access arguments with const void pointer arguments
in tracing programs.
Currently we allow tracing programs to access void pointers. If we try to
access argument which is pointer to const void like 2nd argument in kfree,
verifier will fail to load the program with;
0: R1=ctx() 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.
Signed-off-by: KaFai Wan <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]1 parent 6aca583 commit 1271a40
1 file changed
+7
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6383 | 6383 | | |
6384 | 6384 | | |
6385 | 6385 | | |
6386 | | - | |
| 6386 | + | |
6387 | 6387 | | |
6388 | 6388 | | |
6389 | 6389 | | |
6390 | | - | |
6391 | | - | |
| 6390 | + | |
6392 | 6391 | | |
6393 | 6392 | | |
6394 | 6393 | | |
| |||
6776 | 6775 | | |
6777 | 6776 | | |
6778 | 6777 | | |
6779 | | - | |
6780 | | - | |
6781 | | - | |
6782 | | - | |
6783 | | - | |
6784 | | - | |
6785 | | - | |
6786 | | - | |
| 6778 | + | |
| 6779 | + | |
| 6780 | + | |
| 6781 | + | |
| 6782 | + | |
6787 | 6783 | | |
6788 | 6784 | | |
6789 | 6785 | | |
| |||
0 commit comments