[PATCH][BZ #19329] Fix race between tls allocation at thread creation and dlopen

Carlos O'Donell carlos@redhat.com
Wed Jan 13 02:34:00 GMT 2016


On 01/11/2016 11:32 AM, Szabolcs Nagy wrote:
> 2016-01-11  Szabolcs Nagy  <szabolcs.nagy@arm.com>
> 
>     [BZ #19329]
>     * elf/dl-open.c (dl_open_worker): Write GL(dl_tls_generation)
>     atomically.
>     * elf/dl-tls.c (_dl_allocate_tls_init): Read GL(dl_tls_generation),
>     GL(dl_tls_max_dtv_idx), slotinfo entries and listp->next atomically.
>     (_dl_add_to_slotinfo): Write the slotinfo entries and listp->next
>     atomically.

You are headed in the right direction. I like where this patch is going,
but don't have enough time to review this in detail yet.

At first glance your patch lacks sufficient concurrency documentation to
be acceptable. You need to document which acquires the releases
synchronizes-with. Please grep for "CONCURRENCY NOTES" to see the level
of detail we need to maintain these kinds of changes.

Cheers,
Carlos.



More information about the Libc-alpha mailing list