From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by sourceware.org (Postfix) with ESMTPS id 399F9385781B for ; Fri, 2 Apr 2021 19:46:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 399F9385781B Received: by mail-qv1-xf2c.google.com with SMTP id t16so2911588qvr.12 for ; Fri, 02 Apr 2021 12:46:03 -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:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ukcgDTSdVMGChyJ0iqTHjD5ITfhhMC5fT6dV8m6pP7A=; b=iFTH8XTDAml8Iw+vVozYPqZuVvLlM6HI7Bs9CNnyqDPy7VaSPVHqIBftermhpLFaTT OoCNbpHqhDtpISuP43HnQzzRO7cANhoh9o2JJN3FRxA8cfE0mnTSrLWHbEUfAcGPVkOy qchftAfq+xV9hpZ+jLZIxyobkeqgxQYDV7mQR0WksQABA586jDeO/fJWIdIOxD9tmnH6 L92B/hcxQ74tFwvT8om7C9Q++fwUCUaz6NqSuOQG2PdumeVuImITaLLpQZtfnez6Nvhk VPUvwtZojTvGQc9duvC04MCrDLxmXfz54yijG7uAk5M0HWE1rJKLvqB6M4Gc18NnIk8M roVw== X-Gm-Message-State: AOAM5332SzGwMUbKIm9c7hSsr2ZiW61noW0DjlxOe8bD+YT1rj0LrSCx o+HqCIOGvDhd6Msqw4UrPJaBecCf/q18qgtt X-Google-Smtp-Source: ABdhPJyqND5mFdGQOa6RqnsdCyJhuJkjkvMrxNDE2tmz5o7lY8lSXrxJ+TWx5FmC9A4PeWcv0noImA== X-Received: by 2002:a05:6214:20c8:: with SMTP id 8mr14396483qve.15.1617392762807; Fri, 02 Apr 2021 12:46:02 -0700 (PDT) Received: from [192.168.1.132] ([177.194.41.149]) by smtp.gmail.com with ESMTPSA id s13sm7242884qtx.42.2021.04.02.12.46.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Apr 2021 12:46:02 -0700 (PDT) Subject: Re: [PATCH 05/15] elf: Fix a DTV setup issue [BZ #27136] To: libc-alpha@sourceware.org, Szabolcs Nagy References: <49bb4560b2afb4174c7086e24b0fb7be9d73ab5d.1613390045.git.szabolcs.nagy@arm.com> From: Adhemerval Zanella Message-ID: Date: Fri, 2 Apr 2021 16:46:00 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <49bb4560b2afb4174c7086e24b0fb7be9d73ab5d.1613390045.git.szabolcs.nagy@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Fri, 02 Apr 2021 19:46:06 -0000 On 15/02/2021 08:59, Szabolcs Nagy via Libc-alpha wrote: > The max modid is a valid index in the dtv, it should not be skipped. > > The bug is observable if the last module has modid == 64 and its > generation is same or less than the max generation of the previous > modules. Then dtv[0].counter implies dtv[64] is initialized but > it isn't. Fixes bug 27136. LGTM, thank. I think it would be better to either squash the testcase into this patch (which would require to rework the testcase make rules, since it uses the objects from B#19329) or move the test after this patch. Reviewed-by: Adhemerval Zanella > --- > elf/dl-tls.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/elf/dl-tls.c b/elf/dl-tls.c > index dd76829e74..79b93ad91b 100644 > --- a/elf/dl-tls.c > +++ b/elf/dl-tls.c > @@ -590,7 +590,7 @@ _dl_allocate_tls_init (void *result) > } > > total += cnt; > - if (total >= GL(dl_tls_max_dtv_idx)) > + if (total > GL(dl_tls_max_dtv_idx)) > break; > > listp = listp->next; > Ok, it align on how dl_tls_max_dtv_idx is used on this file (such as _dl_count_modids).