Hi, On Tue, 2023-02-21 at 05:28 +0300, Evgeny Vereshchagin wrote: > On Mon, 20 Feb 2023 at 19:03, Aleksei Vetrov <vvv...@google.com> wrote: > > On Mon, Feb 20, 2023 at 3:55 PM Mark Wielaard <m...@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