From patchwork Tue Feb 9 17:18:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Dasmohapatra X-Patchwork-Id: 41988 X-Patchwork-Delegate: azanella@linux.vnet.ibm.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A27D3973007; Tue, 9 Feb 2021 17:18:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A27D3973007 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1612891133; bh=G1lhgmDcQpQOsitZQ2H9XaANSTkgR9dgW1bbuTt2hu8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=BCqte5ijwPJDtq3pON145yIVxb3/Q69BAK1e0KF2W35J7pwXY3yK8KJZRJu3Tag0t FVbcJXNpo4Ocvrn0ufXE8dI0B4HD+QAuLx/T1t9+kQp7qpRCNkIA1zQnpvs1ztL6Qx xBCgcz/ixaeVZjnGI+nbvrjRYVRyyRkBd/Rkf7W4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by sourceware.org (Postfix) with ESMTPS id 0CC82395543B for ; Tue, 9 Feb 2021 17:18:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0CC82395543B Received: from noise.lan (unknown [IPv6:2001:4d48:ad5c:ef00:8e70:5aff:fe59:c29c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vivek) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 3EBB41F451DD for ; Tue, 9 Feb 2021 17:18:46 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [RFC][PATCH v8 08/20] elf/dl-open.c: when creating a proxy check the libc_map in NS 0 Date: Tue, 9 Feb 2021 17:18:27 +0000 Message-Id: <20210209171839.7911-9-vivek@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210209171839.7911-1-vivek@collabora.com> References: <20210209171839.7911-1-vivek@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_NUMSUBJECT, SPF_HELO_PASS, 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-Patchwork-Original-From: =?utf-8?q?Vivek_Das=C2=A0Mohapatra_via_Libc-alpha?= From: Vivek Dasmohapatra Reply-To: =?utf-8?q?Vivek_Das=C2=A0Mohapatra?= Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The libc_already_loaded check normally considers the libc_map entry in GL(dl_ns)[args->nsid].libc_map. This is not correct for proxies, which use the libc_map from the default namespace (as proxies are dummy entries that point to the base namespace via their l_real members). --- elf/dl-open.c | 1 + 1 file changed, 1 insertion(+) diff --git a/elf/dl-open.c b/elf/dl-open.c index dc4b386559..096aa4c680 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -568,6 +568,7 @@ dl_open_worker (void *a) { proxy_ns = args->nsid; args->nsid = LM_ID_BASE; + args->libc_already_loaded = GL(dl_ns)[LM_ID_BASE].libc_map != NULL; } /* It was already open. */