All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: kkourt@kkourt.io, Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: dwarves@vger.kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Kornilios Kourtis <kornilios@isovalent.com>
Subject: RE: [PATCH 1/2] pahole: avoid segfault when parsing bogus file
Date: Wed, 16 Mar 2022 21:59:59 -0700	[thread overview]
Message-ID: <6232c04f3c9d2_487f20860@john.notmuch> (raw)
In-Reply-To: <20220316132338.3226871-1-kkourt@kkourt.io>

kkourt@ wrote:
> From: Kornilios Kourtis <kornilios@isovalent.com>
> 
> When trying to use btf encoding for an apparently problematic kernel
> file, pahole segfaults. As can be seen below [1], the problem is that we
> are trying to dereference a NULL decoder.
> 
> Fix this by checking the return value of dwfl_getmodules which [2] whill
> return -1 on errors or an offset if one of the modules did not return
> DWARF_CB_OK. (In this specific case, it was __cus__load_debug_types that
> returned DWARF_CB_ABORT.)
> 

[...]
 
> [2] https://sourceware.org/git/?p=elfutils.git;a=blob;f=libdwfl/libdwfl.h;h=f98f1d525d94bc7bcfc7c816890de5907ee4bd6d;hb=HEAD#l200

Thanks for the reference and fix.

Acked-by: John Fastabend <john.fastabend@gmail.com>

  reply	other threads:[~2022-03-17  5:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04 11:38 [PATCH] pahole: avoid segfault when parsing a problematic file kkourt
2022-03-05 18:49 ` Arnaldo Carvalho de Melo
2022-03-16 13:16   ` Kornilios Kourtis
2022-03-16 13:23     ` [PATCH 1/2] pahole: avoid segfault when parsing bogus file kkourt
2022-03-17  4:59       ` John Fastabend [this message]
2022-03-16 13:23     ` [PATCH 2/2] dwarves: cus__load_files: set errno if load fails kkourt
2022-03-16 20:51       ` Arnaldo Carvalho de Melo
2022-03-16 20:55         ` Kornilios Kourtis
2022-03-17  5:00       ` John Fastabend
2022-03-17 15:19         ` Arnaldo Carvalho de Melo

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=6232c04f3c9d2_487f20860@john.notmuch \
    --to=john.fastabend@gmail.com \
    --cc=acme@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dwarves@vger.kernel.org \
    --cc=kkourt@kkourt.io \
    --cc=kornilios@isovalent.com \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.