From patchwork Fri Oct 18 09:56:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Khrustalev X-Patchwork-Id: 1999030 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=Xu9eutbN; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=Xu9eutbN; 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 4XVKyb3cf2z1xwD for ; Fri, 18 Oct 2024 21:03:03 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AB82D3858D20 for ; Fri, 18 Oct 2024 10:03:01 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on20616.outbound.protection.outlook.com [IPv6:2a01:111:f403:2613::616]) by sourceware.org (Postfix) with ESMTPS id 559AE3858C2B for ; Fri, 18 Oct 2024 10:02:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 559AE3858C2B 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 559AE3858C2B Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2613::616 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1729245759; cv=pass; b=rWUZ61t3OTxQ/8wVC/wlUrtMazJD8HlBDhNljxSkfdVr56d0kAOZa+gU094Vm6ZSHRiUDiZAPxbZR4oTG7Ae+q8AnjpkGwYE6fg8J/6gjoJNXgQmnkbKj9KnEdiP+vXWsAkm+m1XOSiY7G2Nf1CVbQJntrQPPtRVoV4qMSXueL8= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1729245759; c=relaxed/simple; bh=IHcIt7LPapKSGKLM7T5sI/yvpq0du671brm4MfXrpLE=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=txPJNpOhqqXbQMfkPZG6ptqFRTqM+JuWMyuV9DFOqa1tMOABXD49SuzxKwkbWzlUQbsjFrYDfbHZyN9ZIurJDv0bKSNvD70mE4WdxcDiz8s76DsEAjx5EGb6FLp4HniZ9lkjcgm87gOJqdEZfgPS5GwVUv4oKyYvr+WHhmO0mHA= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=Qk+WJClbCXojfgndnKu2P2B4URWPvrPh7t3yyKg95tjduN+SOiQcK2uQ2nS6hyQPBpyQk4Kq86Sfb2eF14+lKcDHgTWaFqO5IeUgfDQMYmrFKpHmsTPIB92dpv7DaUvEt+njgC32kIrknY7KaFvG5dFJVhrCF0ZnSNRrwmdQZ+y3HP0KZX2Fu4XGVKFDNqTDbkElTD63/e8dI+TlwFE//dYAwa1kMdkGscuLErw73Sb2SDHwnAw2dKw+pJWFaKl0m4MSK+fksSJKIdDJGYmprUXPrBYJXx48BhSB214GZN+JB9LBlvKjjPK0wiWu6gX1ZlTaXc2M5Jru0ulVDZ8vPQ== 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=Z78PesHied7YOiY2XvH21DK1y0D1m1i4MJq+xTuO4hw=; b=A3mp/XOg11lBR4wqpmmGxl36N7gaqAmyE7r6yDF+w2hivlovsv337DFj58YQ9Mgiztylpq84GwTOdE/gcnSbX135MMW8/QQLV+CyPLiHLhTBKVJJHHj0WU8jqwwbhPqL8/kEvgbLQbjeugTv6Wu8F6YIqeSOjGUuTNOvuGTyA1wcwga5ef0Bbfk4jru+93VnPGVFnMduR3rN0+nvxtcROZWmYwtGkbjyuSI+bI9LfN1hzMzq5UL1ZBt0sC6kl1yuIRUJJjpRnRL3HTvJadrt5JtSvNoKR9a6rYCxBXbwy1Bh77+ecpsNE+Plwe4vbeTEo+ZHnvRmzFMDgPOinTNOaw== 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=Z78PesHied7YOiY2XvH21DK1y0D1m1i4MJq+xTuO4hw=; b=Xu9eutbNsFGcaQ1/wllH84uwxAG3Hj7kse9iJdklOQ5bbs3Qi0vFihaimNRVU4KprKVc3t63Dkxq3QMa0mA+n03rfr2rHKuokl+XT+svfqYG1l3MKOitYOUFbVjbB9UG7LyodsRH75TstIcLaD57RxMr+Un2Wuwzv5Hhw+UhshU= Received: from AS4P192CA0025.EURP192.PROD.OUTLOOK.COM (2603:10a6:20b:5e1::19) by GV1PR08MB8473.eurprd08.prod.outlook.com (2603:10a6:150:81::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.21; Fri, 18 Oct 2024 10:02:25 +0000 Received: from AM4PEPF00027A62.eurprd04.prod.outlook.com (2603:10a6:20b:5e1:cafe::ac) by AS4P192CA0025.outlook.office365.com (2603:10a6:20b:5e1::19) 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:02:25 +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 AM4PEPF00027A62.mail.protection.outlook.com (10.167.16.71) 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:02:24 +0000 Received: ("Tessian outbound 0658930cd478:v473"); Fri, 18 Oct 2024 10:02:24 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 693d1f5d3d351496 X-TessianGatewayMetadata: sJjql78PTpUHfmPQ8mU01ILIl15UUVfPdTKKLmeIrBlk1KHoZvL+dzOWhbW00BvHCbmQz20sxN4Hf7L/dVsaFw8XcUG47irCFF7u5eGzO3Vu8taNCoWdIFxEbZyk5UpS5B8T+ga9zaBMDmX16B2K46MNJIxwLQAToKZHyGe7BXk= X-CR-MTA-TID: 64aa7808 Received: from Ld7104e055a3d.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6545490A-9800-44F5-80D5-FF924B812565.1; Fri, 18 Oct 2024 09:57:16 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id Ld7104e055a3d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 18 Oct 2024 09:57:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NFpUqXNPgjoutTmI8A/5LNHcaRjsUibY1ja2YK06mAmYP/6ISqqrfCEDVCBvLP2U6wX7Qy5OHqv+WyCBE1V35y1zrKyj7InADoQ+yUKdpJjaSZZXeleZewkFXpTVFB2bamfcJFiTdrAdgJ//BGLmKZjCB9lqAqH7SI9gShDysTK5cjKKwDlelmTh9mjUV/kWULtGwkB7lNxklElJxyG+8kWeIq/tw5GBhRtIajaWbn0h3w6rUP+dBVVMFXKTE/vt3Jgl1PfifJVa/3OSn/SAsuZ1V8Z4aLs77QeTKWum5pCql/+Lmx2tlaS65yw+OUjVWegHKSSy6BNRNpYXkZnZoA== 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=Z78PesHied7YOiY2XvH21DK1y0D1m1i4MJq+xTuO4hw=; b=D28rw7VTR2FKt4lR7Jah16dWzw1Da+a2CYJ8sqVHBUdKQb9OsQY3rBnEgPlzdRV9UEw53L16+M7AQhjAx9mxQ5OXKAaGRXA0+RgdBK229iq1Nb5yfku8xZ+h7kaPr7Kf+NbA6omJfHHWDkCBBHyb9N06WLzRLIJHyy1gdWqvvzcWLwnaZ0mBrrDx3THKAMF2l5UkvDHgMrO4dIP2TH7bXZN7TMhJiz9AY7fxcF01vz3DjIQYLYGSE7D9iTZmcFpQYV0dJ90Ys2BCD2ZYbpQ/890OlPHce5E5luLUhmk8UqNWXNTeMtn1LZB/p8zjtQLB87/WTBRUfVs4G+sZJjZV/w== 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=Z78PesHied7YOiY2XvH21DK1y0D1m1i4MJq+xTuO4hw=; b=Xu9eutbNsFGcaQ1/wllH84uwxAG3Hj7kse9iJdklOQ5bbs3Qi0vFihaimNRVU4KprKVc3t63Dkxq3QMa0mA+n03rfr2rHKuokl+XT+svfqYG1l3MKOitYOUFbVjbB9UG7LyodsRH75TstIcLaD57RxMr+Un2Wuwzv5Hhw+UhshU= Received: from DUZPR01CA0131.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bc::16) by PAXPR08MB7574.eurprd08.prod.outlook.com (2603:10a6:102:23c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27; Fri, 18 Oct 2024 09:57:11 +0000 Received: from DB5PEPF00014B94.eurprd02.prod.outlook.com (2603:10a6:10:4bc:cafe::1d) by DUZPR01CA0131.outlook.office365.com (2603:10a6:10:4bc::16) 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 09:57:11 +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 DB5PEPF00014B94.mail.protection.outlook.com (10.167.8.232) 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 09:57:11 +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 09:57:11 +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 09:57:10 +0000 From: Yury Khrustalev To: CC: , , , , Yury Khrustalev Subject: [RFC v2 00/22] aarch64: Add support for Guarded Control Stack extension Date: Fri, 18 Oct 2024 10:56:53 +0100 Message-ID: <20241018095653.2954868-1-yury.khrustalev@arm.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DB5PEPF00014B94:EE_|PAXPR08MB7574:EE_|AM4PEPF00027A62:EE_|GV1PR08MB8473:EE_ X-MS-Office365-Filtering-Correlation-Id: 85a3a8f7-65f6-416b-636f-08dcef5bf75b x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info-Original: rtDyGZNTHgFB/fkNFlKxLiHiC3+WrDtIHRTnqrKFycd3NU9KMI+H7z98OMiV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uv9A/ra2il2Q0wVtkrJqLsYYRmkBZhhLYAXqybfxh8l9RLkEPd+Sjxxa8tt6iZYlxlUXgXcUwHqLKfUwmlpr5XOpn5vaPb3v868hGacjDuGyNcZux8iKEl4HBVb6oOGxuRWWr3zc2fZ8B+RunC1gVZFxOD5ixTUC4Ez1zki1HbxK2lZod1wi72BZnTxyUFYxH2zyLpFCLqfYebEgNAjViMQPuW+ej3wekeVPNAPO1KwrQXk= 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)(376014)(36860700013)(82310400026)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7574 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:10:4bc::16]; domain=DUZPR01CA0131.eurprd01.prod.exchangelabs.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A62.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c890144c-a21d-4f87-d193-08dcef5b3cae X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|82310400026|1800799024|35042699022; X-Microsoft-Antispam-Message-Info: 5ze0xsIGsIBNM8cwhyl56EEc7wDa08ukOFE4gLwxAhrNVraCFZXsjz1m/uBVcvw+/cTLSXOCYmHR9wGSNKlZbAF356qcuL/c37+/e4kfmld3Y7R/aCAwapSne/pZTYGinBnIzRN6iZmqq9cm3HemTnFc7FyIxFq+yGYppUEO4Q4SD7i46697hMTXZbgWnQVXiWkcU6FnL8HtpIxrOT4AnmLw7ZTQTxSbESeDATmcNokBBlb/QwhjMPhAu0jow+KsKKhcArj7BvNZ+T4dwWTAupej6MiQ6LmWjxZlkVKhmEic8TOj5pxQjV9AhmYkUXwIJaP3HiuH6aKQxfPTModQD5mGkts/8OAvc2839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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)(36860700013)(376014)(82310400026)(1800799024)(35042699022); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 10:02:24.9854 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 85a3a8f7-65f6-416b-636f-08dcef5bf75b 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: AM4PEPF00027A62.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8473 X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, KAM_SHORT, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY autolearn=no 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 This patch series adds support for the Guarded Control Stack extension [1] that allows to use shadow stacks on AArch64 targets with enabled GCS. This patch series includes: - New tunables glibc.cpu.aarch64_gcs and glibc.cpu.aarch64_gcs_policy - Definition of jmp_buf offset for GCS - GCS support in longjmp, vfork, setcontext, makecontext - GCS support in static startup code and dynamic linker - Handling of GCS marking in dynamic binaries and DSOs - Handling of GCS marking in static binaries - Mark swapcontext with indirect_return - HWCAP_GCS Corresponding Linux kernel patches [2] are in progress but are very close to stable ABI. This is the only reason why this patch series is RFC. GCS marking for binaries is specified in [3]. Regression tested on AArch64 and no regressions have been found. Any feedback is welcome and appreciated. Sources and branches: - binutils-gdb: sourceware.org/git/binutils-gdb.git users/ARM/gcs - gcc: gcc.gnu.org/git/gcc.git vendors/ARM/gcs-v2 see https://gcc.gnu.org/gitwrite.html#vendor for setup details - glibc: this patch series, or sourceware.org/git/glibc.git arm/gcs-v2 - kernel: git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/gcs Cross-building the toolchain for target aarch64-none-linux-gnu: - build and install binutils-gdb - build and install GCC stage 1 - install kernel headers - install glibc headers - build and install GCC stage 2 configuring with --enable-standard-branch-protection - build and install glibc - build and install GCC stage 3 along with target libraries configuring with --enable-standard-branch-protection FVP model provided by the Shrinkwrap tool [4] can be used for testing. Run with environment var GLIBC_TUNABLES=glibc.cpu.aarch64_gcs=1:glibc.cpu.aarch64_gcs_policy=2 By default both tunables are 0, the meaning is: - glibc.cpu.aarch64_gcs_policy=0: GCS is enabled if glibc.cpu.aarch64_gcs is set - glibc.cpu.aarch64_gcs_policy=1: GCS is enabled if glibc.cpu.aarch64_gcs is set and binary is marked if GCS is enabled, an incompatible dlopen is an error - glibc.cpu.aarch64_gcs_policy=2: GCS is enabled if glibc.cpu.aarch64_gcs is set if GCS is enabled, any incompatible binary is an error [1] https://developer.arm.com/documentation/ddi0487/ka/ (chapter D11) [2] https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/gcs [3] https://github.com/ARM-software/abi-aa/blob/main/sysvabi64/sysvabi64.rst [4] https://git.gitlab.arm.com/tooling/shrinkwrap.git --- Szabolcs Nagy (22): aarch64: Add HWCAP_GCS aarch64: Add asm helpers for GCS elf.h: Define GNU_PROPERTY_AARCH64_FEATURE_1_GCS aarch64: Define jmp_buf offset for GCS aarch64: Add GCS support to longjmp aarch64: Add GCS support to vfork aarch64: Add GCS support for setcontext aarch64: Mark swapcontext with indirect_return aarch64: Add GCS support for makecontext aarch64: Try to free the GCS of makecontext aarch64: Add glibc.cpu.aarch64_gcs tunable aarch64: Enable GCS in static linked exe aarch64: Enable GCS in dynamic linked exe aarch64: Mark objects with GCS property note aarch64: Add glibc.cpu.aarch64_gcs_policy aarch64: Use l_searchlist.r_list for bti aarch64: Handle gcs marking aarch64: Use l_searchlist.r_list for gcs aarch64: Ignore GCS property of ld.so aarch64: Process gnu properties in static exe aarch64: Add GCS user-space allocation logic aarch64: use __alloc_gcs in makecontext elf/elf.h | 1 + include/set-freeres.h | 4 + malloc/thread-freeres.c | 3 + sysdeps/aarch64/Makefile | 11 ++- sysdeps/aarch64/__alloc_gcs.c | 66 +++++++++++++ sysdeps/aarch64/__longjmp.S | 30 ++++++ sysdeps/aarch64/aarch64-gcs.h | 36 +++++++ sysdeps/aarch64/bits/indirect-return.h | 36 +++++++ sysdeps/aarch64/dl-bti.c | 5 +- sysdeps/aarch64/dl-gcs.c | 64 ++++++++++++ sysdeps/aarch64/dl-prop.h | 15 ++- sysdeps/aarch64/dl-start.S | 23 ++++- sysdeps/aarch64/dl-tunables.list | 10 ++ sysdeps/aarch64/jmpbuf-offsets.h | 63 ++++++++++++ sysdeps/aarch64/linkmap.h | 1 + sysdeps/aarch64/rtld-global-offsets.sym | 5 + sysdeps/aarch64/setjmp.S | 10 ++ sysdeps/aarch64/sysdep.h | 12 ++- sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h | 1 + .../unix/sysv/linux/aarch64/cpu-features.c | 9 ++ sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c | 13 +++ .../unix/sysv/linux/aarch64/dl-procruntime.c | 37 +++++++ sysdeps/unix/sysv/linux/aarch64/getcontext.S | 17 +++- sysdeps/unix/sysv/linux/aarch64/libc-start.h | 61 ++++++++++++ sysdeps/unix/sysv/linux/aarch64/makecontext.c | 97 ++++++++++++++++++- sysdeps/unix/sysv/linux/aarch64/setcontext.S | 57 ++++++++++- sysdeps/unix/sysv/linux/aarch64/swapcontext.S | 32 ++++-- sysdeps/unix/sysv/linux/aarch64/sysdep.h | 6 +- .../sysv/linux/aarch64/ucontext-internal.h | 5 + sysdeps/unix/sysv/linux/aarch64/vfork.S | 8 +- 30 files changed, 709 insertions(+), 29 deletions(-) create mode 100644 sysdeps/aarch64/__alloc_gcs.c create mode 100644 sysdeps/aarch64/aarch64-gcs.h create mode 100644 sysdeps/aarch64/bits/indirect-return.h create mode 100644 sysdeps/aarch64/dl-gcs.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/dl-procruntime.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/libc-start.h