From patchwork Fri Oct 18 10:00:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Khrustalev X-Patchwork-Id: 1999034 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=dzKX6ZMO; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=dzKX6ZMO; dkim-atps=neutral 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 4XVKzt31nLz1xw2 for ; Fri, 18 Oct 2024 21:04:10 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9706B3858C35 for ; Fri, 18 Oct 2024 10:04:08 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20614.outbound.protection.outlook.com [IPv6:2a01:111:f403:2614::614]) by sourceware.org (Postfix) with ESMTPS id EC4F93857C63 for ; Fri, 18 Oct 2024 10:00:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EC4F93857C63 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 EC4F93857C63 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2614::614 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1729245641; cv=pass; b=fwfO9Z5GqGcvElt8XAU9IkqxYqQdqZwuCuMEZQ9SXM1dm2cMkFDxlwViuTkePptln2/ovTBebhzphZQ+wyqikvSoIpK7Jp5fuc/ZzjNZ1Olc1ACe7q15TNK17ZOb7MI16bg8gLjECUjo5EpXJvAN+yfIjo36rjOP4kBJOJ2gmGQ= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1729245641; c=relaxed/simple; bh=smDODWu4h5JVw+3jea+ek5IafU08BQrRM282Ijz/m5A=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=lEsMvYwJeBMXa/lW8nESIORMytlBakZfyC1mU5+5PRrS6jXZBKnepipwlDCCkVeGRUH+Av53T0CFfwPNDa78ux4mvWT+NWb6WBiPNFeGEFdI/iDwlq3I6iaA2Dx9yP4B1XvVmRWmwd6N2bqdBgeIvAvVksDAWEkA0lq8sfLKStM= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=JD6XNbVV/7jZ8kTskvEkfO9df/6NacEZn09pkbOpSkzQFA56aQuzrm8EBBqbbqIOVTngKtRPHg25tSSEvNBD3lyXhIV0QB+FpdXs2riBEOKwQ+rW9hgRm1L6N/iFUKCFBjBxLE1nPJjeF6yiHtu84e+7S32UBTnSmVpnssq/d2SKWiuwzIGYqG+oXKhyiSWvMU5xEAfUMwUpP3/JocaE0DGkOj3QhONg/lMCZQGT8/OsPF6+7JSKuJ8MfrwwPzaqMhcC4kiLh3IsVwnIruunIxxqPmKrdensKVRiAQ2b+vG5thRlUpSq0cofPQUGeGD/0rBxII0IRFzv0jDFWwcIXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I9dNI1qnokKODmUfgCWM/rJj8kNv+z9XEfOuo9qGLYQ=; b=yYz/81j0nMWvBMTSAxgN/COMRMjwXr1nqPlCw1+VYTAMyNhXZFwP5abnYpevG0GgXlPhSyBWbY0/OViH5R1R/aYNUYvqfQ+8KovGkKe0teYclir47FtURph9n7q8t16sXzi7wn3T0ubPPn71l+tD7rRmvEtECmdSpVTKYl3wb0hl6x4U/+lF4RSSp/5VpOIETitTJIKMmSVtV8bovvw+emzgjUvSjRtzxiThnxwaRZEssRgfl5dQvSq88o3V9JFvRRzFMXCda24/Nq4xHJn6CEKArjfAi3oYvYpBiBVoGLLFB/5BD8SmB/RKsfhWoHtXmaHE+w9OW4c8LmB2bZCMsQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I9dNI1qnokKODmUfgCWM/rJj8kNv+z9XEfOuo9qGLYQ=; b=dzKX6ZMORJ5FCBvrHeQmht3FgGFahrXMuY5tq6DNLKM2Ep5pra9mqFpc/3c1aIdJZ/AyfR7935RduXyU098yHz8xyKBbr+Gom4aUXvwJIHFL/PkneTlg1txlTjG/t1h/s/nVWvXCmweksFBfBf5OeTEFpekCYy2Hul2nwIjo9Uc= Received: from AM0PR01CA0171.eurprd01.prod.exchangelabs.com (2603:10a6:208:aa::40) by DB5PR08MB9998.eurprd08.prod.outlook.com (2603:10a6:10:489::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17; Fri, 18 Oct 2024 10:00:26 +0000 Received: from AM3PEPF00009B9D.eurprd04.prod.outlook.com (2603:10a6:208:aa:cafe::63) by AM0PR01CA0171.outlook.office365.com (2603:10a6:208:aa::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.21 via Frontend Transport; Fri, 18 Oct 2024 10:00:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM3PEPF00009B9D.mail.protection.outlook.com (10.167.16.22) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8069.17 via Frontend Transport; Fri, 18 Oct 2024 10:00:26 +0000 Received: ("Tessian outbound 5c9bb61b4476:v473"); Fri, 18 Oct 2024 10:00:26 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f303e72e0914bf59 X-TessianGatewayMetadata: OMUnJfOJXFgKSMs1GGVyJfeijtOE2Kda5m05P39lMpZjmudnp17jLaxkkllwdun19tMHGiW6JgLCK3XIwkzxXsJHoHiwL5SESdxhpTGxSeuSnrQhZkFz50qn9vZiRfe43i7/twAjVYFRQk8/VeCiiI8vcokUPTanc7QPEztsS2E= X-CR-MTA-TID: 64aa7808 Received: from Lb717527e4b96.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 305A1D98-679B-4B3A-8998-F4A1784920B2.1; Fri, 18 Oct 2024 10:00:20 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id Lb717527e4b96.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 18 Oct 2024 10:00:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gfsRoHG7SpMfX4AzdKPkVebvkSF+5jvmVDEIUCI20ENIGB/NkHq3r0pK5jmSsMzKE0PhCAAvBMVtpcSLlMisUZvJVSnhGBjNzu2+o0FKG22NOltVClX9/n0tkULzVrzo3Q4LWOHmHfv13PsI81piJmqb3amiRBP8H45rIazrlgnj8Sn3irC6t9U6lV1Au71S1lLbCI8z2iTzvcjo0TrmJ6hXTJ95WDFkC7WzUT/EmguxWRzJEhoEdM7FQA18j3Q5P4aFtu3ysDROxDs8kTa2L86Xb+nx81knBkYtVMwTyQBR8exMTcaUK88OqnZa9Vdb/pFXbUWCwz+blhfZOeOqDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I9dNI1qnokKODmUfgCWM/rJj8kNv+z9XEfOuo9qGLYQ=; b=dOcAl9VgVbOI6aqcmM39kQMTo8mhgZVbQEpdcPgykRt8RV06siajXxThNucJ7NNW96oCfgWo0zML/BRgxpke1mtFA386Of7VgvTOsLiio56KAfGPwW3k02YPW32rcpgVmjfg4AzRpTvFi0ZfSAAevHZBtPjZwItcLDNiuuHh4NsYHepzQxtGBaFs/AlMMJUys8GLQdwjiVS4xMqouJXgcLCaA1X9DJOzWw6nX+7uckGK3OJ4Cmwi/yfabRy1nnOJFBFaPFLSV7p7oXushH3UHwnJXsUQxgdYNIFXxwTtwXcDoPyYtlC6HfguwJX6DWy5O/Jdt0dTjdVDPO1tsCuowg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I9dNI1qnokKODmUfgCWM/rJj8kNv+z9XEfOuo9qGLYQ=; b=dzKX6ZMORJ5FCBvrHeQmht3FgGFahrXMuY5tq6DNLKM2Ep5pra9mqFpc/3c1aIdJZ/AyfR7935RduXyU098yHz8xyKBbr+Gom4aUXvwJIHFL/PkneTlg1txlTjG/t1h/s/nVWvXCmweksFBfBf5OeTEFpekCYy2Hul2nwIjo9Uc= Received: from DU2PR04CA0276.eurprd04.prod.outlook.com (2603:10a6:10:28c::11) by AS8PR08MB8298.eurprd08.prod.outlook.com (2603:10a6:20b:536::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Fri, 18 Oct 2024 10:00:14 +0000 Received: from DB5PEPF00014B91.eurprd02.prod.outlook.com (2603:10a6:10:28c:cafe::a9) by DU2PR04CA0276.outlook.office365.com (2603:10a6:10:28c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23 via Frontend Transport; Fri, 18 Oct 2024 10:00:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by DB5PEPF00014B91.mail.protection.outlook.com (10.167.8.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8069.17 via Frontend Transport; Fri, 18 Oct 2024 10:00:14 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 18 Oct 2024 10:00:03 +0000 Received: from udebian.localdomain (10.1.28.135) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Fri, 18 Oct 2024 10:00:03 +0000 From: Yury Khrustalev To: CC: , , , , Szabolcs Nagy Subject: [RFC v2 17/22] aarch64: Handle gcs marking Date: Fri, 18 Oct 2024 11:00:02 +0100 Message-ID: <20241018100002.2955605-1-yury.khrustalev@arm.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241018095653.2954868-1-yury.khrustalev@arm.com> References: <20241018095653.2954868-1-yury.khrustalev@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DB5PEPF00014B91:EE_|AS8PR08MB8298:EE_|AM3PEPF00009B9D:EE_|DB5PR08MB9998:EE_ X-MS-Office365-Filtering-Correlation-Id: 39b6315e-45c9-4009-d16c-08dcef5bb0c3 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info-Original: r2YabpqkgRV0kxlnoCbjpFeEX0ay4+p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HJeO/nivbkCVjqurwybq9xvTBEG/epuN5cD3+jogqvJPU2XvEFvKs/mQE+Q0wHp24WxWrWQc4OwXNAg8XilrvNifbd01dkd3i+Ut2RZTxGyhBQKbMQyN3+8zpNtyx8reysiBj5K6rzTNX6kO6hr3LMkztv4uT1zyR5MhHGjCo1Cyn6iguQbxzTlYn2TLS0EAyPV1CHMO7QuzDr0Ytgu05vbsnzNpM+l1AO3EadH0zlYX+dVWYaEqU4QozezM7J/GqQby1nSx5F76ayawxlpAAZ16L7XCQGXwTdQzOCDpo7ePMRclLadn5R0V2kZVdQPQEy6E+63o6hQWCzmtaGr9JQ== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8298 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:10:28c::11]; domain=DU2PR04CA0276.eurprd04.prod.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM3PEPF00009B9D.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: e9a402eb-d3ae-4660-9b91-08dcef5ba963 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|35042699022|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: W2l1o8hyMwHu+k854I3WFPZchFgXFd+y7mt1fFWTNbeJDOpH0jfz1b0fTpHVGxZtLEGDEP88Qxpe2whOMfTMEAhVq/rRYhq6A4dsJuJ4tQ8DZ3TQeLVPA8FndfDeeEEBAZFHCS8luo8fuWsHOq/5h7OvOcDPLCIJEuu/iyj1DZxoRe9tp0xdc006/9R50ShUHOAAIgjdq9ev451CsRz3uTk2ShH4BWMaxbfLkhIXzbGjcrTYCwzeEEH1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PyYGvMDRrgJB3UxPGH2OpfxE31B+Q8b0oG0ON1Bp+CHBn3MJ1gB0CyOGFmYqPJFSzcSkX15zpNZEvFnGlYDZWdcUj4jrHEVzy9qg== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230040)(376014)(82310400026)(35042699022)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 10:00:26.5672 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 39b6315e-45c9-4009-d16c-08dcef5bb0c3 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM3PEPF00009B9D.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB9998 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY 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 --- sysdeps/aarch64/Makefile | 4 ++- sysdeps/aarch64/dl-gcs.c | 59 +++++++++++++++++++++++++++++++++++++++ sysdeps/aarch64/dl-prop.h | 15 ++++++---- sysdeps/aarch64/linkmap.h | 1 + 4 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 sysdeps/aarch64/dl-gcs.c diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile index ca8b96f550..74479604f2 100644 --- a/sysdeps/aarch64/Makefile +++ b/sysdeps/aarch64/Makefile @@ -9,7 +9,9 @@ LDFLAGS-rtld += -Wl,-z,force-bti,--fatal-warnings endif ifeq ($(subdir),elf) -sysdep-dl-routines += dl-bti +sysdep-dl-routines += \ + dl-bti \ + dl-gcs tests += tst-audit26 \ tst-audit27 diff --git a/sysdeps/aarch64/dl-gcs.c b/sysdeps/aarch64/dl-gcs.c new file mode 100644 index 0000000000..a92deb54b5 --- /dev/null +++ b/sysdeps/aarch64/dl-gcs.c @@ -0,0 +1,59 @@ +/* AArch64 GCS functions. + Copyright (C) 2024 Free Software Foundation, Inc. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include + +static void +fail (struct link_map *l, const char *program) +{ + if (program) + _dl_fatal_printf ("%s: %s: not GCS compatible\n", program, l->l_name); + else + _dl_signal_error (0, l->l_name, "dlopen", N_("not GCS compatible")); +} + +static void +check_gcs (struct link_map *l, const char *program) +{ + if (!l->l_mach.gcs) + { + if (GLRO(dl_aarch64_gcs_policy) == 2 || !program) + fail (l, program); + if (GLRO(dl_aarch64_gcs_policy) == 1 && program) + GL(dl_aarch64_gcs) = 0; + } +} + +/* Apply GCS policy for L and its dependencies. */ + +void +_dl_gcs_check (struct link_map *l, const char *program) +{ + /* GCS is disabled. */ + if (GL(dl_aarch64_gcs) == 0) + return; + /* GCS marking is ignored. */ + if (GLRO(dl_aarch64_gcs_policy) == 0) + return; + + check_gcs (l, program); + for (unsigned int i = 0; i < l->l_searchlist.r_nlist; i++) + check_gcs (l->l_initfini[i], program); +} diff --git a/sysdeps/aarch64/dl-prop.h b/sysdeps/aarch64/dl-prop.h index df05c0211d..72ac11aec0 100644 --- a/sysdeps/aarch64/dl-prop.h +++ b/sysdeps/aarch64/dl-prop.h @@ -24,16 +24,21 @@ extern void _dl_bti_protect (struct link_map *, int) attribute_hidden; extern void _dl_bti_check (struct link_map *, const char *) attribute_hidden; +extern void _dl_gcs_check (struct link_map *, const char *) + attribute_hidden; + static inline void __attribute__ ((always_inline)) _rtld_main_check (struct link_map *m, const char *program) { _dl_bti_check (m, program); + _dl_gcs_check (m, program); } static inline void __attribute__ ((always_inline)) _dl_open_check (struct link_map *m) { _dl_bti_check (m, NULL); + _dl_gcs_check (m, NULL); } static inline void __attribute__ ((always_inline)) @@ -45,10 +50,6 @@ static inline int _dl_process_gnu_property (struct link_map *l, int fd, uint32_t type, uint32_t datasz, void *data) { - if (!GLRO(dl_aarch64_cpu_features).bti) - /* Skip note processing. */ - return 0; - if (type == GNU_PROPERTY_AARCH64_FEATURE_1_AND) { /* Stop if the property note is ill-formed. */ @@ -57,7 +58,11 @@ _dl_process_gnu_property (struct link_map *l, int fd, uint32_t type, unsigned int feature_1 = *(unsigned int *) data; if (feature_1 & GNU_PROPERTY_AARCH64_FEATURE_1_BTI) - _dl_bti_protect (l, fd); + if (GLRO(dl_aarch64_cpu_features).bti) + _dl_bti_protect (l, fd); + + if (feature_1 & GNU_PROPERTY_AARCH64_FEATURE_1_GCS) + l->l_mach.gcs = 1; /* Stop if we processed the property note. */ return 0; diff --git a/sysdeps/aarch64/linkmap.h b/sysdeps/aarch64/linkmap.h index 56a63fc3dd..423fc0bd8e 100644 --- a/sysdeps/aarch64/linkmap.h +++ b/sysdeps/aarch64/linkmap.h @@ -23,4 +23,5 @@ struct link_map_machine ElfW(Addr) plt; /* Address of .plt */ void *tlsdesc_table; /* Address of TLS descriptor hash table. */ bool bti_fail; /* Failed to enable Branch Target Identification. */ + bool gcs; /* Guarded Control Stack marking. */ };