public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/17621] New: DTV update for Static TLS dlopened modules is racy
@ 2014-11-18 19:36 aoliva at sourceware dot org
  2014-11-18 22:35 ` [Bug nptl/17621] " aoliva at sourceware dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: aoliva at sourceware dot org @ 2014-11-18 19:36 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17621

            Bug ID: 17621
           Summary: DTV update for Static TLS dlopened modules is racy
           Product: glibc
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
          Assignee: aoliva at sourceware dot org
          Reporter: aoliva at sourceware dot org
                CC: drepper.fsp at gmail dot com

When we dlopen a module whose TLS segment is assigned to Static TLS, we not
only initialize every thread's Static TLS area, but also (with nptl) the
corresponding DTV entry.

While nobody could possibly be using the Static TLS range concurrently, it
doesn't ever move, and some synchronization between the dlopened thread and
other threads that use the initialized TLS area is required for the TLS uses to
be well-defined, the DTV entry might be updated concurrently, if its owner
thread finds it was out of date and it held non-Static TLS in earlier
generations, and it might even be resized and moved during update, causing the
initialization performed by the dlopen-running thread to write to memory that
may have already been already copied, losing the update or, worse, that may
have been repurposed, causing memory corruption.

Fortunately, we don't resize DTVs very often, and even if the update is lost,
dlopened modules referenced with IE don't depend on the DTV at all, and
variables accessed with IE tend to be accessed with IE by all their users (most
often, the only user is the defining module itself).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-07-24 13:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-18 19:36 [Bug nptl/17621] New: DTV update for Static TLS dlopened modules is racy aoliva at sourceware dot org
2014-11-18 22:35 ` [Bug nptl/17621] " aoliva at sourceware dot org
2014-11-27 22:59 ` david.abdurachmanov at gmail dot com
2015-03-17  4:23 ` cvs-commit at gcc dot gnu.org
2015-03-17  4:36 ` aoliva at sourceware dot org
2015-05-27 14:26 ` schwab@linux-m68k.org
2015-07-24 13:46 ` siddhesh at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).