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: 720841 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v94Sg0cKzz9tkF for ; Sat, 28 Jan 2017 03:46:58 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="y5W240Ss"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:cc:from:message-id:date :mime-version:in-reply-to:content-type; q=dns; s=default; b=x8YO 61szJwBKg3w4oCUf3tKp9Qb340/lIYhqlTYDB+yKPJrcHyNBh2+iz4wBIhI5Nt+D PjE1RdeCe0uzelDYLM3AoFGYh0KACx/2lkQ7zcR3KTBD+wqQU+wQ6HvHYp1ZW8na QZI6O4LoYAfAsOUX2laU9HnFp5igfYwx9CEioDE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:cc:from:message-id:date :mime-version:in-reply-to:content-type; s=default; bh=GL+FPOIbUq JtAgFR1LrkIMMWfW8=; b=y5W240SsHYCCtms4ZvkO5HYzH3Gern+d49aeoqlEQ2 IQKjELILKR0b7tBxyl+IzqK5cUJFBXNwegXZ1rhwu7ZlCGolhyg6P3A/dccoqbqp 1//255/zm22zxLkBIP9+/SJz+QATeUPkX3a9KMki2tayfQAgONNfUL3xFNG1Ul6p 4= 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); }