From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2073.outbound.protection.outlook.com [40.107.249.73]) by sourceware.org (Postfix) with ESMTPS id CF8EA3858C39 for ; Tue, 9 Apr 2024 08:31:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CF8EA3858C39 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 CF8EA3858C39 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.249.73 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1712651480; cv=pass; b=eeU4T5J8yHjldUcZDOo40UNnyrjApXTRv+e+0gQx75JZniId2Co6XSCs7Gu7E8p9vH/E+8EmFQRtUVmzrT8tDV3kFza6A/gp9WE0IH13Lry3bWNv7uCk6T9zdcZLqDaiwghVwSCHeW9YFdxZbZzbU4dhyt/Zymx3RnLg4PhXU5U= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1712651480; c=relaxed/simple; bh=J3op1BsUihiUkOlQreR7JbsskUd51v9eOuxKpIx+5/s=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=XeOCsQJveksCE3T6SIRqUk8sI2a7XADLw4Wqfh/gHWwYjSXTE9zltLpMH5B8XnT1OCvil8uZTCdgBpWBTWoqia8ZPf8OQ3j5pjFRWZbKvpvzSoVg74X/BBcMSmd6x6KODgOKdQUzXr4t0J1vnwJltns77PMdXyY8Dc3Uw2PnhUU= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=MhAA91L4lZ4skobS8JIHvcGWrWF3z916BI/S4h6XStzgdC5rl9jw9L0OZrSKYVe4KUs4Ookj+dVUkeHUElB143+XGpOG+O9NL/S37l0gLpqmoOqdFYR1ndx61//M0hx6k1XLxBFiwatzbsuMdVQgVs/IpcAUzxTys6bQ+/Pm4YqhfTmLanLbZEmRq/vUQ4gWZMo8JyDxsN1ANtvnPSXKkfEP85BPjrOmT0RCsyy59KGO++EsTWAG9K4TuwuWvPMhq1vt/4NiZ17dbe8yGB/CnGBaJlX0HJ3NH1FJCsfAWZMjWmrruAnVmNMJnJOxg8I4LeDJsFs6axyQHxMPTLaBww== ARC-Message-Signature: i=2; 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=Vh8L2qFc4UTfntvhUvOQB6wVvhf4lP0Rx+Jkx0JbvHA=; b=TBpNsOSaP4Os0j3eVI2uQ65h7o20YQeiqLi+HLRXGNfLVx8LN0LaIXRnnSlerLU9UH8gLaiah6C4DOJsJDxXkB0ChQfBijAfUfJZ+PlHMIDm7GgiyNztu0c/79+disOjxatC3kakfp5vgK0JaR+0EkAyVzavLfBzJRjRJlI/8qLHez0hdjQQkPz332u+t6Cz618bYjF85ee/mMiy3liyLoOpoKyomj4AUo8xDRbOOYAKLhjMtVHDwsiz7TcDgWSlFgWTYrYdnGO7NEcHRK2JB87bPMmgHtFOZ9zNXquUiHmA5Y7QIeA/Vf3kzGEyYk7PK44ZbCvckMxsEXJmOaxcwg== 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=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=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=Vh8L2qFc4UTfntvhUvOQB6wVvhf4lP0Rx+Jkx0JbvHA=; b=3Fa+hH2I5amm0IBPXhJw4GCfKZcOErK+T6KdTyZ/lepcqsgJUOtnvXjV8/8rktQzCAQe7Ue5Ue7HeRIaiNsFTxpxTR4zgaLCuS4Ojh0VjuCCnffGNJe7zE1o0zBfMbjmz1OliElH5/6Q2fC+i6uSPvGHMqCzrJNnz/zCbuv4WvE= Received: from DU6P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:540::24) by AS8PR08MB6503.eurprd08.prod.outlook.com (2603:10a6:20b:33b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Tue, 9 Apr 2024 08:31:05 +0000 Received: from DU6PEPF0000B61F.eurprd02.prod.outlook.com (2603:10a6:10:540:cafe::d3) by DU6P191CA0013.outlook.office365.com (2603:10a6:10:540::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.36 via Frontend Transport; Tue, 9 Apr 2024 08:31:05 +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; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DU6PEPF0000B61F.mail.protection.outlook.com (10.167.8.134) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Tue, 9 Apr 2024 08:31:04 +0000 Received: ("Tessian outbound f0b355493f75:v300"); Tue, 09 Apr 2024 08:31:04 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 0cf7f6245583bc86 X-CR-MTA-TID: 64aa7808 Received: from 6c955c74b396.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 08A9DFAB-A2A6-498D-8573-0310ECD0999B.1; Tue, 09 Apr 2024 08:30:57 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6c955c74b396.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 09 Apr 2024 08:30:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PwpFj8okUVoBfZKnp1ydr1wIDn86UzE2xIl9XtlpGesOfhqJTPGVWINByye+LMDStDBTxWhvrBpz7/w2d5A6r9y5vkFdLP7+6i+bKBa2cZV1ggXT367Wpo+lM8WgIqu9pmDCVOGhAGsROi0A0AKIn/Nx0gcGq+r1tKDqvSB7p3U5pawWT2heVmpO7NR4fjyixXri6Zy1w46Q/7IcvFsG5+o7DKcIEut9feLE1ZPMOQDtuVXwcVdlR2gSy88LjII9i+mkeH6NzuWH8JYf4wIB5W0qua2tONOh/r5uc4bEuiRYzSsePGNwezmwWoVhe9vdjIj7yjh5YaR6Jq/1vu1xeQ== 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=Vh8L2qFc4UTfntvhUvOQB6wVvhf4lP0Rx+Jkx0JbvHA=; b=W7Gtd9DsYo6OG90NNgF84oGIV9vzK6dpWAx3Ws2fEOer4d/E9MBS3t0dLVppljLx2Yfzq1X1PNdcFVBagdbKfUqTcMQWDPSXV/kxG9kQVTIi8yoMx7pygb1RBRIWkw9o/CAOIzaXqc326xgqfZ44oWa7fKJTFdd6x16vDl7yLib0Pzq8VTH6drHdJSxH44enT+ZUs56r0hrOr6ecnShOU3nICQEwjCf95DHgXoTE7t1PomCnZ//FVyVJi/uiLHCJmBXzRq2UCFId88n85NzUSVLPNed1PgqpxMWH8olcBCDXfXqFbrOJePgdWelYRkNNlaC1xd/s8Rqh1wt2ptlm0A== 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=Vh8L2qFc4UTfntvhUvOQB6wVvhf4lP0Rx+Jkx0JbvHA=; b=3Fa+hH2I5amm0IBPXhJw4GCfKZcOErK+T6KdTyZ/lepcqsgJUOtnvXjV8/8rktQzCAQe7Ue5Ue7HeRIaiNsFTxpxTR4zgaLCuS4Ojh0VjuCCnffGNJe7zE1o0zBfMbjmz1OliElH5/6Q2fC+i6uSPvGHMqCzrJNnz/zCbuv4WvE= Received: from DB9PR08MB7179.eurprd08.prod.outlook.com (2603:10a6:10:2cc::19) by GV1PR08MB7329.eurprd08.prod.outlook.com (2603:10a6:150:1c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.47; Tue, 9 Apr 2024 08:30:54 +0000 Received: from DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::8c23:46ef:c2c9:ea91]) by DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::8c23:46ef:c2c9:ea91%4]) with mapi id 15.20.7409.042; Tue, 9 Apr 2024 08:30:54 +0000 Date: Tue, 9 Apr 2024 09:30:39 +0100 From: Szabolcs Nagy To: Adhemerval Zanella Netto , Cristian =?utf-8?Q?Rodr=C3=ADguez?= , "H.J. Lu" , Florian Weimer Cc: libc-alpha@sourceware.org, Vitaly Buka , Fangrui Song , Evgenii Stepanov , Kostya Serebryany , Dmitry Vyukov Subject: Re: [PATCH] aarch64: Remove ld.so __tls_get_addr plt usage Message-ID: References: <20240405123550.1748641-1-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: LO2P265CA0127.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9f::19) To DB9PR08MB7179.eurprd08.prod.outlook.com (2603:10a6:10:2cc::19) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR08MB7179:EE_|GV1PR08MB7329:EE_|DU6PEPF0000B61F:EE_|AS8PR08MB6503:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: hzvyWixDAVvYPBMBP09Ojaph4btbhjawd1Rew5FcJGsgjrZhI6KVF9er/m7FfgRtplLRjylnc56Dmm9aIuw/w3ZhUy5F1avDtButHRx9YPN1Ghtrnt5PLd917jz/efJ8ltVrTHecMGMIkB8BVbQbOj3GlBQg8VhFhvWsJYTSsb0w1zLSqbyRMoVn7ir5oZK/hiTdp7KgC9sj9q8QQ28CqjtIAa0OspbA0FwX5BrOl4a7SKzBInAAKJBgE2XudbRjkm+JLmbNKhKynMLjq5n1B07MDxrhK7+64IAFSwO1d1x2NDbUrMrMXyxpSU+z1YC4NTbl9YdWyWuDpeXOqAthykg+ML0DGjwhiudP6VHedh5xrlJ/39xcFVzpOqGH9BNFiAojRYtmFTgUdXFEiaR1pP/VToKWT1wDPBK98jCiKkUC/XO9L+mFdgjo3QF59/2ya2PVrMiq0Jxbl2bL6igGVVHuVOBTUVY1/THzz935DQcEQP/TUol1fUtUXp7U6LyYTT7Pt08WXE2InY/xXufyNDLntaB82g3vNGA214sGrh7YafN5zx+UKdndX8mX9L0XtQgw6qDibBjJ/CM+8drdWxUIIvUDUk1DLENyKPCABVKryEen9tGALfJqB3AWYSXMXqXQyiPwA4SWUdfj3SePx6xIUm/iYztyLZEt6GP7OsM= 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:(13230031)(1800799015)(376005)(7416005)(366007);DIR:OUT;SFP:1102; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB7329 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU6PEPF0000B61F.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f5946e92-6160-49fc-5130-08dc586f65aa X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HS6AmEHuid7Ls0zHdZ8uCi/04xhbn/9wg/DqmzId3+rd45Ehgn0w/npPfLn/g0cA4DG7uuU1ApPqZUYaf0qPK35y9RlYoF5doAyicTgABBCy0ZMbjUihcKVHtUphIPC4A9d+6iDEwIz7FOdfusn/Pf4WQzadosIEgvcJI9xQ9TzQ42mjibaf81jFRWaUvtxmj/vrq0heBfxWO52xzpyj809ivZff3b8QzpQT9fNhyJF0GtnpokulI2zgmrpbpb7CbethDqkc8eqQ1jNiIWXInSnyatSu2TfFTD5hhI6ztXVYzLuRtcHXqkfuNbH7GkLEfF7056L6fiSMddc+c/a/4zMAG0R8axm5V/MGsPzJP3cT7RsvAW3e9RmlZ0UWN90RP3xjRXQfR6MADmMkdp0WfEagbpOwNj34L6CKaHre/lGWZ/DrGC/iDgq2A6mh32FYJkABpyrjH6DW72LU93LgIwM9Jn0gqRMCMCPGW5r4z6M7DFFtaKL0n3D1MYf207m5VewhEU9tRKJI8Z0QKjMlhlgOUyFCpuXh6/bZXNRp9hLW0lFOPDg7wRsXyNH/WUcrVkJI8PpKa8VSE4jYHp8PlAiBukCjhTK/VtR+DmkS4GufckeN2w1BEd137rWy4QiXuOh8Rpvf6m/YY+bF6eh6Sa1J9evrg6OCpAI1veqjKoQFQM9j3+VSZV+zLHONXvegMSbSLMSNr63Y3KHxrwbMaEpOvKodb3xK2q/A3gdGQkQw/TxL4cQ804LwdTOzm1hWPWs9+LwrJVv0fMa1l9I/xg== 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:(13230031)(1800799015)(82310400014)(36860700004)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2024 08:31:04.9886 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f5946e92-6160-49fc-5130-08dc586f65aa 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: DU6PEPF0000B61F.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6503 X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_MSPIKE_H2,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 List-Id: The 04/08/2024 13:57, Adhemerval Zanella Netto wrote: > On 08/04/24 04:26, Szabolcs Nagy wrote: > > The 04/07/2024 16:29, Cristian Rodríguez wrote: > >> On Fri, Apr 5, 2024 at 11:59 AM Szabolcs Nagy wrote: > >>> The 04/05/2024 09:35, Adhemerval Zanella wrote: > >>>> Use the hidden alias instead. > >>>> > >>>> Checked on aarch64-linux-gnu. > >>> > >>> does this change behaviour in case __tls_get_addr is interposed? > >> > >> Wut ? is that really supported.. I mean.. isn't that symbol prefix > >> reserved for the implementation and any assumption about it is either > >> ID or UB? > > > > a behaviour can change even if it's not supported. > > i did not try to imply that it should be supported. > > > > i know sanitizers interpose __tls_get_addr, because > > https://sourceware.org/bugzilla/show_bug.cgi?id=16291 > > i don't know if that hack works at all now for tlsdesc > > (where the ld.so calls __tls_get_addr, not user code) > > > > my question was if we investigated this issue since it > > is useful to document then in the commit msg (or news > > entry if this affects users) > > This change 'breaks' the sanitizer trick to get the dynamic TLS, with > this patch I now see: > > MemorySanitizer-AARCH64 :: dtls_test.c > SanitizerCommon-asan-aarch64-Linux :: Linux/resize_tls_dynamic.cpp > SanitizerCommon-msan-aarch64-Linux :: Linux/resize_tls_dynamic.cpp > SanitizerCommon-tsan-aarch64-Linux :: Linux/resize_tls_dynamic.cpp > > And it does not fail on x86 only because it uses -mtls=gnu as default > (the same tests fail on x86 with -mtls=gnu2). > > Now that GCC and distributions are aiming to use GNU2/DESC as the > default TLS, this hack will also break on x86. So the question is > whether we revert 050f7298e1ecc39887c329037575ccd972071255 and > document that __tls_get_addr should be interposable, or move with this > change and try to come up with a possible solution for BZ#16291. > > I bringing this because we will have another two ABIs with tlsdesc > support (loongarch and riscv). adding some sanitizer committers to cc. tl;dr: in the next glibc release tlsdesc will not call __tls_get_addr in an interposable way in the dynamic tls allocation case, unless somebody screems that this is needed. (affects targets that may default to tlsdesc, but note that the dynamic case only triggers with tlsdesc when a lot of dlopened tls is used, otherwise static tls area is used) i think it is also possible that we will use custom malloc in ld.so which may be just as big change for the sanitizers. (this can make tls access signal safe) i'm not against the change, but if we plan to add several interposable hooks as in https://sourceware.org/glibc/wiki/ThreadPropertiesAPI then we might as well keep __tls_get_addr PLT for now.