This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/1] dl-load: add memory barrier before updating the next.


On 03/16/2017 06:12 AM, Maninder Singh wrote:
This patch adds memory barrier before updating the liblist next.

Issue Fix: race condition between add_name_to_object  & _dl_name_match_p.
One threads calling dlopen which further calls add_name_to_object &
other thread trying to resolve RTLD_LAZY symbols through _dl_runtime_resolve
which further calls.

_dl_name_match_p checks if libname->next is valid, then it assumes
libname->next->name to be valid. Also add_name_to_object initialized name
first and then sets valid next pointer.

This patch avoids any reorder of instruction when next is set before name
to avoid any race.

Would you please file a bug for this? We'd also want to write a test case for this.

Unfortunately, I cannot comment on the substance of the patch.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]