From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70049.outbound.protection.outlook.com [40.107.7.49]) by sourceware.org (Postfix) with ESMTPS id 16298384F02F for ; Fri, 11 Nov 2022 13:27:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 16298384F02F 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-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=QdrGoAnDVmqGKXMNLGDChOqbSNv77UO6Tl6FNF/iS6TFUIttFKhZ4kzF9JUBHRx59732gEdty/QkTW2GUDahObNt4vojOTYQhDu8/2EZlR9v9MGqKaRqJeBaihiLwZlcU3oB3nOcdEX8JESP2hSR7G3czEUVruMSmXYbOIkuIIa3m54n7t7P+aJDc9MQzoRYA5nZ7wL0PetFIpgaT1/Rfx/Gj0WZtTeBohmQ7/aRCVUCDHTbpfg6qSkjhbTrx3yEzBP6503+sBXJ8cNw7zVNpfLwL127tGZqGo1lm431oI5Ay6uEIZeEbH6Y3vTNnxH3Mm1Cq9BS20kvWn72yYcOig== 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=3DivI6f8qeRuck3XGBv75v/P/qKnP0k7YV+8iYCt/b4=; b=OtdiM1vp8XlgygNHS3nhSBQLmBjDJAp4kKtuZu6Xuu54alIEEoDmlloTTUC1GtIe6gL1kOZ7+ME+cqDnyZzq01nZQQj6Z3f6njNVFRNJQ1TzeRMDG7hIvvNVD1MLHZhopgNufSrOqv4Ttc3oUclXvboX4XSi0p13tzugvih5lXJ8EWlMBJolV0L3vBGh4ByXmMJ/EgKemVl02m9SDFPhesQqvcYGtLV/Cd4ORCZaF5kZ3yYTQbauvX+8elfrkB3qwhrJmnQCk6KWxJCK3wcavCeRJOZ9JrFY1sJCpw77CxodBa/xGkdcN3TKnd9usfrhuDasWqYVbx6eNOm+5/LYiA== 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=3DivI6f8qeRuck3XGBv75v/P/qKnP0k7YV+8iYCt/b4=; b=jXv671awszJxcehzATFvhxhZsfk/zIj5Sqo52WuHpIqaiZ7HnyzPtDVOqNZsck1Vq9UUie/8hFIGawZdgx0amGAmo+KKYtR+yqQzYeR5RKXdvEb6KOEolBgW8WQbztUYseke+T4tx7Vxgc01V1vsDRFAfarW8px+Q1GTvkpBYdw= Received: from AM6P195CA0024.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:81::37) by AS2PR08MB8646.eurprd08.prod.outlook.com (2603:10a6:20b:55d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13; Fri, 11 Nov 2022 13:27:30 +0000 Received: from AM7EUR03FT061.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:81:cafe::28) by AM6P195CA0024.outlook.office365.com (2603:10a6:209:81::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.14 via Frontend Transport; Fri, 11 Nov 2022 13:27:30 +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 AM7EUR03FT061.mail.protection.outlook.com (100.127.140.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.12 via Frontend Transport; Fri, 11 Nov 2022 13:27:30 +0000 Received: ("Tessian outbound b4aebcc5bc64:v130"); Fri, 11 Nov 2022 13:27:30 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b70ebbe5aab69e49 X-CR-MTA-TID: 64aa7808 Received: from d608773133e6.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 50A2234A-82FA-4F8D-965F-E35B714BE18C.1; Fri, 11 Nov 2022 13:27:22 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d608773133e6.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 11 Nov 2022 13:27:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j7K+QEe5CgF/pjTydPpowjICBpDSEJqhkDpN0ZL2iZHmKkqItZSfdMdDc+evmwWX0d5TQX6gupe5H1KatdXTWMXXSRIBrhGysRHwvcvwnnfPQ13O5Z7SVMZNPSwADNqLEy0eYTirt+yVwEfuHtXzBDwz67A1aXBlZU0CC9Wh3dVSQrrbzol6aR2px4gfCe1O6JErSgwpfz7Qx4bQ9Zshv9FloO8L2pr9f9ao5FIwbyC912BFVlYq7HEDVgxITT6/kGdeIDjRI560wcwfplysrb89uM7qS1rUeao0c4KRGtcaMifzNCofIEnwD3U/MaBSDemGfg9DKSniXxzvsP5C0A== 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=3DivI6f8qeRuck3XGBv75v/P/qKnP0k7YV+8iYCt/b4=; b=MtX0W8WkLw/TZ7zk1qeRFEX0pSEgyXngkBj0v/I2v5sJ3UoP5YSHmQCti1q1EUkeX7P60s15fm1G8BHlJ8PPmBAdvKKGi60XjIj8R5c/wkZGNIgmiaxHf5Uii4NfMjjUcjUERzgWPMx8AYfJplW7rjDGevH0Hmj/J6eFSstNq9sIiMfVdpSKM4ap0FfwuJk8v3NrAqCyZzy/LwFDQcb4O+azTD8ng4mK4Uv2G2mZq0P05rJ9S5q9w7sj3w5Ll6l8lG6WZy5n4Q2Z5lYXAJDq6IdlT0VeeI2kndRorF6jYnfj/ROJeOA6dUPaNFv/9kDezvIFObttV7c5pYjQQeOYHA== 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=3DivI6f8qeRuck3XGBv75v/P/qKnP0k7YV+8iYCt/b4=; b=jXv671awszJxcehzATFvhxhZsfk/zIj5Sqo52WuHpIqaiZ7HnyzPtDVOqNZsck1Vq9UUie/8hFIGawZdgx0amGAmo+KKYtR+yqQzYeR5RKXdvEb6KOEolBgW8WQbztUYseke+T4tx7Vxgc01V1vsDRFAfarW8px+Q1GTvkpBYdw= 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 PA4PR08MB5886.eurprd08.prod.outlook.com (2603:10a6:102:e2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.12; Fri, 11 Nov 2022 13:27:21 +0000 Received: from DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::81ce:94a0:632d:7016]) by DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::81ce:94a0:632d:7016%3]) with mapi id 15.20.5813.013; Fri, 11 Nov 2022 13:27:21 +0000 Date: Fri, 11 Nov 2022 13:27:07 +0000 From: Szabolcs Nagy To: Florian Weimer Cc: "H.J. Lu" , libc-alpha@sourceware.org Subject: Re: [PATCH] Linux: Support non-variadic calls to prctl (bug 29770) Message-ID: References: <878rkiu72f.fsf@oldenburg.str.redhat.com> <87cz9usjn3.fsf@oldenburg.str.redhat.com> <878rkishbo.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <878rkishbo.fsf@oldenburg.str.redhat.com> X-ClientProxiedBy: LO2P265CA0003.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::15) To DB9PR08MB7179.eurprd08.prod.outlook.com (2603:10a6:10:2cc::19) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR08MB7179:EE_|PA4PR08MB5886:EE_|AM7EUR03FT061:EE_|AS2PR08MB8646:EE_ X-MS-Office365-Filtering-Correlation-Id: d83440f5-32d2-461b-072c-08dac3e87bd9 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: wM5m1wGbGKaTjhQ232syomRB9WO/GOEAOyZ+Z87BxpR6jsfWeu6ORBhBxWimwNEiYJY//Y5bj6jBViR7VmUWhbYlzxOpchpeoj2lw3oQNDWg40Ytg4+YpwIMciACkM0VBxK6QETGha0uSr9v3YzxA1gCMDDtUc2UA8ZnHt/F2DGe9JiZcqVU+cCHLv+7V7DaJwmnrqFAJ2oSImmkM+ewNV3PLwvNLGtN/HxcMMzRy7w/SprRMfhVB23Z3JctavoE2Nd4QCI6QBAHUXWMw9GiqSnTEu/L3wShtaLOcXPsRc9TjC5zbipWmyFduggNhCpz1JxJDj2aUq9Nhrp46K8sp++fvQxqcmt7D76Kl/cUssRcDSU+Qizxrp9k6mYU4CtvR1ru6hC7ImIHV/KJPqT4MQ0mDxMX/nYEXXAMjWqsyo7eoEqMiF/pq8ir+YT/Wd8Eijl0KuB7Tj1w3euLUmh547qBH+vX1g2mgLOIWZrB41Imvv6Mti4xSVoIEH9YEEPk0LyzYU+YWDLXGbXR3yH3QW35iynzjcN3CPJ1K/0OR3mDzi7UyC9ue+y1upZ5uqQUHZjDe7xBaLfnUHnoUFJjXc7X6D+95kHAHAuDA7JZsSa82Uw1n/PUiZCNWaEm2SlQUpNzK9n8wORRK9tjSS19L6ujPVxBM9RsAyjcPsBJChsneD21dJuAfaoaGA0s0XTnNnwWpN0O2hpP5tfYSXcyt9qSrrdVOLzBI3wDk5Gp+TfQ2F82hEgFNHMWEyNZA8hM 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:(13230022)(4636009)(39860400002)(396003)(346002)(376002)(366004)(136003)(451199015)(38100700002)(36756003)(316002)(6916009)(6666004)(86362001)(6486002)(66946007)(66556008)(4326008)(2616005)(66476007)(186003)(2906002)(8676002)(478600001)(44832011)(26005)(5660300002)(6512007)(6506007)(41300700001)(8936002)(53546011)(67856001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5886 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: AM7EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 54910960-550e-4c85-9109-08dac3e87651 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BKdW22NY8wKvrpKxVtG3rbVOLxrFWyWqRvIVfIG2l0DZ8IBwxBE3mINtXHl1xmI7Ji0LKGox9cE+waCYO+PpAS9hjAuJaNLXRk2Lf4slqeD1wjrz0VgMbp0ifMbQJR+gNEcOLwAAnidDgMNIMB5hptFtRIvMMv7zc5Tjwwoxdh9xc/IkILCF1Z6QsTvrY872htQ+fpTGJTJL9kXDGNqEajDaiULqF+jQuVhtwieUH/HF311jW8qCyHNRSU0rZp5uTZBG+cue0oCUCuip05UVJqODHKxr7CRj8MII1rn7DRRYk0s4K//XMlwd3grtyU96s6sjGkPXniB2D0BDLAS3cu9OawoUk+I4/Yjz/KPBnWzcMMPGmbxoyhzThQp0eo5YRWdqRck7Z4sTSemzIJbVhCzUbLupwowojoZPiB+4E3N7xlv7vz6+MfzHjkdoZ9L25JmGLh6a0E7c7CgFSVUUVXvS8yXg+bMlBxF+iHZNUNVYd8ABbvhSQaT8IlexUaKCrX7xupB8DZ9X3/d3h5N+loVUM1V3hhY6WgJJ47Aluvi+DlcMjp50+X1wS2vIpJEx7YQ4AJssaBeG3FYc9AccbMtsW/uCX8xcKp0hdy1kswXiU2ILXc6Umw/JIKK/ntZ0KGN2nj8V5+pZZjFsiLBypjCFvxMPWljzG45zZmBszGAA91XKMo+/7Vxn1y1fyT368l7HEcAh3Z/WINt6bMvtCrYIUue98DV9AbvRg2dm6So6TYnQWJYWbKlFxWLFL8TfuLf95wEMlfYChQOw1pQbYPF+O5ioPp44+RF7g94oQFA= 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:(13230022)(4636009)(396003)(376002)(136003)(346002)(39860400002)(451199015)(40470700004)(36840700001)(46966006)(36756003)(86362001)(81166007)(44832011)(356005)(82740400003)(47076005)(36860700001)(4326008)(40480700001)(6486002)(2616005)(316002)(40460700003)(186003)(6666004)(70586007)(70206006)(478600001)(336012)(6512007)(82310400005)(2906002)(8936002)(5660300002)(8676002)(6862004)(41300700001)(6506007)(53546011)(26005)(67856001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2022 13:27:30.3371 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d83440f5-32d2-461b-072c-08dac3e87bd9 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: AM7EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8646 X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,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 11/10/2022 21:08, Florian Weimer via Libc-alpha wrote: > * H. J. Lu: > > > On Thu, Nov 10, 2022 at 11:18 AM Florian Weimer wrote: > >> > >> * H. J. Lu: > >> > >> > prctl is an exported variadic function. Do we need to keep it? > >> > >> Do you mean whether we should keep it as a variadic function or turn it > >> into a function with a fixed argument list? > > > > Yes. > > > >> Unfortunately the types and number of arguments vary between the > >> sub-operations. Pretty much any application calling prctl would have to > >> be changed. It's just syscall by another name (and with a fixed number > >> of course). > >> > > > > has > > > > extern int prctl (int __option, ...) __THROW; > > > > Your change works for > > > > int prctl(int option, unsigned long arg2, unsigned long arg3, > > unsigned long arg4, unsigned long arg5); > > > > prtcl (...); > > > > But it breaks > > > > #include > > > > prctl (...); > > I don't think that's true for our current ABIs. They support > unprototyped calls, and by extension this also means that calls through > a variadic prototype to a prototyped non-variadic function must work as > well. There are other ABIs which do not work this way, but glibc hasn't > been ported to them (and it's unclear how useful they would be for > GNU/Linux). this is not true in general. unprototyped call to variadic functions is not valid in c. so unprototyped call abi does not have to match both the variadic and non-variadic call abi. (only non-variadic calls with arg types that promote to themselves need to work.) e.g. on arm variadic functions always take float args following the soft float abi, but an unprototyped call with double args uses the hard float abi on armhf (int vs float regs). i guess the prctl case works on existing abis now, but i think future abis might want different variadic call abi (morello is an example, though that's an experimental target). prctl is nasty because the arguments are often passed with the wrong type (e.g. int arguments instead of unsigned long) and with variadic prototype this can pass wrong value (e.g. non-zero top bits on 64bit targets) down to the kernel. unfortunately whatever glibc does internally won't solve this issue: the public API would need to change. > > The new C implementation is equivalent to the previous assembler > implementation.