From patchwork Fri Jan 27 16:46:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 19047 Received: (qmail 57492 invoked by alias); 27 Jan 2017 16:46:52 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 57482 invoked by uid 89); 27 Jan 2017 16:46:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, UNSUBSCRIBE_BODY autolearn=ham version=3.3.2 spammy=Hx-languages-length:1848, 11919 X-HELO: mx1.redhat.com Subject: Re: 2.25 freeze status To: Szabolcs Nagy , Siddhesh Poyarekar , "libc-alpha@sourceware.org" References: <627e42c4-4bf4-e297-2f06-a32ea9698192@redhat.com> <588B74E3.808@arm.com> Cc: nd@arm.com From: Florian Weimer Message-ID: Date: Fri, 27 Jan 2017 17:46:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <588B74E3.808@arm.com> On 01/27/2017 05:27 PM, Szabolcs Nagy wrote: > On 27/01/17 07:47, Florian Weimer wrote: >> On 01/27/2017 05:06 AM, Siddhesh Poyarekar wrote: >>> Hi, >>> >>> The release date of 1 Feb is upon us and there are 3 release blockers >>> that haven't been resolved yet: >>> >>> - global-dynamic TLS broken on aarch64 and others >> >> Fix is known (revert part of a faulty commit), it just needs review. > > i think the hunk mentioned in > https://sourceware.org/bugzilla/show_bug.cgi?id=20915 > should be just reverted without further review. > > writing to the dtv of other threads is neither > necessary nor correct. Let's do it then. Is this patch okay? Thanks, Florian nptl: Do not overwrite the DTV of other threads [BZ #20915] This reverts part of commit 17af5da98cd2c9ec958421ae2108f877e0945451. 2017-01-27 Florian Weimer [BZ #20915] * nptl/allocatestack.c (init_one_static_tls): Do not write to the DTV of other threads. diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 6402ea4..18d2001 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -1191,12 +1191,9 @@ init_one_static_tls (struct pthread *curp, struct link_map *map) # error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined" # endif - /* Fill in the DTV slot so that a later LD/GD access will find it. */ - dtv_t *dtv = GET_DTV (TLS_TPADJ (curp)); - dtv[map->l_tls_modid].pointer.to_free = NULL; - dtv[map->l_tls_modid].pointer.val = dest; - - /* Initialize the memory. */ + /* We cannot delay the initialization of the Static TLS area, since + it can be accessed with LE or IE, but since the DTV is only used + by GD and LD, we can delay its update to avoid a race. */ memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size), '\0', map->l_tls_blocksize - map->l_tls_initimage_size); }