public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Evgeny Vereshchagin <evverx@gmail.com>,
	Aleksei Vetrov <vvvvvv@google.com>
Cc: elfutils-devel@sourceware.org
Subject: Re: [PATCH 2/2] libdw: Use elf_rawdata when checking .debug section
Date: Tue, 21 Feb 2023 12:24:43 +0100	[thread overview]
Message-ID: <3eb9eb567539cb118277be6ebc420dce6c55e0d9.camel@klomp.org> (raw)
In-Reply-To: <CAKKs9uh1ci=EZKDC8AEO9hbV1YTAuJvkvBR13wBZegVe6sCKsw@mail.gmail.com>

Hi,

On Tue, 2023-02-21 at 05:28 +0300, Evgeny Vereshchagin wrote:
> On Mon, 20 Feb 2023 at 19:03, Aleksei Vetrov <vvvvvv@google.com> wrote:
> > On Mon, Feb 20, 2023 at 3:55 PM Mark Wielaard <mark@klomp.org> wrote:
> > > 
> > > .debug sections are raw bytes and don't need conversion even when host
> > > and file have different endian order.
> > 
> > Thank you! I like this patch more for its simplicity, looks good to me.
> 
> Agreed. I haven't actually tested the patch though but since it's
> covered by the fuzz
> target it should be tested once it's merged anyway.

I was actually planning on pushing both patches.
This one makes sure the conversion code isn't called, because that is
unnecessary in this case. The first patch adjusts the conversion code
so it doesn't leave some undefined bytes in the section data.

> On a somewhat related looking at some recent patches and especially
> https://sourceware.org/git/?p=elfutils.git;a=commit;h=64ee2cb792e7b6ba6ad2a5759bff7ce8714e4668
> it seems apart from OSS-Fuzz elfutils is fuzzed elsewhere. Aleksei I
> wonder if it would
> be possible to add those fuzz targets to OSS-Fuzz? There are blind
> spots there and I think it would be
> really great to start covering at least some of them.

I do often run a fuzzer (afl with --enable-sanitize-undefined and --
enable-sanitize-address with CC="afl-gcc -m32") when writing a new
testcase. Some testcases are nice as fuzz targets because they test
just one function, so running the fuzzer for a couple of hours exhausts
the different input values.

Cheers,

Mark

  reply	other threads:[~2023-02-21 11:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20 15:55 Fix some .debug checking and gnu hash xlate logic Mark Wielaard
2023-02-20 15:55 ` [PATCH 1/2] libelf: memmove any extra bytes left by elf_cvt_gnuhash conversion Mark Wielaard
2023-02-20 15:55 ` [PATCH 2/2] libdw: Use elf_rawdata when checking .debug section Mark Wielaard
2023-02-20 16:02   ` Aleksei Vetrov
2023-02-21  2:28     ` Evgeny Vereshchagin
2023-02-21 11:24       ` Mark Wielaard [this message]
2023-02-23 10:20         ` Mark Wielaard
2023-02-21 16:40       ` Aleksei Vetrov

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=3eb9eb567539cb118277be6ebc420dce6c55e0d9.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=evverx@gmail.com \
    --cc=vvvvvv@google.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 read-only IMAP folder(s) and NNTP newsgroup(s).