From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Jiri Olsa <jolsa@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
lkml <linux-kernel@vger.kernel.org>,
netdev@vger.kernel.org, Lance Digby <ldigby@redhat.com>
Subject: Re: [PATCH] bpftool: Fix prog dump by tag
Date: Fri, 18 Jan 2019 11:16:03 -0800 [thread overview]
Message-ID: <20190118111603.5f0d7206@cakuba.netronome.com> (raw)
In-Reply-To: <20190118125817.10763-1-jolsa@kernel.org>
On Fri, 18 Jan 2019 13:58:17 +0100, Jiri Olsa wrote:
> Lance reported an issue with bpftool not being able to
> dump program if there are more programs loaded and you
> want to dump any but the first program, like:
>
> # bpftool prog
> 28: kprobe name trace_req_start tag 1dfc28ba8b3dd597 gpl
> loaded_at 2019-01-18T17:02:40+1100 uid 0
> xlated 112B jited 109B memlock 4096B map_ids 13
> 29: kprobe name trace_req_compl tag 5b6a5ecc6030a683 gpl
> loaded_at 2019-01-18T17:02:40+1100 uid 0
> xlated 928B jited 575B memlock 4096B map_ids 13,14
> # bpftool prog dum jited tag 1dfc28ba8b3dd597
> 0: push %rbp
> 1: mov %rsp,%rbp
> ...
>
> # bpftool prog dum jited tag 5b6a5ecc6030a683
> Error: can't get prog info (29): Bad address
>
> The problem is in the prog_fd_by_tag function not cleaning
> the struct bpf_prog_info before another request, so the
> previous program length is still in there and kernel assumes
> it needs to dump the program, which fails because there's no
> user pointer set.
>
> Moving the struct bpf_prog_info declaration into the loop,
> so it gets cleaned before each query.
>
> Reported-by: Lance Digby <ldigby@redhat.com>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Aw.
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Thanks!
next prev parent reply other threads:[~2019-01-18 19:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-18 12:58 Jiri Olsa
2019-01-18 18:19 ` Quentin Monnet
2019-01-18 19:16 ` Jakub Kicinski [this message]
2019-01-23 8:58 ` Daniel Borkmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190118111603.5f0d7206@cakuba.netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=jolsa@kernel.org \
--cc=ldigby@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®