bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: Quentin Monnet <quentin.monnet@netronome.com>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	Jiri Olsa <jolsa@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Michael Petlan <mpetlan@redhat.com>,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	Martin KaFai Lau <kafai@fb.com>
Subject: Re: [PATCHv2] tools bpftool: Fix json dump crash on powerpc
Date: Tue, 9 Jul 2019 19:53:33 +0200	[thread overview]
Message-ID: <20190709175333.GE9579@krava> (raw)
In-Reply-To: <5168f635-a23c-eac3-479d-747e55adfc4c@iogearbox.net>

On Sat, Jul 06, 2019 at 12:00:44AM +0200, Daniel Borkmann wrote:
> On 07/05/2019 07:26 PM, Quentin Monnet wrote:
> > 2019-07-05 10:24 UTC-0700 ~ Jakub Kicinski <jakub.kicinski@netronome.com>
> >> On Fri, 5 Jul 2019 14:10:31 +0200, Jiri Olsa wrote:
> >>> Michael reported crash with by bpf program in json mode on powerpc:
> >>>
> >>>   # bpftool prog -p dump jited id 14
> >>>   [{
> >>>         "name": "0xd00000000a9aa760",
> >>>         "insns": [{
> >>>                 "pc": "0x0",
> >>>                 "operation": "nop",
> >>>                 "operands": [null
> >>>                 ]
> >>>             },{
> >>>                 "pc": "0x4",
> >>>                 "operation": "nop",
> >>>                 "operands": [null
> >>>                 ]
> >>>             },{
> >>>                 "pc": "0x8",
> >>>                 "operation": "mflr",
> >>>   Segmentation fault (core dumped)
> >>>
> >>> The code is assuming char pointers in format, which is not always
> >>> true at least for powerpc. Fixing this by dumping the whole string
> >>> into buffer based on its format.
> >>>
> >>> Please note that libopcodes code does not check return values from
> >>> fprintf callback, but as per Jakub suggestion returning -1 on allocation
> >>> failure so we do the best effort to propagate the error. 
> >>>
> >>> Reported-by: Michael Petlan <mpetlan@redhat.com>
> >>> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> >>
> >> Thanks, let me repost all the tags (Quentin, please shout if you're
> >> not ok with this :)):
> > 
> > I confirm it's all good for me, thanks :)
> > 
> >> Fixes: 107f041212c1 ("tools: bpftool: add JSON output for `bpftool prog dump jited *` command")
> >> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
> >> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> 
> Given merge window coming up, I've applied this to bpf-next, thanks everyone!
> 
> P.s.: Jiri, please repost full/proper patch next time instead of inline reply.

will do, thanks
jirka

      reply	other threads:[~2019-07-09 17:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04  8:58 [PATCH] tools bpftool: Fix json dump crash on powerpc Jiri Olsa
2019-07-04 17:37 ` Quentin Monnet
2019-07-04 20:42 ` Jakub Kicinski
2019-07-05 12:10   ` [PATCHv2] " Jiri Olsa
2019-07-05 17:24     ` Jakub Kicinski
2019-07-05 17:26       ` Quentin Monnet
2019-07-05 22:00         ` Daniel Borkmann
2019-07-09 17:53           ` Jiri Olsa [this message]

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=20190709175333.GE9579@krava \
    --to=jolsa@redhat.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=jolsa@kernel.org \
    --cc=kafai@fb.com \
    --cc=mpetlan@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=quentin.monnet@netronome.com \
    /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;
as well as URLs for NNTP newsgroup(s).