From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id E68163860C34 for ; Tue, 9 Mar 2021 05:39:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E68163860C34 Received: by mail-ed1-x530.google.com with SMTP id d13so18202512edp.4 for ; Mon, 08 Mar 2021 21:39:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BGHGpd1Z/48ws5a3b+6lGXV2rxke2FMPXhK2jfKQzJQ=; b=NAkWkDdMCsy+BHrvKA4KaadGM2y+72iYA92+RgAAdwH5ARX/tjWyAsHYg4S2sgj4Wk 5jS5ERTAbPNhK8l53dGfRfdJsahlkEmTh3Gw5NzDdbae2AAwxNOA7Xq3ChTres7Hvmj9 K8TwoyZfhJ7p1vSvbf4c6ImqedRyjnWlocXyn+U09yDpTDdHIvSCD8EMA7SLwqKy8X/B VSI6/IyU2cl/FF0mHUxWBtP89yxdaoqREiUiISrttWelIjTUHNGdyOYoOo9VyjHp/pRB 0HzuurVwdnpNNvx+KaYsnBVZjr2/vi7zZS3buRTH3y49SuFqGaJf6HYpLeIuWjE5yXtw KWfQ== X-Gm-Message-State: AOAM531Wqnye49ihVpAVlClEYFe+tscXXoJsuY+Hao4mDzeZX6gVJFfb cbSjmLH3BgYRcqtaViGF/EVIs9EZZnuCN7QyAUI= X-Google-Smtp-Source: ABdhPJyUUId+b6mBJZybkjKQC+Pk5yOqxzI8fFyaC7lyvsi5T+hba19cBZqw92gNpZm0OBOrkgQy/UsTTgDmerfLKK8= X-Received: by 2002:a05:6402:1a3c:: with SMTP id be28mr2123616edb.125.1615268386076; Mon, 08 Mar 2021 21:39:46 -0800 (PST) MIME-Version: 1.0 References: <87h7lpbgpr.fsf@oldenburg.str.redhat.com> <725cc7f6-790e-93e4-623e-cc4186deb5ec@redhat.com> In-Reply-To: <725cc7f6-790e-93e4-623e-cc4186deb5ec@redhat.com> From: Navin P Date: Tue, 9 Mar 2021 11:09:34 +0530 Message-ID: Subject: Re: [PATCH] elf: Always set l in _dl_init_paths (bug 23462) To: "Carlos O'Donell" Cc: Florian Weimer , libc-alpha@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, 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: Tue, 09 Mar 2021 05:39:48 -0000 On Tue, Mar 9, 2021 at 4:42 AM Carlos O'Donell via Libc-alpha wrote: > > On 3/5/21 1:25 PM, Florian Weimer wrote: > > From: Carlos O'Donell > > > > After d1d5471579eb0426671bf94f2d71e61dfb204c30 ("Remove dead > > DL_DST_REQ_STATIC code.") we always setup the link map l to make the > > static and shared cases the same. The bug is that in elf/dl-load.c > > (_dl_init_paths) we conditionally set l only in the #ifdef SHARED > > case, but unconditionally use it later. The simple solution is to > > remove the #ifdef SHARED conditional, because it's no longer needed, > > and unconditionally setup l for both the static and shared cases. A > > regression test is added to run a static binary with > > LD_LIBRARY_PATH='$ORIGIN' which crashes before the fix and runs after > > the fix. > > > > Co-Authored-By: Florian Weimer > > If you have reviewed this patch and find it sufficient this is enough > consensus IMO to commit the patch. > > The technical direction was set by earlier patches where we are working > towards making static and dynamic linking look and behave in similar > ways. > > Thanks for taking this patch up, working through it, and adjusting the > testing. > > Unless anyone objects I'd commit this patch since it fixes a real bug > with ldconfig running when LD_LIBRRAY_PATH is set in some way globally. > > > --- > > v2: Adjusted test not to use the test framework. Redid the change from > > scratch. > > > > I think we should revisit testing for static DT_RUNPATH support > > later, and not as part of this patch. > > Does this fix https://sourceware.org/bugzilla/show_bug.cgi?id=27504 also ?