From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-4.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 3356E1F8C6 for ; Wed, 14 Jul 2021 18:12:19 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F109139874DB for ; Wed, 14 Jul 2021 18:12:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F109139874DB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1626286338; bh=tEe9Oy6s2ZthqLdlEavRwRwZjVGzF4XQ/b4ZoaLtDuw=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=XhQQKZdmZ7QP3SgH9LdDdJeCKKt9CHiMKG8YfSyjdsx0zyY59qgDYjOpUA38baCNl JNttHlhJ58OiAmv+QNl5+k0Ij1AVuXYJ8iYNF0AQZTpl03QI43xslE8A+wYknPfo/L gqWQaDt10P9IlAEbELWcfHzOT3Ya5KuTZmX832e8= Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 1E2DE385482F for ; Wed, 14 Jul 2021 18:11:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1E2DE385482F Received: by mail-pg1-x52a.google.com with SMTP id t9so3333891pgn.4 for ; Wed, 14 Jul 2021 11:11:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tEe9Oy6s2ZthqLdlEavRwRwZjVGzF4XQ/b4ZoaLtDuw=; b=MMX7cve44HJxJe5ZBjQGWMfvLQdZOKDfrxXXl32PTjb+gG2MDVomjfqSxqDa8VLczn /5u/qGMQ5nISRbV+bilLY2Mr48kuweSEXzhzUTqaNOFNd2y7CDZ65ZmD8MJsSxDazK+6 MbCOXyc4BqucSEK/lwJXXcuEJ+boNOgN4kY8sIdsvJDfKsS4oet22fIqgwa20M+BzElU Ud8wy/73Q48KoXOuFOxhH1ahFV2nH9QnpvBiWzPYxci40E8zj0eyX7ejZdCFjAQ8C1eB do+jXPsODQqMeXZdSTCX8pGAYPWKWiokV48RIVGi474VheoBrSD2akExZgrj64332ElI jd9Q== X-Gm-Message-State: AOAM530s8SLk0Y5nqeUU4aCAedXeb5jDo2EuaaOnwDeY9do9kzMCmRhv QP8b/u074CpdZIKyT0PbOrPvA/0hwCCuMQ== X-Google-Smtp-Source: ABdhPJzJfHauqjwJAoxdaeXrPUKHEnMXfHN13FIn3qIGkbXgnDR2UrULYZ3k8rLkuBTlen5AShm7/g== X-Received: by 2002:a63:ce14:: with SMTP id y20mr10542424pgf.432.1626286316904; Wed, 14 Jul 2021 11:11:56 -0700 (PDT) Received: from [192.168.1.108] ([177.194.59.218]) by smtp.gmail.com with ESMTPSA id d6sm3615519pgq.88.2021.07.14.11.11.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jul 2021 11:11:56 -0700 (PDT) Subject: Re: [PATCH v3] elf: Fix DTV gap reuse logic (BZ #27135) To: Carlos O'Donell , Szabolcs Nagy References: <20210709135001.505521-1-adhemerval.zanella@linaro.org> <20210709150512.GT14854@arm.com> <0c977f4a-248d-c035-a615-852adee670a1@linaro.org> <76323d51-f54d-29c1-1a72-3b439c521f44@redhat.com> Message-ID: Date: Wed, 14 Jul 2021 15:11:53 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <76323d51-f54d-29c1-1a72-3b439c521f44@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Adhemerval Zanella via Libc-alpha Reply-To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 14/07/2021 13:57, Carlos O'Donell wrote: > On 7/14/21 9:52 AM, Adhemerval Zanella wrote: >> >> >> On 09/07/2021 12:05, Szabolcs Nagy wrote: >>> The 07/09/2021 10:50, Adhemerval Zanella wrote: >>>> Changes from previous version: >>>> >>>> - Fix commit message and add a line about the bug fixes. >>>> - Use atomic operation while setting the slotinfo. >>>> - Use test_verbose on tst-tls20.c. >>>> >>>> --- >>>> >>>> This is updated version of the 572bd547d57a (reverted by 40ebfd016ad2) >>>> that fixes the _dl_next_tls_modid issues. >>>> >>>> This issue with 572bd547d57a patch is the DTV entry will be only >>>> update on dl_open_worker() with the update_tls_slotinfo() call after >>>> all dependencies are being processed by _dl_map_object_deps(). However >>>> _dl_map_object_deps() itself might call _dl_next_tls_modid(), and since >>>> the _dl_tls_dtv_slotinfo_list::map is not yet set the entry will be >>>> wrongly reused. >>>> >>>> This patch fixes by renaming the _dl_next_tls_modid() function to >>>> _dl_assign_tls_modid() and by passing the link_map so it can set >>>> the slotinfo value so a so subsequente _dl_next_tls_modid() call will >>>> see the entry as allocated. >>> >>> this paragraph still has 'so a so subsequente' >>> and i would add the bug number into the first sentence. >> >> Fixed. >> >>> >>>> >>>> The intermediary value is cleared up on remove_slotinfo() for the case >>>> a library fails to load with RTLD_NOW. >>>> >>>> This patch fixes BZ #27135. >>>> >>>> Checked on x86_64-linux-gnu. >>> >>> the patch looks ok to me, with the commit message >>> and the comment issue below fixed. >>> >>> Reviewed-by: Szabolcs Nagy >> >> Carlos, is it for push? > > It's a non-ABI bug fix, so we can push it. Thanks for asking. > And it is in, let's hope it does not brake anything again ;)