From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by sourceware.org (Postfix) with ESMTPS id D2FDA38582A7 for ; Fri, 16 Feb 2024 10:00:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D2FDA38582A7 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=canonical.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D2FDA38582A7 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=185.125.188.122 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708077607; cv=none; b=BREc89Fwdjl6MIj/2y3bS0+HJhi/kL91E6BQ+aURAkmgK9g9asFePj820GHLKnsThFolkJx2oyfWhsusuQriyn6DuSS7V/NUywbfaEQr7PdQ4rjHWK2RuPs+LzVSgp9GyAVOe5Bxk2XIBTyxPMwi4FlTHDv9MS/CkSQ4ad3xOcM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708077607; c=relaxed/simple; bh=K82m9wJMUD6BdasmaDDgaWsh0/RcUrnVlPSC8JCfWRk=; h=DKIM-Signature:From:MIME-Version:Date:Message-ID:Subject:To; b=iHLyhpawln0zK4Z0/3k0YvThdMtemYC24r69fnxNl3ozA81yHdZharuwfEW1J5dvmbN9X0pwVzAchmc3PmHnMwTQwev6Gm31p0MrtSAO7oLobkrmBzQ6H+6OTKsSys2pnvDLYx9Zxo3VCwZyAkVPKdnMZEMJB7SwqEAX/Uy0BA4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 825F740FB5 for ; Fri, 16 Feb 2024 10:00:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1708077601; bh=p8+6ZjBD0BHI0Wlyc3TDiwVkpYoH3NSGRPQXhj49xSk=; h=From:MIME-Version:In-Reply-To:References:Date:Message-ID:Subject: To:Cc:Content-Type; b=SCaD0cr2dHBK7pXJAS0b1Hwb3o+YoM23YKOWeFNBa9+lyVZ0kQ+QbIhaY+fHAlUen Q8CEI45A+KiLJ+2tBb90TLgpJWumzbGeOWSl/YfiIELckPMJqILZl/hch5/wBLpHgj jOV38w6ZPpmplw7IggBlLsH+C8TEnBr9iyvHLIpHgqeuQkGUuuEIXFhQdj9YZIbyvl XCDvnZY0h2NvfL4J25SK6376bhNXvMmltULQdB4ZqokwimPSgpytIkVEufqY8hw8oO xWf8pKoClnBEYFrLia9sVXnOl0edCsE77V6UXjeZ48KdyvAWGlNGOqiQr7J0t5OIr4 Q2NkZDWB/ui7g== Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-2966737d3e3so1676155a91.1 for ; Fri, 16 Feb 2024 02:00:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708077600; x=1708682400; h=content-transfer-encoding:cc:to:subject:message-id:date:references :in-reply-to:mime-version:user-agent:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=p8+6ZjBD0BHI0Wlyc3TDiwVkpYoH3NSGRPQXhj49xSk=; b=uWU+bb3cj4linGrNXARULGpU72bgjhEYWsy8rWSbpyYlBWZWNYhfEulg5oLJZBfiR5 A/sFN8bARenl9u1B3YoBfmqvKM/Fb3sb+MmGKgg+WfwH48fJLDI2JRaAd8Mt6Za92X4z B2MC3987kuXbXVlRYsBg+I5n84vNDkjRNCTEi5tV9ZOYatC52CV2NJ3i4dn5SUMYNtFL g+t+gIk2rMqccUn/2z6huBO15qoELB9h/qdL2/9XFLvfJHf/1/JwJm4XLgwF/4CouFay 4jUS+dKYde2hYTnwxMJD/t/4AMlzNwzgwVve899vCm7v717FBafvY+Y/O4BK3skuCaIP /PuA== X-Gm-Message-State: AOJu0YwQhI8n32nT6rbQ1lrs0CiEVQHoaBDW18RtagdYOG/PT2cfmt6b Wy/Cfa8dBz5tYe3Fp27AHjNDY27NXKova35Va8f56v4fUZcPTnvECHIe8+OX1yiiAGZ93COyoI+ uC9unftptOnvASpyp722y5u+3SfgTZp+DiBGaoFf6sDWJBwNpCO/u6M885IZFnbgh96Hm+P3ThU 1AP9i+YoHPxVdqLKupNgAWaMbRv8lo/3Sl1xSZ1nSieVbtRX1B X-Received: by 2002:a17:90a:1784:b0:299:3781:4871 with SMTP id q4-20020a17090a178400b0029937814871mr690457pja.37.1708077600139; Fri, 16 Feb 2024 02:00:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEEpGvceWKv3OViWOBPg4CBXyUpAsx0X9cny3+ViUuwNCRrvgXgoFvm6a6POUsosDLFo/FvjnoQq5x4MRUqLxY= X-Received: by 2002:a17:90a:1784:b0:299:3781:4871 with SMTP id q4-20020a17090a178400b0029937814871mr690448pja.37.1708077599834; Fri, 16 Feb 2024 01:59:59 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 16 Feb 2024 09:59:59 +0000 From: Simon Chopin User-Agent: Dodo MIME-Version: 1.0 In-Reply-To: <874jebdorl.fsf@oldenburg.str.redhat.com> References: <874jebdorl.fsf@oldenburg.str.redhat.com> Date: Fri, 16 Feb 2024 09:59:59 +0000 Message-ID: Subject: RE: [PATCH v3] Linux: Switch back to assembly syscall wrapper for prctl (bug 29770) To: Florian Weimer Cc: libc-alpha@sourceware.org, Rajalakshmi Srinivasaraghavan , Andreas Schwab , bergner@linux.ibm.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Florian, On mer. 14 f=C3=A9vr. 2024 16:55:10, Florian Weimer wrote: > Commit ff026950e280bc3e9487b41b460fb31bc5b57721 ("Add a C wrapper for > prctl [BZ #25896]") replaced the assembler wrapper with a C function. > However, on powerpc64le-linux-gnu, the C variadic function > implementation requires extra work in the caller to set up the > parameter save area. Calling a function that needs a parameter save > area without one (because the prototype used indicates the function is > not variadic) corrupts the caller's stack. The Linux manual pages > project documents prctl as a non-variadic function. This has resulted > in various projects over the years using non-variadic prototypes, > including the sanitizer libraries in LLVm and GCC (GCC PR 113728). > > This commit switches back to the assembler implementation on most > targets and only keeps the C implementation for x86-64 x32. > > Also add the __prctl_time64 alias from commit > b39ffab860cd743a82c91946619f1b8158b0b65e ("Linux: Add time64 alias for > prctl") to sysdeps/unix/sysv/linux/syscalls.list; it was not yet > present in commit ff026950e280bc3e9487b41b460fb31bc5b57721. > > This restores the old ABI on powerpc64le-linux-gnu, thus fixing > bug 29770. > > --- > v3: Commit message updated. > > sysdeps/unix/sysv/linux/syscalls.list | 1 + > sysdeps/unix/sysv/linux/{ =3D> x86_64/x32}/prctl.c | 5 +---- > 2 files changed, 2 insertions(+), 4 deletions(-) LGTM, the extra info in the commit logs are much appreciated :) Reviewed-By: Simon Chopin > > diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/li= nux/syscalls.list > index 73e941ef89..9ac42c3436 100644 > --- a/sysdeps/unix/sysv/linux/syscalls.list > +++ b/sysdeps/unix/sysv/linux/syscalls.list > @@ -46,6 +46,7 @@ open_tree EXTRA open_tree i:isU open_tree > pipe2 - pipe2 i:fi __pipe2 pipe2 > pidfd_open EXTRA pidfd_open i:iU pidfd_open > pidfd_getfd EXTRA pidfd_getfd i:iiU pidfd_getfd > +prctl EXTRA prctl i:iiiii __prctl prctl __prctl_time64 > pivot_root EXTRA pivot_root i:ss pivot_root > pidfd_send_signal EXTRA pidfd_send_signal i:iiPU pidfd_send_signal > process_madvise EXTRA process_madvise i:iPniU process_madvise > diff --git a/sysdeps/unix/sysv/linux/prctl.c b/sysdeps/unix/sysv/linux/x8= 6_64/x32/prctl.c > similarity index 93% > rename from sysdeps/unix/sysv/linux/prctl.c > rename to sysdeps/unix/sysv/linux/x86_64/x32/prctl.c > index 52d234ea0d..4bf1b479a0 100644 > --- a/sysdeps/unix/sysv/linux/prctl.c > +++ b/sysdeps/unix/sysv/linux/x86_64/x32/prctl.c > @@ -1,4 +1,4 @@ > -/* prctl - Linux specific syscall. > +/* prctl - Linux specific syscall. x86-64 x32 version. > Copyright (C) 2020-2024 Free Software Foundation, Inc. > This file is part of the GNU C Library. > > @@ -40,6 +40,3 @@ __prctl (int option, ...) > > libc_hidden_def (__prctl) > weak_alias (__prctl, prctl) > -#if __TIMESIZE !=3D 64 > -weak_alias (__prctl, __prctl_time64) > -#endif > > base-commit: 491e55beab7457ed310a4a47496f4a333c5d1032 >