Re: [patch] validate binary before use

Jan Kratochvil
2013-04-06T15:41:15Z

On Thu, 04 Apr 2013 15:03:05 +0200, Aleksandar Ristovski wrote:
> The problem is, we could 'remember' build-id that is garbage.
[...]
On Fri, 05 Apr 2013 15:06:36 +0200, Aleksandar Ristovski wrote:
> It is stored in the latest patch, in build-id.

OK, true with the new patch.

The problem is there is:
xfree (so->build_id);
in free_so() but it should be in free_so_symbols instead. free_so_symbols is
called also from reload_shared_libraries_1 where so_list->abfd can change.
Then obviously one should also set so->build_id = NULL there.

I was thinking making the BUILD_ID data private so solib-svr4.c but that is
currently not possible, lm_info is private for solib-svr4.c but that has
lifetime of so_list, not the lifetime of so_list->abfd.

Thanks,
Jan