Message ID | 39dd4282abd042c847dda7dbac8060ca2a7dd856.1593612309.git.szabolcs.nagy@arm.com |
---|---|
State | New |
Headers | show
Return-Path: <libc-alpha-bounces@sourceware.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=WaF35z9z; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=WaF35z9z; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49xkQ218PHz9sQt for <incoming@patchwork.ozlabs.org>; Thu, 2 Jul 2020 00:39:22 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F18B43861821; Wed, 1 Jul 2020 14:39:19 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00045.outbound.protection.outlook.com [40.107.0.45]) by sourceware.org (Postfix) with ESMTPS id 999B73857007 for <libc-alpha@sourceware.org>; Wed, 1 Jul 2020 14:39:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 999B73857007 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xO+GjftqZsZae5+TyfKkB+AZBpc/CdAj9KfbqhuP/s8=; b=WaF35z9zvIFCBPyzIs81Wq01gQqTaDMq5MaqUsCOL/u2geb6R40qQfnEr7FnfGHdogcs8l7GSlYQsykt3QKsHMyHCtNaVrWXGfk5DWSYYBcINZA0nJWMJK7GXzRJVlS3tYPfI1ZRLsyVZ+oP0piYCo49NOT/BJnln2gELn4g7pQ= Received: from DB6P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:6:28::23) by HE1PR0802MB2330.eurprd08.prod.outlook.com (2603:10a6:3:c8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.24; Wed, 1 Jul 2020 14:39:16 +0000 Received: from DB5EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:28:cafe::3e) by DB6P191CA0013.outlook.office365.com (2603:10a6:6:28::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.21 via Frontend Transport; Wed, 1 Jul 2020 14:39:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT059.mail.protection.outlook.com (10.152.21.175) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20 via Frontend Transport; Wed, 1 Jul 2020 14:39:15 +0000 Received: ("Tessian outbound e44de778b77e:v62"); Wed, 01 Jul 2020 14:39:15 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 93d0f6e57135501d X-CR-MTA-TID: 64aa7808 Received: from 506eb7741eb9.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9B0B920F-7FCF-427F-A8B5-1DDDD07ED96E.1; Wed, 01 Jul 2020 14:39:10 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 506eb7741eb9.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 01 Jul 2020 14:39:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OhGFYoCpFa4gCbukrk3eX2r2L3XaZgp58dvkyl81BNcMwTDfnuzFhZVK0Vd3OFHMulTYx+9gqb2cgUHKg6p9pc+6p1p+jV0muoLg2ZPEhaT8sgEUdllvG7dgb83Xb38j2xZaoqPqiP5jn1lAycFM8fjD6ZgY57HLouXflNguMzigvPqQlfhnPeQZSqkH8ho0wnoS63RRzwiTx/SJ9AJrXXtMT34HfXQjW0VPSlpRm/hNlwxJpzLI9FeV6M0JOFWAU/h/xL7+gQ7ETixG7p/j4dulExtLnkiNAhKw9SpzjXyen4PwzjUF69llCdmAlCphP5/HIdregdbZBisSShvhAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xO+GjftqZsZae5+TyfKkB+AZBpc/CdAj9KfbqhuP/s8=; b=cerk437q0MBQJ7UJTh1hTxOvi7RZ76ko5owSmiI0DstfQPr/y7rxe1L09ceP+reokZue5wS/2ttanfOUKQ17X/Vtt9hVHvv2y1IOB8VH+X5U6c7NOy0N42IE8Vw1b8UCz4NGw5PyDXhLTSSfmAaqCnS/gbLS+Yl3gkwJwL2e5+c1Sa4P782L309FjuPEwik9w4aLPogCd4NCk+0jhR21hGkp3qpGbZl2HD/YH/26r/9LwWsonsmM+0fJXnIWZyu3rFflhcif0m0II7E6Hqv4qrEYNaEkpNNclRZiqhmIU0ewn1Cyj80IrNEZbAgivw17xj4nkDw/YC7UVmKXEa7XPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xO+GjftqZsZae5+TyfKkB+AZBpc/CdAj9KfbqhuP/s8=; b=WaF35z9zvIFCBPyzIs81Wq01gQqTaDMq5MaqUsCOL/u2geb6R40qQfnEr7FnfGHdogcs8l7GSlYQsykt3QKsHMyHCtNaVrWXGfk5DWSYYBcINZA0nJWMJK7GXzRJVlS3tYPfI1ZRLsyVZ+oP0piYCo49NOT/BJnln2gELn4g7pQ= Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB3813.eurprd08.prod.outlook.com (2603:10a6:20b:85::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Wed, 1 Jul 2020 14:39:09 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::2404:de9f:78c0:313c]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::2404:de9f:78c0:313c%6]) with mapi id 15.20.3131.033; Wed, 1 Jul 2020 14:39:08 +0000 From: Szabolcs Nagy <szabolcs.nagy@arm.com> To: libc-alpha@sourceware.org Subject: [PATCH v6 06/14] aarch64: fix RTLD_START for BTI Date: Wed, 1 Jul 2020 15:39:02 +0100 Message-Id: <39dd4282abd042c847dda7dbac8060ca2a7dd856.1593612309.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <cover.1593612309.git.szabolcs.nagy@arm.com> References: <cover.1593612309.git.szabolcs.nagy@arm.com> Content-Type: text/plain X-ClientProxiedBy: LO2P265CA0281.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::29) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.53) by LO2P265CA0281.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21 via Frontend Transport; Wed, 1 Jul 2020 14:39:08 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [217.140.106.53] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 77cb1b05-0fe9-4cac-61c8-08d81dcc87ad X-MS-TrafficTypeDiagnostic: AM6PR08MB3813:|HE1PR0802MB2330: X-Microsoft-Antispam-PRVS: <HE1PR0802MB2330FCA906A9AF39929A3284ED6C0@HE1PR0802MB2330.eurprd08.prod.outlook.com> x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-Forefront-PRVS: 04519BA941 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ohhv3WMsnNZKS+f6IjlBIsm6FjQm+XeoKVt7c3QVrEC4ijAtvPRvttzqvzgtrK2VQLVuVUz6YSBKJSZ7NFNsPsilh5Il9V8+OyiDHn2qDX1tYXmBFiMjSjzELn7KnHHrX4mMRgHgwKPYteAFYXIPGUlqgyv7g0WTXLi4gWYMkqlk5fpAoK72xoOImbkjKIFD6nj9UrPcNfV2e9cuP9M4X68Z0kZ3GElkrt8DUuzOC4ZaCJMb9izNXhB/j2OhP3AyvJKrsMiJ4bWLMMKZqDNce7FEBksDB8uvp0DAuoUBRvCi3/e/9clwXbVW4xUOtPafEKrnM1r1zzMjzuBrrjEepysX4EsSFXw7ZN0uAhYxSlqKCm1o0NQ6/ywU0iTgFj0f84sM9XLYi99FY4STMBSVD8ZzKP4AU3xU+m4gytgPoSw= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(136003)(39860400002)(376002)(346002)(366004)(5660300002)(956004)(6512007)(8936002)(69590400007)(66946007)(66556008)(66476007)(6506007)(52116002)(44832011)(478600001)(316002)(6916009)(86362001)(6666004)(26005)(8676002)(2616005)(6486002)(16526019)(186003)(83380400001)(36756003)(2906002)(136400200001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: TV/LaRCrKI8ST2TM8UP/wDvwYCz79j4F3ImfJdJzJ4UO8xoy8HT+rCyfEdwR82fJl1OYl1C7ysLbh/rBb5Ds+feWKPiN/Kq1LV7d3cV7+IrVh0V9BnCcQGZuaNhy27vSsbALqdpie7gpmX3ILVdfyGyk0wBMA72LbNbGSVhMKzgBXiOVtlIzaFyiyQXM+M2SlZJdXUpXDZQ2kBW6TkpgcpnhfblxziUf5ByJ6XsSQZSAouk/PgaXFMa63oyAP72kaTj9hzjB/+RDjjDVNxFiSWuky6CRHh8ustpc+kHY5BNHGU6AgpKKKCzK6ehkvRi8ZPwmm7JxPrhYzNoNZnhzH8LY7IcQ61b8XK0eTMFJxZCRxuFN7+eeDn7jJrg3LnDLt+JSsnhMdJLySJ+3f4KDJB7OUaD5zrePqcct02FGXHW0pduSCAOTF6rUWLIw61yx1YaZIv/N21B/tl+kztx5n0X48q3UEi6BOn3vIX3FS3jBTDmbmE/dcgMomIGVreny X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3813 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT059.eop-EUR03.prod.protection.outlook.com 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; SFTY:; SFS:(4636009)(39860400002)(136003)(346002)(376002)(396003)(46966005)(6512007)(26005)(81166007)(83380400001)(316002)(16526019)(86362001)(6486002)(356005)(47076004)(6916009)(8936002)(478600001)(336012)(82310400002)(82740400003)(36756003)(8676002)(70586007)(70206006)(2616005)(956004)(69590400007)(5660300002)(6506007)(6666004)(2906002)(44832011)(186003)(136400200001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 587ad626-f3f6-4e79-3d45-08d81dcc835c X-Forefront-PRVS: 04519BA941 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6vDLrlRsB8CaGc+cK05ZlskcBCNYBWqVgCDa+yGLGaEvkmR/Z3YaWQFh551b0liE/rCZfDzvFu/GNkGQpjSr/3IiDW4TildRAuczrEx22gqQKh4EfhkKGNiNiMsoCL17VcUibaqtXvdyrcj4Spv8DoK1OtQisVBdhcopQwdQv4AU4K8Ebc0/5LMl4yjisIOxkg0zHy2Ztrasr+s+21neVDZLmhDeJ5wsp3De8fs8BZRbxjJrIbj4wqxPLc0fcOKjwztOq//DFBDoZNsa5qluMGgDU3XUsqBipeWLMjMgohg8hxjhI1ucMAAaEASjwmnQVX6C+GY7/odyS0xbz9rMnG8oxyGpmvCNgXlUUDNjmcHeCDw2kAijKTcabnSTTg//w0Vi053Uq6HB33M6tjXGilx5f0O/+bl8pbYUtmuhSzuy5ugMMyBitAwaSmWtAAIpDe+zec2lhftxmoyRu6HE4w== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2020 14:39:15.9676 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 77cb1b05-0fe9-4cac-61c8-08d81dcc87ad 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: DB5EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2330 X-Spam-Status: No, score=-16.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY 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 <libc-alpha.sourceware.org> List-Unsubscribe: <http://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <http://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
aarch64: branch protection support
|
expand
|
diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h index db3335e5ad..70b9ed3925 100644 --- a/sysdeps/aarch64/dl-machine.h +++ b/sysdeps/aarch64/dl-machine.h @@ -125,6 +125,8 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) .globl _dl_start_user \n\ .type _dl_start_user, %function \n\ _start: \n\ + // bti c \n\ + hint 34 \n\ mov " PTR "0, " PTR_SP " \n\ bl _dl_start \n\ // returns user entry point in x0 \n\ @@ -178,7 +180,8 @@ _dl_start_user: \n\ adrp x0, _dl_fini \n\ add " PTR "0, " PTR "0, #:lo12:_dl_fini \n\ // jump to the user_s entry point \n\ - br x21 \n\ + mov x16, x21 \n\ + br x16 \n\ "); #define elf_machine_type_class(type) \
Tailcalls must use x16 or x17 for the indirect branch instruction to be compatible with code that uses BTI c at function entries. (Other forms of indirect branches can only land on BTI j.) Also added a BTI c at the ELF entry point of rtld, this is not strictly necessary since the kernel does not use indirect branch to get there, but it seems safest once building glibc itself with BTI is supported. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> --- sysdeps/aarch64/dl-machine.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)