public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Evgeny Vereshchagin <evvers@ya.ru>
Cc: david korczynski <david@adalogics.com>, elfutils-devel@sourceware.org
Subject: Re: Some fuzzer workarounds
Date: Mon, 21 Mar 2022 11:50:25 +0100	[thread overview]
Message-ID: <YjhYcd3wwDcGCYYy@wildebeest.org> (raw)
In-Reply-To: <741FAE40-F8E9-4DA7-A160-E30A76210AC8@ya.ru>

Hi,

On Fri, Mar 18, 2022 at 10:26:16AM +0300, Evgeny Vereshchagin wrote:
> I think before looking at those reports it would make sense to
> figure out what they are supposed to test and how they were tested
> to make sure they don't produce false positives. If they weren't
> actually tested I think it would make sense to revert them to avoid
> getting auto-generated CVEs until they're in more or less good shape
> at least.

So I took the fuzz-libelf.c and fuzz-libdwfl.c files from the oss-fuzz
repo, tweaked them so they have a normal main that takes one file
argument to try to replicate the reports. That found some "real"
issues I submitted patches for. Then I ran afl-fuzz on them locally
during the weekend and found another issue for which I also submitted
a patch. There are several duplicates though and all the MSAN reported
issues seem bogus.

> > There are also some other
> > misaligned type access checks reported by ubsan, but I don't know if
> > that is because of ALLOW_UNALIGNED is still defined or not (when
> > configuring with --enable-analyze-undefined ALLOW_UNALIGNED is not
> > defined, otherwise it is for some arches, including x86_64).
> 
> Looking at
> https://github.com/google/oss-fuzz/commit/8747524f04b1b906d4a21a6ade87f7803b3f9b8c,
> I think I turned ALLOW_UNALIGNED off with UBSan there (and tested it
> in https://sourceware.org/bugzilla/show_bug.cgi?id=28720).

Yes, you are right, all the unaligned type access issues were "real"
(they occur with or without ALLOW_UNALIGNED on). It is not really a
big issue, but could potentially cause the compiler to do some
surprising optimisations. So I did fix them all.

Cheers,

Mark


  parent reply	other threads:[~2022-03-21 10:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17 13:30 Mark Wielaard
2022-03-17 13:30 ` [PATCH 1/2] libelf: Take map offset into account for Shdr alignment check in elf_begin Mark Wielaard
2022-03-17 13:30 ` [PATCH 2/2] libelf: Make sure ar_size starts with a digit before calling atol Mark Wielaard
2022-03-18  9:11   ` Evgeny Vereshchagin
2022-03-18 11:44     ` Mark Wielaard
2022-03-18 13:18       ` Evgeny Vereshchagin
2022-03-18  7:26 ` Some fuzzer workarounds Evgeny Vereshchagin
2022-03-19 11:08   ` Evgeny Vereshchagin
2022-03-21  2:24   ` Evgeny Vereshchagin
2022-03-21 10:50   ` Mark Wielaard [this message]
2022-03-21 11:10     ` Evgeny Vereshchagin
2022-03-21 14:33       ` Evgeny Vereshchagin
2022-03-21 17:30         ` Mark Wielaard
2022-03-21 18:01           ` Evgeny Vereshchagin
2022-03-22 16:59       ` Evgeny Vereshchagin
2022-03-23  0:35         ` Mark Wielaard
2022-03-23  1:15           ` Evgeny Vereshchagin
2022-03-23  9:21             ` Mark Wielaard
2022-03-21 10:57 ` Mark Wielaard

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=YjhYcd3wwDcGCYYy@wildebeest.org \
    --to=mark@klomp.org \
    --cc=david@adalogics.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=evvers@ya.ru \
    /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).