From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79760 invoked by alias); 5 Oct 2017 15:18:27 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 79750 invoked by uid 89); 5 Oct 2017 15:18:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=HTo:D*se X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 719B7CD260 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer@redhat.com Subject: Re: [PATCH v2] Fix double-checked locking in __gconv_get_path and __gconv_read_conf [BZ #22062] To: Arjun Shankar , libc-alpha@sourceware.org References: <20171002143148.GA41930@aloka.lostca.se> From: Florian Weimer Message-ID: Date: Thu, 05 Oct 2017 15:18:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171002143148.GA41930@aloka.lostca.se> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-10/txt/msg00266.txt.bz2 On 10/02/2017 04:31 PM, Arjun Shankar wrote: > These two functions running in different threads could encounter a data race > if the CPU or compiler reordered the store of __gconv_path_elem so as to be > earlier than writes to the content that it points to. This has now been > corrected by using atomics every time the variable is accessed. > > ChangeLog: > > 2017-10-02 Arjun Shankar > > [BZ #22062] > * iconv/gconv_conf.c: Include . > (__gconv_get_path): Access __gconv_path_elem using atomics. > (__gconv_read_conf): Likewise. > (libc_freeres_fn): Likewise. Looks good. Thanks, Florian