[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Don't try to read a build_id as string in find_alt_debug_info_link.
Hello Mark,
Mark Wielaard <mark@klomp.org> a écrit:
> The GCC8 address sanitizer found an issue in find_alt_debug_info_link.
> It tried to convert a build-id byte sequence into a string. But the
> build-id byte sequence is not a zero terminated sequence of chars.
> So it could run off way past the section data.
>
> The code never actually uses the build-id. It could to verify the
> referenced alt-file is the correct one. But since it uses elfutils
> to actually load the alt file it doesn't have to, since elfutils
> will already check the build-id matches.
>
> So just remove the build_id argument from find_alt_debug_info_link
> and don't try to convert and return it as a string.
>
> * src/abg-dwarf-reader.cc (find_alt_debug_info_link): Remove
> build_id argument. Don't try to read the buildid chars as a
> string.
> (find_alt_debug_info): Don't call find_alt_debug_info_link
> with a build_id string argument.
This looks good to me, obviously. Applied to master.
Thanks!
Cheers,
--
Dodji