From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2047.outbound.protection.outlook.com [40.107.21.47]) by sourceware.org (Postfix) with ESMTPS id 6194E3857C47 for ; Tue, 18 Jan 2022 13:36:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6194E3857C47 Received: from DB9PR01CA0029.eurprd01.prod.exchangelabs.com (2603:10a6:10:1d8::34) by PAXPR08MB7171.eurprd08.prod.outlook.com (2603:10a6:102:209::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Tue, 18 Jan 2022 13:36:35 +0000 Received: from DB5EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1d8:cafe::a4) by DB9PR01CA0029.outlook.office365.com (2603:10a6:10:1d8::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.10 via Frontend Transport; Tue, 18 Jan 2022 13:36:34 +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=armh.onmicrosoft.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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT039.mail.protection.outlook.com (10.152.21.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9 via Frontend Transport; Tue, 18 Jan 2022 13:36:34 +0000 Received: ("Tessian outbound 826a6d8e58c3:v113"); Tue, 18 Jan 2022 13:36:34 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 26f64248eb71abe0 X-CR-MTA-TID: 64aa7808 Received: from ae463bf6635d.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id DB2BF807-11FE-41D1-A1A9-B96D9390039F.1; Tue, 18 Jan 2022 13:36:28 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ae463bf6635d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 18 Jan 2022 13:36:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gD3uysOUDQzA3VB6DXlxfGLn3M4/ZZNeq4LcUfHw9pfa7wvBzj4Ux/0XrcNPU08MU3Woiu2TmSBwajvALSzTu3aOw/lFq3UA4AZuNYQNVNjVPwULfuxSk2Si4pCUjrgRlYagBYXl5QIzniMg4yor8z48aaK1ElEpLLMxvUUEIo77u1cL/pXsPmLVDQq8EDmwwfAjsTkQ001y8rASBlRXeCCl3nLhTqiu4Y6h5BGwe8L6egB7QTCGGEPoWSOd8ozSedKNgCha1r79uU6uWJHsTGrIQ4J1+C5RrKqc1aih02lrfZSE9RHP0iB/VHKsO5FZhTQbvJJpMpFBk+GiVyDqEg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=asQ2+1WK6X4cIT6uVxFDzcJ8uYZDc3+ZkhiHyXFPTzg=; b=LdbkkWV3YVH5e2uRsEVOUZZ8PebvjPIj9L3/J/mde477TKpy5PTZB2Gw1R06mansvtihQacj8eVoaa8MJxjiXUbOjxH6Ij4pkCYeGgbqNjKeEfBy66A664GotUMCfZ1K6LXTW2m6qORWh97NGtdRzH13i1rMSFK/NVgSPNbDFGDLZsiZFZLijDoTIm2Nbq753EtsErG6emJNxpPjOwUv6xoB9r9/cw94FvG/dxBn4cGgCvwHeRy2ivYO8eGxhGYwGzaHQAFiN/tgKF8vl2pCiHGKiqdnsKzlHxEXw1Pih4DZ/EuxejSCX5CrE4CDQEdDyJdND/MSxodgYqjFB/p58g== 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: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DB9PR08MB7179.eurprd08.prod.outlook.com (2603:10a6:10:2cc::19) by AM8PR08MB5666.eurprd08.prod.outlook.com (2603:10a6:20b:1de::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.7; Tue, 18 Jan 2022 13:36:26 +0000 Received: from DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::25f9:a7e6:422a:da43]) by DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::25f9:a7e6:422a:da43%7]) with mapi id 15.20.4888.014; Tue, 18 Jan 2022 13:36:26 +0000 Date: Tue, 18 Jan 2022 13:36:21 +0000 From: Szabolcs Nagy To: Adhemerval Zanella Cc: libc-alpha@sourceware.org, jma14 , Carlos O'Donell , John Mellor-Crummey Subject: Re: [PATCH v10 4/4] elf: Fix runtime linker auditing on aarch64 (BZ #26643) Message-ID: <20220118133621.GG3294453@arm.com> References: <20220117213136.1327053-1-adhemerval.zanella@linaro.org> <20220117213136.1327053-5-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220117213136.1327053-5-adhemerval.zanella@linaro.org> X-ClientProxiedBy: LO2P265CA0089.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::29) To DB9PR08MB7179.eurprd08.prod.outlook.com (2603:10a6:10:2cc::19) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 438f8ec4-2027-4516-e6e7-08d9da878baa X-MS-TrafficTypeDiagnostic: AM8PR08MB5666:EE_|DB5EUR03FT039:EE_|PAXPR08MB7171:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: SA1aDTJQHCNsiOWcYYViOyyhKwOkVtv+OTn5pwlxRDnu2vSpAssZ7F1TU3gxKuam5ORGu1rMJ1yhGjbvepb21UK3ZkzYUU4vlJrJgKSEVSM1MseHKwXKdhULMI782VYDQIRRf0Liyn0D33ikGbBrPA7VUbifPeHC4rJiy1abcvV3NQfRnWPxzOWl3DrAcBn1SmX0Js0DEfK36Z+AFv/zoeoJMOTHCgHUiq0IyYyfQlg+W2j4gXGBAzaIZZkoh+6ax1wueCdsyv8YFJfYuttCMGyROcQOAbHOJC3YaFuxFQHT9LjpD5TaDsgY4ZY85mX0kJWEm7X0t4EP7BFKN0K3h8slBJt4W8ck7IHO0EpJE1an7qQggvfYHoFAdhhYKPJbcpHhiAcKCWOe3oE4UpZEe8CAe9+Sma2Ai7MBGK3vai6CueAcWCd6YtAM7pdOdnwtbnhbYP5oBHuM2DMnFZIRksv3FJGdgn6ooenB/sFOH+mPCJfAt1vNHe+2xIGb0fhXKynEgAziWJqza2V3JV1aqXKiZF8j5hJTa+IgOYZwjM9TEURIOYPtof2S7ot89ok6FXQVf3GNREfz6NzEvN3+vqrhqLS1YTOkNVtoF40828JgJB1G6Fdut7FQJTPDy6KaX88oyRHRGYfMj9ltq+LG/N7v2tbfqGC+CCCxLuAoBASVz2kaJx44kgjjF9jbXLW5b73DUXlRQfgqYu9VgFqlBw== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR08MB7179.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66946007)(66476007)(6486002)(8936002)(6916009)(1076003)(2616005)(5660300002)(36756003)(66556008)(86362001)(44832011)(54906003)(33656002)(26005)(316002)(6666004)(8676002)(186003)(38350700002)(38100700002)(6512007)(6506007)(83380400001)(508600001)(4326008)(2906002)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5666 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0e7ebd07-2cb7-415f-b46f-08d9da878622 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o1VcqUa24fhHzAmFjoEr3rlpxa/jQZjj7Gn2qlJwvVcE2FwqzulDbo8OKexnprbe4IpMEz7CPr7UQQX65cTJ2VVYzUoD7c7Yl4OcPBoYdi73uP7aVo/CvuSuuPy5250hdSCEKyLmOVyaOc8YSGOz3bkvcgFxilw6UYbgE6l3GzFPJVWnEOjfeW8LhGNGCOHfsQK8Tzju1pw0Whqz83qGGKqWH4cmmCLkG26wTEiJ/ba5in9bEgwOl/b/Qp2ZGyiIwW7q044bbHtboryw8c4O7Ltk4Rn1+DrLUdC78HELjsgtwnoItUEeNerwC9o0oZ11zPlzuUboED1vgxQCmWdobX+Br2cThlFMeDI+2Nmu/o2WnyKA1A4yl4QBn9CUocsMSKV05DokfIVS2t2dChi2MwEkI7+I9xmq8FWwaAgjHdJLL3OKzcnXPybSOYEfty+oy8aaElVsDC3iQPXRdond75QptFhrh8GcQVt6QiezaEo2KEWGGBcrjTdUUeTr6OGaFApHTFzCkmyfpQSUcnoYoE80nuFnTF2RPWZU++L6oq48QZ6IgeMyxxhkh45lw5zClLec1tor3KbJfUUUiB7nYUxyr3fzzENddv87GyqwJHfRb+dhpH/WL5dDztWk+XEhMe7s36uyXNsTCdb8HixPhyXB36kQtwOT/EMrrDirHum4MdhY1xYkeZu0IxTm/xFMXtlbifCp/RlOYkObDvPkNg== 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)(36840700001)(46966006)(47076005)(8676002)(186003)(107886003)(356005)(6486002)(81166007)(6512007)(44832011)(83380400001)(2616005)(316002)(1076003)(6506007)(5660300002)(6666004)(33656002)(336012)(54906003)(26005)(8936002)(2906002)(70206006)(70586007)(36756003)(508600001)(36860700001)(4326008)(6862004)(86362001)(82310400004); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2022 13:36:34.8309 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 438f8ec4-2027-4516-e6e7-08d9da878baa 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: DB5EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7171 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2022 13:36:39 -0000 The 01/17/2022 18:31, Adhemerval Zanella via Libc-alpha wrote: > From: Ben Woodard > > The rtld audit support show two problems on aarch64: > > 1. _dl_runtime_resolve does not preserve x8, the indirect result > location register, which might generate wrong result calls > depending of the function signature. > > 2. The NEON Q registers pushed onto the stack by _dl_runtime_resolve > were twice the size of D registers extracted from the stack frame by > _dl_runtime_profile. > > While 2. might result in wrong information passed on the PLT tracing, > 1. generates wrong runtime behaviour. > > The aarch64 rtld audit support is change to: > > * Both La_aarch64_regs and La_aarch64_retval are expanded to include > both x8 and the full sized NEON V registers, as defined by the > ABI. > > * dl_runtime_profile needed to extract registers saved by > _dl_runtime_resolve and put them into the new correctly sized > La_aarch64_regs structure. > > * The LAV_CURRENT check is change to only accept new audit modules > to avoid the undefined behavior of not save/restore x8. > > * Different than other architectures, audit modules older than > LAV_CURRENT are rejected (both La_aarch64_regs and La_aarch64_retval > changed their layout and the it does worth the to support multiple > audit interface with the inherent aarch64 issues). > > * A new field is also reserved on both La_aarch64_regs and > La_aarch64_retval to support variant pcs symbols. > > Similar to x86, a new La_aarch64_vector type to represent the NEON > register is added on the La_aarch64_regs (so each type can be accessed > directly). > > Since LAV_CURRENT was already bumped to support bind-now, there is > no need to increase it again. > > Checked on aarch64-linux-gnu. > > Co-authored-by: Adhemerval Zanella Please update the copyright years in new files. With that fixed this looks good to me. Reviewed-by: Szabolcs Nagy