From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id 2C0A13858C3A for ; Wed, 13 Oct 2021 12:03:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2C0A13858C3A Received: by mail-pg1-x52b.google.com with SMTP id 66so2096869pgc.9 for ; Wed, 13 Oct 2021 05:03:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=8vZ0C/uFTnTMPXnXxi/KFYcSSpD2e16Lrj26TuaZQa0=; b=aa5jbwBNJLg+eItwJAsPf59trpZwljOl6Ui5sF70e3o4GiL0Z1SBIg/AErCqqVB+rK zREbXyHakrlQLOAbKkci5tCbedrLm/AEuiGS/AbfPFzlxcLb3NZtTYtRlsFxmSRtLQ3G f9lOwfUMRMsX2WWQ0mcGQFnLbKJdYlW6fiq5WsuqoE80IvfrlzAT8hIrnetEu8++Aonf O7T2stH7UK555uvC//HwGMrMlXgodcEMlFyyywr0L2AZshREddcalxBtbjEM8Z58qpo8 irDklmiFzfoaqovlwzaw1XcsMtsO7ro79Mfz9MzA1za64ujqpG2g1ikEI7WCRgNy1EJM /qzw== X-Gm-Message-State: AOAM531vSKon8AWjVRWQYyWzUAmgwNfFV+bRyXYxyPjXLTgPKr+JdL3c EFojGBENy8PkpY9CCf5JGsRb4d1tjPEgWQBy1sr0FUjo X-Google-Smtp-Source: ABdhPJxR0Ne3tCalRrsZN8e52gQjWAOMuJJjaUGObkSQQOcVLoQZBaZ+rfQQRPXCirc/sqN6y+eNVel6Qono1Px/OrQ= X-Received: by 2002:aa7:8f28:0:b0:44c:f281:c261 with SMTP id y8-20020aa78f28000000b0044cf281c261mr24899970pfr.76.1634126626085; Wed, 13 Oct 2021 05:03:46 -0700 (PDT) MIME-Version: 1.0 References: <20210930182311.3718571-1-hjl.tools@gmail.com> <87v92h2a1t.fsf@oldenburg.str.redhat.com> In-Reply-To: From: "H.J. Lu" Date: Wed, 13 Oct 2021 05:03:09 -0700 Message-ID: Subject: Re: [PATCH v2] elf: Replace nsid with args.nsid [BZ #27609] To: Florian Weimer , libc-stable@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3029.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-stable@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-stable mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2021 12:03:48 -0000 On Thu, Sep 30, 2021 at 11:36 AM H.J. Lu wrote: > > On Thu, Sep 30, 2021 at 11:27 AM Florian Weimer wrote: > > > > * H. J. Lu: > > > > > do_dlopen calls _dl_open with nsid == __LM_ID_CALLER (-2), which calls > > > dl_open_worker with args.nsid = nsid. dl_open_worker updates args.nsid > > > if it is __LM_ID_CALLER. After dl_open_worker returns, use args.nsid > > > instead of nsid. This fixes BZ #27609. > > > --- > > > elf/dl-open.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/elf/dl-open.c b/elf/dl-open.c > > > index a25443f6d1..5295e931b0 100644 > > > --- a/elf/dl-open.c > > > +++ b/elf/dl-open.c > > > @@ -886,7 +886,7 @@ no more namespaces available for dlmopen()")); > > > /* Avoid keeping around a dangling reference to the libc.so link > > > map in case it has been cached in libc_map. */ > > > if (!args.libc_already_loaded) > > > - GL(dl_ns)[nsid].libc_map = NULL; > > > + GL(dl_ns)[args.nsid].libc_map = NULL; > > > > > > /* Remove the object from memory. It may be in an inconsistent > > > state if relocation failed, for example. */ > > > > Patch looks okay. But could you reference the fixed commit in the > > commit message? > > > > Done. Here is the patch I am checking in. > > Thanks. > > -- > H.J. I am backporting it to release branches. -- H.J.