Commit Graph

15 Commits

Author SHA1 Message Date
Evgeny Vereshchagin d94ac89d00
[elfutils] always build zlib (#7470)
* [elfutils] always build zlib

to make sure all the fuzz targets use the same version of zlib

* [elfutils] switch to the latest version of zlib
2022-03-29 10:55:54 -04:00
Evgeny Vereshchagin 56e0158135
[elfutils] bring MSan back (#7460)
Now that all the false positives are gone and MSan reports real
issues like https://sourceware.org/bugzilla/show_bug.cgi?id=29000
confirmed by Valgrind it should be safe to bring MSan back.

It reverts 6e6d6068ae
2022-03-28 14:47:26 -04:00
Evgeny Vereshchagin 2b62a903a8
[elfutils] build zlib with MSan (#7401)
Unlike fuzz-dwfl-core, the new fuzz targets actually use zlib so
instead of just linking against zlib to make them compile they
should use the library instrumented with MSan. Without it OSS-Fuzz
reports bogus issues like https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45630
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45631 and
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45633.

To hopefully make it easier to figure out how to add new fuzz targets
going forward I also added the following comment to the build script
```
When new fuzz targets are added it usually makes sense to notify the maintainers of
the elfutils project using the mailing list: elfutils-devel@sourceware.org. There
fuzz targets can be reviewed properly (to make sure they don't fail to compile with -Werror
for example), their names can be chosen accordingly (so as not to spam the mailing
list with bogus bug reports that are opened and closed once they are renamed) and so
on. Also since a lot of bug reports coming out of the blue aren't exactly helpful
fuzz targets should probably be added one at a time to make it easier to keep track
of them.
```

It's a follow-up to https://github.com/google/oss-fuzz/pull/7395
and https://github.com/google/oss-fuzz/pull/7393.
2022-03-24 10:24:56 -04:00
Evgeny Vereshchagin 4536922dcf
[elfutils] turn off FORTIFY_SOURCE with MSan (#7422)
Closes:

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45647
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45676
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45706

It was tested in https://github.com/evverx/elfutils/pull/73
with CFLite. Combined with https://github.com/google/oss-fuzz/pull/7401
it fixes all the issues MSan has reported.
2022-03-22 21:54:04 -04:00
Evgeny Vereshchagin 6e6d6068ae
[elfutils] prevent MSan from reporting issues for now (#7424)
https://sourceware.org/pipermail/elfutils-devel/2022q1/004784.html
2022-03-22 21:53:38 -04:00
DavidKorczynski aa83381257
elfutils: add and expand library fuzzers (#7395)
* elfutils: make name more appropriate

* elfutils: update libelf fuzzer

* elfutils: add fuzz-libdwfl

* elfutils: nits

* elfutils: fix build
2022-03-16 23:54:15 +00:00
DavidKorczynski 71f220ec89
elfutils: add myself to project.yaml (#7394) 2022-03-16 22:38:15 +00:00
DavidKorczynski 9b5a750c7f
elfutils: add new fuzzer (#7393) 2022-03-16 15:04:20 +00:00
Evgeny Vereshchagin 8747524f04
[elfutils] turn on the alignment check (#7092)
* [elfutils] turn on the alignment check

Unaligned access can crash code on some architectures
like SPARC for example. The latest example (unrelated to elfutils)
would be https://github.com/systemd/systemd/issues/21935 (which UBSan
could have easily prevented and which led to rolling out the check
in the systemd project among other things).

It should probably be merged once https://sourceware.org/bugzilla/show_bug.cgi?id=28720
is closed.

* [elfutils] drop line-tables-only

to make it easier to run the fuzzer with gdb locally.
2022-01-05 14:54:21 +00:00
Evgeny Vereshchagin a13af45f88
[elfutils] make reports public and point OSS-Fuzz to the official mailing list (#7049)
https://sourceware.org/bugzilla/show_bug.cgi?id=28715#c9
2021-12-22 15:28:59 +00:00
Evgeny Vereshchagin e63ec7ecd2
[elfutils] build elfutils more often (#6999)
to prevent OSS-Fuzz from reporting bugs that have already been fixed
2021-12-10 11:22:47 -05:00
Evgeny Vereshchagin 8bc388e3e0
[elfutils] turn on i386 (#7000) 2021-12-10 09:39:05 +00:00
Evgeny Vereshchagin 467ad6b66e
[elfutils] show config.log when ./configure fails (#6963)
to make it easier to figure out why configure fails with something like
```
Step #3 - "compile-afl-address-x86_64": configure: error: in `/src/elfutils':
Step #3 - "compile-afl-address-x86_64": configure: error: C compiler cannot create executables
Step #3 - "compile-afl-address-x86_64": See `config.log' for more details
```
2021-12-07 16:06:15 -05:00
Evgeny Vereshchagin fc94ed50ba
[elfutils] start afresh (#6944)
The elfutils project was integrated into OSS-Fuzz in
https://github.com/google/oss-fuzz/pull/6670 where
Dockerfile pointed to a fork of the official repository
with a series of patches that were supposed to make it compile
on OSS-Fuzz. Apart from that there was a fuzz target that
effectively wrapped the readelf utility by applying a patch
to its source code. On the whole it worked at the time
but I think there are a few issues:

1. It's hard to point OSS-Fuzz to the official repository
(because most of the patches touch the build system and
they can't always be applied cleanly);

2. It's almost impossible to add new fuzz targets covering
other use cases;

3. It's not possible to build fuzz targets without Docker

4. Since the fuzz target mostly wraps the readelf utility
it looks more like a CLI tool than a fuzz target. It calls
exit when it should just return 0 to let it keep going
and so on.

This PR should addresses all those issues apart from 4. The fuzz
target was just removed and another one was added instead. (It can
be added later though but since it isn't exactly maintainable with
the build script pointing at the official repository it should
probably be rewritten:
https://sourceware.org/pipermail/elfutils-devel/2021q4/004295.html)

The new fuzz target covers the code that `systemd` uses to parse
untrusted data. Currently it can be used to trigger various issues
like heap-buffer-overflows and inifinite loops that in theory can bring down
coredump processing on machines where systemd-coredump is used by
default. Even though those issues were discovered by one of `systemd`
fuzz targets I think elfutils bugs should be caught and reported
by elfutils fuzz targets.
2021-12-01 11:15:17 +00:00
izzeem 459217ef10
elfutils/readelf (#6670)
* add elfutils/readelf

* Update project.yaml

Co-authored-by: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>
2021-10-31 13:02:36 -04:00