From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from FRA01-MR2-obe.outbound.protection.outlook.com (mail-eopbgr90071.outbound.protection.outlook.com [40.107.9.71]) by sourceware.org (Postfix) with ESMTPS id AF12239BF4D4 for ; Wed, 4 Nov 2020 12:44:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AF12239BF4D4 Received: from AM6P193CA0081.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::22) by PR2PR08MB4683.eurprd08.prod.outlook.com (2603:10a6:101:27::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Wed, 4 Nov 2020 12:44:23 +0000 Received: from VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:88:cafe::b5) by AM6P193CA0081.outlook.office365.com (2603:10a6:209:88::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Wed, 4 Nov 2020 12:44:23 +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=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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT058.mail.protection.outlook.com (10.152.19.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3520.15 via Frontend Transport; Wed, 4 Nov 2020 12:44:23 +0000 Received: ("Tessian outbound a64c3afb6fc9:v64"); Wed, 04 Nov 2020 12:44:23 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 28e865e3ba743c27 X-CR-MTA-TID: 64aa7808 Received: from fc89014665c9.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6B1CC834-46A2-4E51-890E-DC4E6602734F.1; Wed, 04 Nov 2020 12:43:45 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fc89014665c9.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 04 Nov 2020 12:43:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YRxEQTcbfX6UK96pdpCprFnplywV3WEabaMixSyKv8LiF5vGC2WrR0OAdkU89ucUhNo1XN5AxsUrP4Rgj7S1LG848v0H6gmwOgOdlUS70bOpbOkVguYdVPAhvFYhXgsLrmXBWCTxWNgA7gJibyzAMSD0Li3PJbuV4IdKHgxJ/CbUW9eTEeszdXg6sZS1cU9OZut9jhbvr4mf8w6DGROh4Bw2A5y1qSyt+/vSMnKfty3mzB677EFesQhfVsdOAF/n2GRFpjG+DcIeWrSgxWpB5DbApY6vL5h0Du6Fhw0kQiOwR84Ngl8N/5DoFKCvKd95ikpKHwe2Se0YR84UYiAyHg== 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=52FtT3JwbZmWj3VWK0mPU5jD9qti1tLFEFmYwDNP9+4=; b=TuIhbHcdUwBHOK1l8G4jQbRHaN9FlqknlqiaX4LewrjO2izWAqWW2cvl/V5tMne9RsgPM379FD5Em10JLqvP0QS2tbmerFfXKf03YJCknEZhfsrwrqKj8EjGD11HBtbnW2M/yRjqMG8LYYyP8RadamtDXmb1lwKrVyC8rmGWwUkj2Xvq2RwVSufsCpIFkvKi25EqMSGoWCl34Z7BkuarEflPuvtsDEPqWvKt8jvYPEaAP8xTV3ZyLAB8ODA27DsYeNMSw/O+J43T4606W7VIPBodHmpiS5cx8xsrL+7DxG487pKFjBU/W4wFw/OyJE/9GH/l7o/8EaofuWEa9J8cgg== 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 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 PR3PR08MB5564.eurprd08.prod.outlook.com (2603:10a6:102:87::18) by PA4PR08MB6223.eurprd08.prod.outlook.com (2603:10a6:102:e8::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Wed, 4 Nov 2020 12:43:44 +0000 Received: from PR3PR08MB5564.eurprd08.prod.outlook.com ([fe80::2904:edcf:b299:f792]) by PR3PR08MB5564.eurprd08.prod.outlook.com ([fe80::2904:edcf:b299:f792%3]) with mapi id 15.20.3499.032; Wed, 4 Nov 2020 12:43:44 +0000 From: Szabolcs Nagy To: libc-stable@sourceware.org Subject: [2.28 COMMITTED] aarch64: Fix DT_AARCH64_VARIANT_PCS handling [BZ #26798] Date: Wed, 4 Nov 2020 12:43:35 +0000 Message-Id: <20201104124335.20628-1-szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 Content-Type: text/plain X-Originating-IP: [217.140.106.54] X-ClientProxiedBy: LO2P123CA0086.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:138::19) To PR3PR08MB5564.eurprd08.prod.outlook.com (2603:10a6:102:87::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.54) by LO2P123CA0086.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:138::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.22 via Frontend Transport; Wed, 4 Nov 2020 12:43:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: cf404cf1-19a3-4ca5-333a-08d880bf5b52 X-MS-TrafficTypeDiagnostic: PA4PR08MB6223:|PR2PR08MB4683: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true Content-Transfer-Encoding: quoted-printable NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1332;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: yYXOolixeDet4REn5Kqc8JvtKWdC0m8RjsIHs427CgyByh4itPDlvUX5Kq5j/pOLagEW5D2z2n6xDQnfDbY1f3+Yc3A5OeHzZfqsmpPJoIekIwmamjlGcnZheIoqkcyrpXmT426IiO3BW07YEPHjCISaItoCN8ATZWKzNZH7irqrG1e5LCtf0X3IPYOT5qAo18BcZPEuR62EZtid4dbayZa494U5vdlsh2SodxoRpcpqshgsFnDSnUuKSa9dGLIuzZ6gE/UvkTgI+B3MNvnRsh25JYp1g5OAV+DT5bqzPKLbeZqEWJGRkI/ecbZ8xz7ku583Bi0UtbEJmpljtBB9bU8MfIMwZ3onVTV6BYFZ98jQT4PVCmCW+i23pwL8RC2S X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PR3PR08MB5564.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(39860400002)(136003)(376002)(396003)(26005)(316002)(83380400001)(956004)(36756003)(8936002)(2616005)(16526019)(44832011)(69590400008)(186003)(52116002)(86362001)(5660300002)(6916009)(478600001)(66556008)(2906002)(1076003)(6506007)(6512007)(8676002)(6666004)(66476007)(66946007)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: /xtU7Wh9L6T+Dcfl5A98fkYBEhKCkK7e4pkDjIpUrJhLJThz7mtxEwSdJ4Co2zBcvdj4J7na7vEcnGwFlmyFAdCG7aKLkdVQ9fybmS2FQLKIlQE89CMM/2y9VN8FItEERxoBIl/g+BEGB7M0/GS7XWnAOQ5WaVmJgOsWdf/K921AkLqh3fLL2n8Cu0/NggBEcW27V6Qk7DDV7kIlo6WlnBDMJjtiIiJdd/Pu8v4dzfuwC0MMRVOYLwVtTGAKWdPqOntk8TZehDOEI87FjLTiawjhXxBKKZq0psbhToqJQb0V+D1ZVlra+7ELKROohi5B+iIlj4ggT++49Knu3JpjCtvspqjdnOR7aedIBoWafmfJoeSAiKPDn5arxDjyevXCqKhOe+H50CC7xhsjy5vMwwWpWqG1H1Wta1tDHvz/cglCXPkmwOPz4besj1pB1wsUoArafx1FUrjueeRvE5VgbqnIlQusvde4oJrWFAXahNRN3KOkCWHoMxfdz3LDMXxiQEIJMiUjsiwnUBHmogNTPRt9Ig+78zY3TRQSDmwHGl8NpHbDOEN1jvfL9f///is1kQpzI55/0a+NnUZsR2WCqsASGIJDyAlN04fIOjw8RxKLYbErlDX6kOhIYr3ZmXer2FnBjVhNNF0/W+IS+E1Jcg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6223 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: VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: ef003b33-608e-42df-ecbe-08d880bf441b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aVxMo8XF7zj/GaKziQvOIKw/oMhgn73PxB21lVOC8gDGwiusf/rAoZfM0FkzyfpaEI1o9jFU2dnGnVGYvDPcvPqFXQNKKw/GndS7ACN7EvMlS8JEoIe5G7Z2ZkJV+M1f0Nhd5mU6almcXp9iuP6U/ZwjNm6NVWo/ZXL3pqPIAm7IWZWwfX6w6UGxPVHUDkMc9y5a4ihLZCuHqwkJlJccIydorOzkg8fod96GIScBcOjKLcZn5e0XQLB3GoztWsUIcywuLqHvL7q9wZoG2Gzjma1VlWYw1FvkI5jjO212vo0B+HOcAVzkJTyFbL8Ujfgqv8I7YzttXv/juGhYtmO9Tve8WokTYGBucJLkt6q1vOdkdgYZXrdyPFOeIhBgqFonX4Tb92BYpAWZCxI7QjPO3Zu7sBy7dzoYddv7Jho0kPtwM8k2gdWRUbJfFqAam9Iw 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:(4636009)(346002)(136003)(39860400002)(376002)(396003)(46966005)(1076003)(6506007)(47076004)(2906002)(2616005)(956004)(6666004)(26005)(36756003)(6486002)(186003)(81166007)(16526019)(83380400001)(478600001)(356005)(70586007)(8676002)(82310400003)(336012)(70206006)(5660300002)(316002)(86362001)(69590400008)(44832011)(82740400003)(8936002)(36906005)(6916009)(6512007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2020 12:44:23.1078 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf404cf1-19a3-4ca5-333a-08d880bf5b52 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: VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR2PR08MB4683 X-Spam-Status: No, score=-14.7 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-stable@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-stable mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Nov 2020 12:44:29 -0000 The variant PCS support was ineffective because in the common case linkmap->l_mach.plt =3D=3D 0 but then the symbol table flags were ignored and normal lazy binding was used instead of resolving the relocs early. (This was a misunderstanding about how GOT[1] is setup by the linker.) In practice this mainly affects SVE calls when the vector length is more than 128 bits, then the top bits of the argument registers get clobbered during lazy binding. Fixes bug 26798. (cherry picked from commit 558251bd8785760ad40fcbfeaaee5d27fa5b0fe4) --- sysdeps/aarch64/dl-machine.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h index 9617cb754f..c7ae423417 100644 --- a/sysdeps/aarch64/dl-machine.h +++ b/sysdeps/aarch64/dl-machine.h @@ -388,13 +388,6 @@ elf_machine_lazy_rel (struct link_map *map, /* Check for unexpected PLT reloc type. */ if (__builtin_expect (r_type =3D=3D AARCH64_R(JUMP_SLOT), 1)) { - if (map->l_mach.plt =3D=3D 0) - { - /* Prelinking. */ - *reloc_addr +=3D l_addr; - return; - } - if (1) /* DT_AARCH64_VARIANT_PCS is not available, so always check. = */ { /* Check the symbol table for variant PCS symbols. */ @@ -418,7 +411,10 @@ elf_machine_lazy_rel (struct link_map *map, } } - *reloc_addr =3D map->l_mach.plt; + if (map->l_mach.plt =3D=3D 0) + *reloc_addr +=3D l_addr; + else + *reloc_addr =3D map->l_mach.plt; } else if (__builtin_expect (r_type =3D=3D AARCH64_R(TLSDESC), 1)) { -- 2.17.1 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.