Skip to content

Commit 88aa9c3

Browse files
committed
bpf: Fix using struct btf_ptr on 32-bit
struct btf_ptr { void *ptr; __u32 type_id; __u32 flags; }; test_task_btf:PASS:bpf_iter_task_btf__open_and_load 0 nsec do_btf_read:PASS:attach_iter 0 nsec do_btf_read:PASS:create_iter 0 nsec do_btf_read:PASS:read 0 nsec do_btf_read:FAIL:check for btf representation of task_struct in iter data unexpected check for btf representation of task_struct in iter data: '(struct task_struct)' is not a substring of 'Raw BTF task ' test_task_btf:FAIL:no task iteration, did BPF program run? unexpected no task iteration, did BPF program run?: actual 0 == expected 0 torvalds#16/13 bpf_iter/task_btf:FAIL static struct btf_ptr ptr = {}; long ret; [...] ret = bpf_seq_printf_btf(seq, &ptr, sizeof(ptr), 0); --> -EINVAL Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
1 parent ed29d0c commit 88aa9c3

File tree

2 files changed

+2
-2
lines changed
  • include/uapi/linux
  • tools/include/uapi/linux

2 files changed

+2
-2
lines changed

include/uapi/linux/bpf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7526,7 +7526,7 @@ struct bpf_sk_lookup {
75267526
* Display flags - BTF_F_* - are passed to bpf_snprintf_btf separately.
75277527
*/
75287528
struct btf_ptr {
7529-
void *ptr;
7529+
__bpf_md_ptr(void *, ptr);
75307530
__u32 type_id;
75317531
__u32 flags; /* BTF ptr flags; unused at present. */
75327532
};

tools/include/uapi/linux/bpf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7526,7 +7526,7 @@ struct bpf_sk_lookup {
75267526
* Display flags - BTF_F_* - are passed to bpf_snprintf_btf separately.
75277527
*/
75287528
struct btf_ptr {
7529-
void *ptr;
7529+
__bpf_md_ptr(void *, ptr);
75307530
__u32 type_id;
75317531
__u32 flags; /* BTF ptr flags; unused at present. */
75327532
};

0 commit comments

Comments
 (0)