| Message ID | 20260922155441.4094862-1-daniel.fellows@arm.com (mailing list archive) |
|---|---|
| State | New |
| Headers |
Return-Path: <libc-alpha-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F38894BB1C1D for <patchwork@sourceware.org>; Tue, 22 Sep 2026 15:56:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F38894BB1C1D Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=Ie8kj/h1; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=Ie8kj/h1 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11010012.outbound.protection.outlook.com [52.101.84.12]) by sourceware.org (Postfix) with ESMTPS id DE3294BAE7CC for <libc-alpha@sourceware.org>; Tue, 22 Sep 2026 15:56:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DE3294BAE7CC 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 DE3294BAE7CC Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=52.101.84.12 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1790092565; cv=pass; b=kLKJ4icr/kbRVZD7tIMLQDoUjzmj4nyRxiRXi3mCn6y79dv7QzLxz8bkw7sulZVX/J3buxHfwxDyO0AgyPNkfKhfwfDpUAZTk96Mmn608ygFpY/PZUipBSrUb6LErpSw33LNqBsql7wg2LYYI1M3xt5gh26besLpy1j/PUwf2zw= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1790092565; c=relaxed/simple; bh=Leq0BhY8oi1rqoKjbluPL7V9rwSs4EVo9h31aDPgXn4=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=eb5TFNUF/DRW5rn8lVbAGjnr+YygLqtwV5XwUtfMn6HQXFSqyTlTdNGoTR8MRcFtBjFzMzPP47QyTKMQ1pctcRPkECQ5ox+4aGijpTpRSgY5muM+bHuNGNePFAbalbPeGilWayTRyAzaUnwnI9ms7wmUWWgiHYjNQ77m5/JLBOI= ARC-Authentication-Results: i=3; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=Ie8kj/h1; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=Ie8kj/h1 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE3294BAE7CC ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=O4OS3awrotwXr1feTgJqbIXdXcE7dHxytNGbIR54op2gH4T+/Te+LHZY7/BiLpL61rmgOnsiN3aX2xChrC3BW/OnMUp0+HbwbmVc+O5EipLJzVoSlSdjxbFZ/r4kdLWYSS9nRnhmBqSG5vLtm150N183x3ANXx502YLZPpriJBVyeq92aq18PczbgGOOv3j7lOHcfAvR4gxugLcVQxpSShNRbxagHyyadgF+j40or11BMFJmS2fE7FbHlsBtpTUj+ikaILUTavOlgD/f/K5RM0DpEl1Jp7ADDPkKux7OLCBsoV1fUqKhfJWKFpjsdK5PQieKnyQsILNeWMEfoaG5fA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=h/WJQOZPn0VR4Gv7PmJxlbDUK7x+TTySlSvkWnHJ84Y=; b=IvgUersroe4YYaPahna+4jGVX7zL+/36zu9pf5MQeE9xOEd6esI7OjVEKuaWG74q/zMfm5IuRmXoQ9JMd6Sx2ZSOP7pNEfMamfB+O5ieDWwaiPafxn0Nu+t/sGcb52DZrMNZcBNLeoh7Nmrbj+ocXWptbbiJVzQx/m6iRpQPMQ6f9gT5KMvT2qlSlya1ILg0mSLA6UdAP8eSVF6XjSo+zuT0Zgc7a+B4mvVxvELHCa+BQj+M7wU0NFi7H1ubFTj2czoMJo9vYeL3cgnJhl1LQrqk3KRsxiKuZT7xn8UgxMJkuMCOHNbV9WW8fPve1cD4VpiUHIL61iL4mjRS/9yPBQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) 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=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h/WJQOZPn0VR4Gv7PmJxlbDUK7x+TTySlSvkWnHJ84Y=; b=Ie8kj/h1adAe+7n/ALiAGhjncyBhJ8t/cRPoBzET/YIrYe6b9oYcjfOr0pzA8adZmooDbFeKEUUvNQHkjlxUOoLuw8wQFcTTC95NkAosuKMRFJ9HAMincF0d95C1BOXVWNdr8wCC6lr4TCqw51sQFUCckTKVvLkmqXZ6zKISw4k= Received: from DU2P250CA0008.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:231::13) by AM9PR08MB6209.eurprd08.prod.outlook.com (2603:10a6:20b:283::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.451.13; Tue, 22 Sep 2026 15:55:52 +0000 Received: from DB1PEPF000509EB.eurprd03.prod.outlook.com (2603:10a6:10:231:cafe::17) by DU2P250CA0008.outlook.office365.com (2603:10a6:10:231::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.428.17 via Frontend Transport; Tue, 22 Sep 2026 15:55:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by DB1PEPF000509EB.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.428.7 via Frontend Transport; Tue, 22 Sep 2026 15:55:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=X2PCg8g7zY1yTWP2b3CC/sz9nkpzmqPlMYRl2Thrf3KCwRmFbiOuv3R1WUAig7+Wu2I5drwI+uX6r6VBHbu5Ugix6UWBqvTlpiZ40ifpwv34i3WFzEjRzWPZ+t6LHL1mY8kF7CevByPJ8PD7rlJygBjXaQmpSY5ubKZIje/ALsNKsQtIjgREl1+uu30pvJ78WZ73hJy3Nv/4nD1cg7N6ZdnVSuwpn7bUlTz7QYO2F2z2v5RSFceVfnrRQLJTYpKwy4+VEntgoqsKyGgkcCwOUAv4lRpapIZEf2wYXuD89b6pLP+iHLsSGZzMLae5a07iP9gIAIyKvesswrv1GktG3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=h/WJQOZPn0VR4Gv7PmJxlbDUK7x+TTySlSvkWnHJ84Y=; b=bw4pkERoQRXs1fiMvbjb6VA7RFb4VJgbGlgQUPwLtwYnuaF/dYc33IR0fPT08189xOI6oBTg2rBVpTVBj0cN6T8GbO8vId4RJvkc+f6cRwOv4zE8vzjOevL8Rrwi28RrEZ+G8rfJQf171dQDNplvSOrdPzawXItDPGVscmPW19aXVOtErpxBtLp5IRT6V6rAmkDiNdL1j3Qwqj6YMjS+er3tTwNdz6sQlsXU0LVkXFau7GbebvJoDIeunjl2aXJFcWlrXL2E19pllu7tUSA2D3wJ9G+92SmczG+ovR2F60czlVBV/tc65hqY7zg9ZVJ6laVI7yzMr76+EgzJ5Y2Luw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 172.205.89.229) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h/WJQOZPn0VR4Gv7PmJxlbDUK7x+TTySlSvkWnHJ84Y=; b=Ie8kj/h1adAe+7n/ALiAGhjncyBhJ8t/cRPoBzET/YIrYe6b9oYcjfOr0pzA8adZmooDbFeKEUUvNQHkjlxUOoLuw8wQFcTTC95NkAosuKMRFJ9HAMincF0d95C1BOXVWNdr8wCC6lr4TCqw51sQFUCckTKVvLkmqXZ6zKISw4k= Received: from DU2PR04CA0071.eurprd04.prod.outlook.com (2603:10a6:10:232::16) by AS8PR08MB6311.eurprd08.prod.outlook.com (2603:10a6:20b:290::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.451.13; Tue, 22 Sep 2026 15:55:19 +0000 Received: from DB3PEPF0000885F.eurprd02.prod.outlook.com (2603:10a6:10:232:cafe::4b) by DU2PR04CA0071.outlook.office365.com (2603:10a6:10:232::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.428.16 via Frontend Transport; Tue, 22 Sep 2026 15:54:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 172.205.89.229) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 172.205.89.229 as permitted sender) receiver=protection.outlook.com; client-ip=172.205.89.229; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (172.205.89.229) by DB3PEPF0000885F.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.451.8 via Frontend Transport; Tue, 22 Sep 2026 15:54:50 +0000 Received: from AZ-NEU-EXJ02.Arm.com (10.240.25.139) by AZ-NEU-EX03.Arm.com (10.240.25.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Tue, 22 Sep 2026 15:54:48 +0000 Received: from AZ-NEU-EX04.Arm.com (10.240.25.138) by AZ-NEU-EXJ02.Arm.com (10.240.25.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Tue, 22 Sep 2026 15:54:48 +0000 Received: from e133296.arm.com (10.57.75.1) by mail.arm.com (10.240.25.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29 via Frontend Transport; Tue, 22 Sep 2026 15:54:48 +0000 From: Daniel Fellows <daniel.fellows@arm.com> To: <libc-alpha@sourceware.org> CC: Wilco Dijkstra <wilco.dijkstra@arm.com> Subject: [PATCH v2] elf: Fix tunable comma iterator Date: Tue, 22 Sep 2026 16:54:41 +0100 Message-ID: <20260922155441.4094862-1-daniel.fellows@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260918145925.3101057-1-daniel.fellows@arm.com> References: <20260918145925.3101057-1-daniel.fellows@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DB3PEPF0000885F:EE_|AS8PR08MB6311:EE_|DB1PEPF000509EB:EE_|AM9PR08MB6209:EE_ X-MS-Office365-Filtering-Correlation-Id: 02337fb8-c637-4391-a68a-08df18c1fa93 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|376014|23010399003|1800799024|36860700016|82310400026|56012099006|11063799006|10067099003|18002099003|22082099003; X-Microsoft-Antispam-Message-Info-Original: /bOdaU63k9y7fRhFLhDKhhsV/uGnVYL2nEyUVuWwp08NQHvUCuf8xqkKm4RjUxthB8ayskr6yWL9N4Zfowwc8YzpA8/eEU7weVQXZ+u2lk739yK7iEVUvXEXVZvJ9vE4OTJCl4P2Lk/zIv72W+ZR+tI2zdqDyKz0DqkkEVNkTwVCvjPUNSA1OvhPPZiqXzVnxQ9Hgo6E24DhLfqM/R7txGL14rz++lysT/Uqvzjdkp5Yb8dYy1IidmxThuXWd9HA3458Odch6tSPNX8J48PZO9rkIYGZElHXNcAOOLHRE/WLCTSBjpO/jLsFJg4rs7gg5fg1pIWz7KQQr9SfwIEOw8QXAx1uRIYe3yaaTABsCcyu8zM6x4/Sn0oVqhPPmNXSdO8HPYM8lE1chcIwvM09YOBy5qOxzC++N0cm8VXiB136saJho1tKg69QobB4m5zIJE/uQ19SAAetY5bbPV7Uv7qx7se9W5HUrZt3MZZI0erBvdSrmIXjzkJG9Ye5vKE4oxZPgWZsPQXJjQbLZOOhCwsigtuHFkVp1keQMbE7d3CnQtvvdJcnJNFKu+SXfevWQJYsmioTmo83B/TADmkwXm2NQNVskl+KxWpCo/7hbgQ0QqBBFz7j0IpzWt3SQwtCL+V0byqgQG5mYGgAwyIBpRPa5R2JiJTHYt/0jQKZlw5QoKz7JkX4mnF7eEoeq0EanmC458bUXkYH/NEkIDx4mA== X-Forefront-Antispam-Report-Untrusted: CIP:172.205.89.229; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(23010399003)(1800799024)(36860700016)(82310400026)(56012099006)(11063799006)(10067099003)(18002099003)(22082099003); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: B6xybj9ZKKCiaXycUugMTJNVoE1oI/qVP8EeKsSDA9/guJqHbR+kBexMlr+FA2K/Gn1BsvbYS729ISwFAcMxMPvaYjtDLj+nDTIZcBiddh9UR6Jft3cdfJ0sEF7Glp+3gxMerCSb0P4MJL++KsDHAiRNTihEtxNp0r8p5ESLnRXvHCwjGQq/HXKoLgnuYFDommDOSKuMs+txxDIfwB4vhEJPU/XTXi6m1WrJtT8Nk7t36WPlykftjUkbLNJc8+zi3YCApVoVaude+TsECDVibXlHi+69RFdU8VFU2B1/WfA9sjZdJz9T60wMvdI79MExhwVOQ6U2WhvsNTDi9AXC8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6311 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF000509EB.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: f2e7656c-125f-48ef-1f91-08df18c1d5e6 X-Microsoft-Antispam: BCL:0; ARA:13230040|23010399003|376014|82310400026|14060799003|1800799024|36860700016|35042699022|56012099006|11063799006|22082099003|18002099003|10067099003; X-Microsoft-Antispam-Message-Info: Tc8fm/w3U0ahFQ4cYlR+j+o7ZwZ5CHPxS0ZB5SYeG8uKZegU6pMhYPE5sWuprd2RqXjlNmR7+0op/kV3FF16M3BM3Kx7Y1s+XBLah/8niIT20sp/nEgsYBrBRxPuAvIUXOEd+xrF3EyWN+Zfbhxt6kyetA/PblmRMBFplpQZs8HuP2iDBvbTdei19QEtXMIGbPp1z3v4a1PhT/NVkvvLfrfDSB5fJskg7r/5pYfNWLrzeuqXRPPhNaOGKMgwDxhxwjMcws4DgPk95hVSWSQAONJ2Ydw4xWsPyphqldX7ObkVNMDGZrbJJmO3QsvfRnhghO5XigLM08Etqt4taOp36oFSRSyhPLrPh0Lst1D2W42HaVtjUb1oLYqR+DBXMI/POizn9ReVJmStekEi3Miy/9qEBOAgwr8reU9PU8H/X67ZFC0ike+WT2LL+XNoHNdc2pqTt7GpEBeGuXCyuD9RHhnliNxDoPbZF82+dWc1c/4a5O9IAcho9rO1AuvVYECTGSVIQ9+QI0+1EP0nzDOu30WVYqjVZhGL4QY96HfGQso8mm3wlAi3JwJEH4hKwghcf34EIPYjb035mldWfXJDioeUp/NoWiXAdXT4xot0XjZlsTdDDEQe7N8ysXCa9Vs/zrpR0If/YeEvzt0wGhaZ/gxaK6BCbg7f23yXXaHJZa4aH/3RBa0d/WO4vhJS4NVIP/pK6TERhq8Gw0ccAhGSYg== X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(23010399003)(376014)(82310400026)(14060799003)(1800799024)(36860700016)(35042699022)(56012099006)(11063799006)(22082099003)(18002099003)(10067099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ygH44219dDoCXfuvGpvkgXrXC6FaR4iEc5S73t/u1bYbEe9ZnEwgdbRbeuhY/wwMybSYBCdiG9OJ7tB3Kyk66xseeCME4UB2oSX/fNfQkfohpFfpFWnC4Fh3STOTV6LbuGqo4ivsO0ULOok9nx+QGWoezK9kpres698gwuEDcgO9deO1NOSHjy/1J9eCFB9gMfS6pU6WWFg4v/WLODA9BavJyRjz6RTulorDRnka8JXXUMj2KDU0+H0cdtf/E0D3frVbwqrRi4LJ1iHNDw93vGq6wtwDdclQ9opaF6N+0qVL70ArT0dp1gvEHL7ebSbmxA1EjQe27GX0BW/2NfEB8htj6GwNAZfxEQyAI/KTz8jZ6P969KMJ8NW1kX1QoSij4D6cSBa2A2vhrBzmQI6ZSTASNIAn+Xzeuw4WB4+Cqslbd3P8Kko2BvYcFATAXTVw X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2026 15:55:52.1269 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02337fb8-c637-4391-a68a-08df18c1fa93 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509EB.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6209 X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://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: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
[v2] elf: Fix tunable comma iterator
|
|
Checks
| Context | Check | Description |
|---|---|---|
| redhat-pt-bot/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
| linaro-tcwg-bot/tcwg_glibc_build--master-arm | success | Build passed |
| redhat-pt-bot/TryBot-32bit | success | Build for i686 |
| linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 | success | Build passed |
| linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 | success | Test passed |
| linaro-tcwg-bot/tcwg_glibc_check--master-arm | success | Test passed |
Commit Message
Daniel Fellows
Sept. 22, 2026, 3:54 p.m. UTC
Empty comma-separated entries leave disable uninitialized. Initialize it to false and only set it for entries beginning with a minus sign. Check the input length before accessing the string, and only advance past a comma. This avoids reading beyond the supplied string length. --- Changes in v2: - Check the supplied length before reading from the string. - Stop at the end of the string and only advance past commas. - Add a comment explaining why decrementing the entry length is safe. sysdeps/generic/dl-tunables-parse.h | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-)
Comments
On 22/09/26 12:54, Daniel Fellows wrote: > Empty comma-separated entries leave disable uninitialized. Initialize > it to false and only set it for entries beginning with a minus sign. > > Check the input length before accessing the string, and only advance > past a comma. This avoids reading beyond the supplied string length. The patch looks ok, but I think it would be good to add a tests-internal regression since we only test this indirectly. Something like: -- #include <dl-tunables.h> #include <dl-tunables-parse.h> #include <array_length.h> #include <stdbool.h> #include <stdio.h> #include <string.h> #include <support/check.h> #include <support/next_to_fault.h> struct token { const char *str; bool disable; }; struct test_case { /* The suboptions string. It is copied to a guarded buffer without the null terminator, so the iterator must honor the supplied length instead of G relying on the terminator. */ const char *input; /* The expected suboptions. */ const struct token *tokens; size_t ntokens; }; #define TOKENS(...) \ (const struct token[]) { __VA_ARGS__ }, \ array_length (((const struct token[]) { __VA_ARGS__ })) static const struct test_case tests[] = { { "", NULL, 0 }, { "abc", TOKENS ({ "abc", false }) }, { "a,b", TOKENS ({ "a", false }, { "b", false }) }, { "a,-b,c", TOKENS ({ "a", false }, { "b", true }, { "c", false }) }, { "-", TOKENS ({ "", true }) }, { "--a", TOKENS ({ "-a", true }) }, { "-a,-", TOKENS ({ "a", true }, { "", true }) }, /* Empty suboptions are returned as empty strings, not disabled. */ { ",", TOKENS ({ "", false }) }, { ",,", TOKENS ({ "", false }, { "", false }) }, { ",a", TOKENS ({ "", false }, { "a", false }) }, { "a,", TOKENS ({ "a", false }) }, { "a,,b", TOKENS ({ "a", false }, { "", false }, { "b", false }) }, { "-avx2,,-,avx512f,", TOKENS ({ "avx2", true }, { "", false }, { "", true }, { "avx512f", false }) }, }; static void check_tokens (const char *input, tunable_val_t *valp, const struct token *tokens, size_t ntokens) { struct tunable_str_comma_state_t state; tunable_str_comma_init (&state, valp); size_t i = 0; while (true) { /* Poison the result so an uninitialized field does not pass by accident. */ struct tunable_str_comma_t t; memset (&t, 0xff, sizeof (t)); if (!tunable_str_comma_next (&state, &t)) break; if (i >= ntokens) FAIL_EXIT1 ("\"%s\": unexpected suboption %zu \"%.*s\"", input, i, (int) t.len, t.str); printf ("info: \"%s\": suboption %zu \"%.*s\" (disable=%d)\n", input, i, (int) t.len, t.str, (int) t.disable); TEST_COMPARE_BLOB (t.str, t.len, tokens[i].str, strlen (tokens[i].str)); TEST_COMPARE (t.disable, tokens[i].disable); i++; } TEST_COMPARE (i, ntokens); } static void check_guarded (const char *input, const struct token *tokens, size_t ntokens) { size_t len = strlen (input); struct support_next_to_fault ntf = support_next_to_fault_allocate (len); memcpy (ntf.buffer, input, len); tunable_val_t val = { .strval = { ntf.buffer, len } }; check_tokens (input, &val, tokens, ntokens); support_next_to_fault_free (&ntf); } static void check_length (const char *input, size_t len, const struct token *tokens, size_t ntokens) { tunable_val_t val = { .strval = { input, len } }; check_tokens (input, &val, tokens, ntokens); } static int do_test (void) { for (size_t i = 0; i < array_length (tests); i++) check_guarded (tests[i].input, tests[i].tokens, tests[i].ntokens); /* The suboptions after the supplied length are not visible. */ check_length ("abcdef,gh", 4, TOKENS ({ "abcd", false })); check_length ("abc,def", 3, TOKENS ({ "abc", false })); check_length ("abc,def", 4, TOKENS ({ "abc", false })); check_length ("-abc,def", 4, TOKENS ({ "abc", true })); /* The null terminator stops the iteration before the supplied length. */ check_length ("a,b", 10, TOKENS ({ "a", false }, { "b", false })); check_length ("a,", 10, TOKENS ({ "a", false })); check_length (",", 10, TOKENS ({ "", false })); return 0; } #include <support/test-driver.c> > --- > Changes in v2: > - Check the supplied length before reading from the string. > - Stop at the end of the string and only advance past commas. > - Add a comment explaining why decrementing the entry length is safe. > > sysdeps/generic/dl-tunables-parse.h | 29 +++++++++++++++++------------ > 1 file changed, 17 insertions(+), 12 deletions(-) > > diff --git a/sysdeps/generic/dl-tunables-parse.h b/sysdeps/generic/dl-tunables-parse.h > index 8ac49bff0b..f69f6d9a3d 100644 > --- a/sysdeps/generic/dl-tunables-parse.h > +++ b/sysdeps/generic/dl-tunables-parse.h > @@ -93,29 +93,34 @@ static inline bool > tunable_str_comma_next (struct tunable_str_comma_state_t *state, > struct tunable_str_comma_t *str) > { > - if (*state->p == '\0' || state->plen >= state->maxplen) > + if (state->plen >= state->maxplen || *state->p == '\0') > return false; > > const char *c; > - for (c = state->p; *c != ','; c++, state->plen++) > - if (*c == '\0' || state->plen == state->maxplen) > + for (c = state->p; state->plen < state->maxplen; > + c++, state->plen++) > + if (*c == '\0' || *c == ',') > break; > > str->str = state->p; > str->len = c - state->p; > + str->disable = false; > > - if (str->len > 0) > + /* For an empty suboption, *str->str is ',' or '\0', so a leading > + '-' implies str->len > 0. */ > + if (*str->str == '-') > { > - str->disable = *str->str == '-'; > - if (str->disable) > - { > - str->str = str->str + 1; > - str->len = str->len - 1; > - } > + str->disable = true; > + str->str = str->str + 1; > + str->len = str->len - 1; > } > > - state->p = c + 1; > - state->plen++; > + state->p = c; > + if (state->plen < state->maxplen && *c == ',') > + { > + state->p++; > + state->plen++; > + } > > return true; > }
diff --git a/sysdeps/generic/dl-tunables-parse.h b/sysdeps/generic/dl-tunables-parse.h index 8ac49bff0b..f69f6d9a3d 100644 --- a/sysdeps/generic/dl-tunables-parse.h +++ b/sysdeps/generic/dl-tunables-parse.h @@ -93,29 +93,34 @@ static inline bool tunable_str_comma_next (struct tunable_str_comma_state_t *state, struct tunable_str_comma_t *str) { - if (*state->p == '\0' || state->plen >= state->maxplen) + if (state->plen >= state->maxplen || *state->p == '\0') return false; const char *c; - for (c = state->p; *c != ','; c++, state->plen++) - if (*c == '\0' || state->plen == state->maxplen) + for (c = state->p; state->plen < state->maxplen; + c++, state->plen++) + if (*c == '\0' || *c == ',') break; str->str = state->p; str->len = c - state->p; + str->disable = false; - if (str->len > 0) + /* For an empty suboption, *str->str is ',' or '\0', so a leading + '-' implies str->len > 0. */ + if (*str->str == '-') { - str->disable = *str->str == '-'; - if (str->disable) - { - str->str = str->str + 1; - str->len = str->len - 1; - } + str->disable = true; + str->str = str->str + 1; + str->len = str->len - 1; } - state->p = c + 1; - state->plen++; + state->p = c; + if (state->plen < state->maxplen && *c == ',') + { + state->p++; + state->plen++; + } return true; }