Re: [patch] validate binary before use

Jan Kratochvil
2013-04-04T08:13:16Z

On Thu, 04 Apr 2013 04:03:43 +0200, Aleksandar Ristovski wrote:
> Actually, as I think about this more, we can not use section from
> possibly unrelated bfd to read build-id in native debugging case. At
> a minimum, we can not store such build-id as abfd may not even
> relate to what's in target's memory.

Why?

If the target shared library does not match then GDB will read some random
memory. The target shared library may not even have any build-id.

As the build-id has 160 bits there is 1:2^160 probability of a false positive,
that is safe enough.

> The chunk of code that is in svr4_relocate_section_addresses in the
you probably mean solib_map_sections

> latest version of the patch needs to go back to svr4_validate, and
> not store build-id.

I do not understand this whole mail, it would be best to provide a countercase
where the current patchset does not behave correctly.

Thanks,
Jan