From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2045.outbound.protection.outlook.com [40.107.20.45]) by sourceware.org (Postfix) with ESMTPS id 3F5C43858CDA for ; Wed, 5 Apr 2023 08:52:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3F5C43858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=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=T4LwA+GwsXLf8OwPbD5YgcDoY1dB//mryrynsnYZ9Ao=; b=1a5WtaJSEU7AIJ7FHeOlHwh3JSm5rdSesVwzzuH8kdwGSKWf+98KUhhC5tfrtPjxEV2kv9klkbLbV44Bq04Q4xb0S/eN6ST56ZSBEz0vjuqBtjWUFh5LwzJyHmCBs56wmumyZyaYIgPB7WIQJtc9HmzjAS7oJg/uPJn8IcFUBpk= Received: from DB8PR06CA0058.eurprd06.prod.outlook.com (2603:10a6:10:120::32) by AS8PR08MB9573.eurprd08.prod.outlook.com (2603:10a6:20b:61b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.33; Wed, 5 Apr 2023 08:52:02 +0000 Received: from DBAEUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:120:cafe::fe) by DB8PR06CA0058.outlook.office365.com (2603:10a6:10:120::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.22 via Frontend Transport; Wed, 5 Apr 2023 08:52:02 +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 DBAEUR03FT059.mail.protection.outlook.com (100.127.142.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.20 via Frontend Transport; Wed, 5 Apr 2023 08:52:02 +0000 Received: ("Tessian outbound e13c2446394c:v136"); Wed, 05 Apr 2023 08:52:01 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: df9ea4487c9fcc5c X-CR-MTA-TID: 64aa7808 Received: from 5d0806a4c955.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 16FBC25A-B6EE-44E2-AAE3-42FC9601AB1D.1; Wed, 05 Apr 2023 08:51:55 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5d0806a4c955.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 05 Apr 2023 08:51:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VfVcKVrmtKwCaIDPwhj8PVG62tYyl4Y7JKPiVUCzzGG4xEYN/r6jybwUL5ZgGE/y9cOy5KdBP+T9d+PTVO5nM7Bqt23JJVJGaoa6aLwrkafO1BNkE06b6cuWiY9gBFXGU/BeW1h85hwbRCkK8ibsRDat2jmKfTFFUCLek038++YhhagdYpNA1mrUnOvcbSG6nkGvxr6KaVlrL2MaA/JQOhHLJP+pC6L1osXFAnpMNrP1eZEKHBgCWSsCQN0MTfk3kLkI7KvwYgNi2l/RNcPUZf1seg3KUiRl8rEpiO9LtWm3UdFOwFC7wst+QtxgtLxrdbPlSOb6XbnNfFtNc/KOZA== 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=T4LwA+GwsXLf8OwPbD5YgcDoY1dB//mryrynsnYZ9Ao=; b=ihJq3i5KuKpHKrIEg9E0MSkZrTGFVy3L/32Xhq8T/IX5qEe2zgA7Quq0EI6V4Vxl8izZSuenIFhIo40ehq+RHHXkqLI5kEjr+XJxAtCunXvWOOlz81+2biCMgNsac0rPOwdAUSu1bRQiED4TnCuphquzah7rYl8V9rK0ppVvXRddF+a+gYpmugSqvK5e4pFqiDbKV2/2lRB1vKt7wiQZiH+K1nDi+bLYhWv3BKeoALos9LXhsD0/2HBXROm1p28qxWDceXu9j2FF1iQY03zEDlLwVvGos4ha/EZmBvqeoTq8Hh3N413zmASx7U5WT05rEbtGRD9O3Q/npkt8aRV4UA== 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=T4LwA+GwsXLf8OwPbD5YgcDoY1dB//mryrynsnYZ9Ao=; b=1a5WtaJSEU7AIJ7FHeOlHwh3JSm5rdSesVwzzuH8kdwGSKWf+98KUhhC5tfrtPjxEV2kv9klkbLbV44Bq04Q4xb0S/eN6ST56ZSBEz0vjuqBtjWUFh5LwzJyHmCBs56wmumyZyaYIgPB7WIQJtc9HmzjAS7oJg/uPJn8IcFUBpk= 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 DB9PR08MB6523.eurprd08.prod.outlook.com (2603:10a6:10:256::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.35; Wed, 5 Apr 2023 08:51:51 +0000 Received: from DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::e3d1:5a4:db0c:43cc]) by DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::e3d1:5a4:db0c:43cc%3]) with mapi id 15.20.6254.037; Wed, 5 Apr 2023 08:51:51 +0000 Date: Wed, 5 Apr 2023 09:51:31 +0100 From: Szabolcs Nagy To: stsp , Adhemerval Zanella Netto , libc-alpha@sourceware.org, janderson@rice.edu, Carlos O'Donell , Rich Felker Subject: Re: [PATCH v9 0/13] implement dlmem() function Message-ID: References: <2f3a10fa-4f79-7f9a-6407-d227dbf31935@yandex.ru> <298b04a6-3055-b89b-59c1-4cfbe955848e@yandex.ru> <81749d04-8cdb-de0b-b88e-24347ed535ba@yandex.ru> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <81749d04-8cdb-de0b-b88e-24347ed535ba@yandex.ru> X-ClientProxiedBy: SA1P222CA0150.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:3c2::20) To DB9PR08MB7179.eurprd08.prod.outlook.com (2603:10a6:10:2cc::19) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR08MB7179:EE_|DB9PR08MB6523:EE_|DBAEUR03FT059:EE_|AS8PR08MB9573:EE_ X-MS-Office365-Filtering-Correlation-Id: b2b6a892-2edb-4b20-0770-08db35b3061c 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: c+dcnVoqhLaM5BMkN8/3PzbWQKXlhziJX4qJC6iqo1dhFg2oN8xz1V/GzdINrtPjhp5xD5vtrYkC3cv1v4/GpY+od+UC7iessXitiELr/LaRiYeWixQANhOcIctbbJcky7kxnwjzrkpbnjWoAWBqSCg6Nk7Zvgp1cjAkmtdk9D+PQSAuVJSN4eF0GNI34zRGiCoMWNnDBgRsi372XRBXHRcoPBh2QfbTwJX5u1dFHwtBl872FTqb6+2cCDhuie9XsndbX2IViOh4TUqnmbPiV4nzw38CQA+QBO1Fl8NR2KIagjso4CdmMO7LR/WbPQTpcFywCUb2IPwNbJaf6mSs+JHEMU7/iCn1wQDXbwgjmr1+k4C8BQffqg2zKBwxkB9y+Hxp9y6SvsFx7Kqkr+gorB6JB3jnTQsNTf0gZZG/juskb3zHhkFNll83mtOtooPyEFjpgBHpminsmUngrOke5y+mSTdFjY3xLVwsjMHQdUP6xHi/RjSUVAmsE9FzHnHiGVqok7RzHXtGPQumCA3ZwEIeDhi5Qy6hdgTO/hph2geAGUDV+V3J9n9N2judo/vV 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:(13230028)(4636009)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199021)(8936002)(66946007)(66476007)(41300700001)(66556008)(110136005)(316002)(2906002)(478600001)(2616005)(186003)(8676002)(6666004)(44832011)(5660300002)(6512007)(6506007)(26005)(83380400001)(86362001)(6486002)(38100700002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6523 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: DBAEUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 30fc23ca-6a38-4bd1-8281-08db35b2ff5f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CD388VOnsAtybH/ZnCKH/a7te55O8YG+bWcLr2UZkSZaQQ3AQ6sLRN/kGBRSAUranTcYbk5Qrjs2FfHLjp7iruJtw2FhzXQ5B6T1j0Lz1VdN6LcYPEsCePEtzFDcRyhvkChedCzZq7mCauE65RBvoo8vl4YeMxLHmQWXrIT3xgCZfeclAmmXmMkH80Z3oF4a27BuJ0qQdBBS6MJt9ySM6bVTUojIg3rVzGBpBpaJyjL67wgL9VHqKtbZjYeASpD4eENIbQtitBVPqWnTZYhME2qQAFxXMfERIUWmB8ChpPaE8XzNuy5ik3SfYxqhYtu0GEDnAAPLTVEUIGvPcwcPjUL9ykZTxR3n2A76igOraNohAemC1Lg92s1U+3fuD16PlA7vf4S9t3YKGyZhh1SAswYuwIuGjDhPoHuKZfndZEvgKLIEVJnIhcl13v8W3yNO2rloLHPoi8nPm27woPZO74Rnc50q2X+IzjEgjy0S4fgIJ5c6Q82DP2DZ6G3za6E2v7M2m0tD7CXgJcK+PoEFnVqeIFEmmwW4I6MvQ/wSDpWQZCpwHr6YkNNXLWUtbTZu/+7hN/Pp0LCEAYPliJ76BNIMQbXGCiUDKLowTKxk/DFtyAfqI5qKKMnaXsyFysGyQsGftiFprmC89tT0ZPxEeYx0so9XMTFK6Q/N4egksK+eDURPwDscnJ5HUApYbk0T8taIF8dYBMO86SIr84w2yg== 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:(13230028)(4636009)(39860400002)(136003)(396003)(376002)(346002)(451199021)(46966006)(36840700001)(40470700004)(86362001)(36756003)(2906002)(82310400005)(40480700001)(2616005)(47076005)(336012)(6486002)(186003)(26005)(6506007)(6666004)(6512007)(83380400001)(8676002)(70586007)(316002)(70206006)(82740400003)(36860700001)(478600001)(40460700003)(41300700001)(44832011)(5660300002)(81166007)(356005)(110136005)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2023 08:52:02.0819 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b2b6a892-2edb-4b20-0770-08db35b3061c 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: DBAEUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9573 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,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/05/2023 12:29, stsp wrote: > Hi Szabolcs, > > 03.04.2023 17:01, Szabolcs Nagy пишет: > > a user callback must not run in a context where libc > > internals are exposed (e.g. under internal locks). > I checked that part a bit more, and so far > my findings are (let me know if they are wrong): > - That code indeed works under dl_load_lock, >   but it calls audit callbacks rather freely, and >   I don't see it releasing the lock before calling >   the user audit callbacks. > > - dl_iterate_phdr() seems to be calling the user >   callback under dl_load_write_lock lock. this is a known bug. (audit is special because it is not an api for applications but for tooling that hooks into dynamic linker internals, it has its own abi versioning so we can break the abi more easily and those tools are expected to cope with it. it is necessarily exposing internals, so new hooks are more likely acceptable there, but that's not true for apis designed for application use.) a much bigger issue is calling user ctors under the dynamic linker lock which did cause issues in practice. another issue is calling malloc under locks when malloc can be interposed (likewise it caused issues in practice). i did not say glibc was clean from these problems, but that does not mean we want to add more to it. > > So my callback is called in a same context > where audit callbacks are called, and also > other callbacks seem to have no problem > being called under various locks. they have problems. in any case dlmem has way too many issues beyond the locking one, the fact that you don't document nor understand the issues around the huge interface boundary it creates does not help either. to successfully propose a new api you need to use the same rigor as posix or c standardization would.