From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id C0327385C6FC for ; Tue, 22 Aug 2023 10:58:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C0327385C6FC Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692701912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=B/ye7hpeBzg0f3ATBPmo+O04hV+KjvmQzcYJQ7qAIE4=; b=ImU3s/fS98NM/yqP240Doc74v9NssAcY71AK0T+Hvgt4uXCbIwZCbPLNCUGoU616XgXuvt Ch5tFfUhAsWYGCEAwDy02+tfP1Rnlp/jtfbKK83CE19pWY4KkHwy5P6tZNlftSbB0SEfB+ cn4HjakbEROL7ncX5zm0Qp0chTcXrhQ= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-695-OeK_Ev3iPEimPD9i6GWmCg-1; Tue, 22 Aug 2023 06:58:31 -0400 X-MC-Unique: OeK_Ev3iPEimPD9i6GWmCg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0C38F38210A8 for ; Tue, 22 Aug 2023 10:58:31 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AAA7B492C13 for ; Tue, 22 Aug 2023 10:58:30 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3 1/2] elf: Do not run constructors for proxy objects In-Reply-To: Message-ID: References: X-From-Line: ca9c2cfd0f0d09eb65e8dffe971cc62511d32d60 Mon Sep 17 00:00:00 2001 Date: Tue, 22 Aug 2023 12:58:29 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Otherwise, the ld.so constructor runs for each audit namespace and each dlmopen namespace. --- elf/dl-init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/elf/dl-init.c b/elf/dl-init.c index 5b0732590f..fefd471851 100644 --- a/elf/dl-init.c +++ b/elf/dl-init.c @@ -25,6 +25,10 @@ static void call_init (struct link_map *l, int argc, char **argv, char **env) { + /* Do not run constructors for proxy objects. */ + if (l != l->l_real) + return; + /* If the object has not been relocated, this is a bug. The function pointers are invalid in this case. (Executables do not need relocation, and neither do proxy objects.) */ -- 2.41.0