Re: [bpf-next PATCH] bpf: fix bpftool without skeleton code enabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 2, 2020 at 10:25 AM John Fastabend <john.fastabend@xxxxxxxxx> wrote:
>
> Fix segfault from bpftool by adding emit_obj_refs_plain when skeleton
> code is disabled.
>
> Tested by deleting BUILD_BPF_SKELS in Makefile.
>
> # ./bpftool prog show
> Error: bpftool built without PID iterator support
> 3: cgroup_skb  tag 7be49e3934a125ba  gpl
>         loaded_at 2020-07-01T08:01:29-0700  uid 0
> Segmentation fault
>
> Signed-off-by: John Fastabend <john.fastabend@xxxxxxxxx>
> ---

My bad, thanks for the fix!

Acked-by: Andrii Nakryiko <andriin@xxxxxx>

>  tools/bpf/bpftool/pids.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/bpf/bpftool/pids.c b/tools/bpf/bpftool/pids.c
> index 2709be4de2b1..7d5416667c85 100644
> --- a/tools/bpf/bpftool/pids.c
> +++ b/tools/bpf/bpftool/pids.c
> @@ -19,6 +19,7 @@ int build_obj_refs_table(struct obj_refs_table *table, enum bpf_obj_type type)
>         return -ENOTSUP;
>  }
>  void delete_obj_refs_table(struct obj_refs_table *table) {}
> +void emit_obj_refs_plain(struct obj_refs_table *table, __u32 id, const char *prefix) {}
>
>  #else /* BPFTOOL_WITHOUT_SKELETONS */
>
>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux