From patchwork Wed Oct 23 08:39:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Khrustalev X-Patchwork-Id: 2000861 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XYN1f3j8Tz1xw0 for ; Wed, 23 Oct 2024 19:46:14 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AAC7C3858C2B for ; Wed, 23 Oct 2024 08:46:12 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 2FECB385842D for ; Wed, 23 Oct 2024 08:44:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2FECB385842D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2FECB385842D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729673064; cv=none; b=hdfDutMn617xp7QTvvia7NZL+HxxuwwCFtQzpOvC1uYcNXrzO+ClQY5fkmnzDVA4h1FmAO94Urn57L3hqwJZ1yh6DEiL4xDyvWyU61rmuhn4f7CyLXIcBDixG4oJm/TJRAd6CV3hpa8TPyfu/cGBMtT8hydWq1JQU5+C4gMnz7M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729673064; c=relaxed/simple; bh=pgGt1V0e6j9TXRuUGoKKPsFBocHqTbLU7Z2kO0A2P1g=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=tAtLwCncslISFwN28Y6AgYBMgb9JZ40a/osEQ3XQP7xx8gwHv0DlHgUUjsyxP5Lbgore56w4ihKB+P/V0wch1b+Pzs6CBJV9zZR+ByvIC5KFYOwL4UJgNa8SLvH7bOd+eFEm1HSBUbPiTi7i2bWYZUex8muSXgxv0XMdPgyJzFk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9F0A81576; Wed, 23 Oct 2024 01:44:43 -0700 (PDT) Received: from udebian.localdomain (unknown [10.1.39.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 46EA33F528; Wed, 23 Oct 2024 01:44:13 -0700 (PDT) From: Yury Khrustalev To: libc-alpha@sourceware.org Cc: fweimer@redhat.com, adhemerval.zanella@linaro.org, codonell@redhat.com, nsz@gcc.gnu.org Subject: [PATCH v3 19/23] aarch64: Ignore GCS property of ld.so Date: Wed, 23 Oct 2024 09:39:16 +0100 Message-Id: <20241023083920.466015-20-yury.khrustalev@arm.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241023083920.466015-1-yury.khrustalev@arm.com> References: <20241023083920.466015-1-yury.khrustalev@arm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org From: Szabolcs Nagy check_gcs is called for each dependency of a DSO, but the GNU property of the ld.so is not processed so ldso->l_mach.gcs may not be correct. Just assume ld.so is GCS compatible independently of the ELF marking. --- sysdeps/aarch64/dl-gcs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sysdeps/aarch64/dl-gcs.c b/sysdeps/aarch64/dl-gcs.c index 764b8a56e9..b81aa30787 100644 --- a/sysdeps/aarch64/dl-gcs.c +++ b/sysdeps/aarch64/dl-gcs.c @@ -32,6 +32,11 @@ fail (struct link_map *l, const char *program) static void check_gcs (struct link_map *l, const char *program) { +#ifdef SHARED + /* Ignore GCS marking on ld.so: its properties are not processed. */ + if (l->l_real == &GL(dl_rtld_map)) + return; +#endif if (!l->l_mach.gcs) { if (GLRO(dl_aarch64_gcs_policy) == 2 || !program)