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 EB4243858C36 for ; Tue, 13 Feb 2024 11:35:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EB4243858C36 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 EB4243858C36 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=1707824111; cv=none; b=QKMRXuyXjdKEdTiULa6lHtV8wwWrzm3ioYugNNq2ieXmjeTvQOruPz+tNOUynJfI24ncDZsecHz7h1TcbzKjv2Znr/2ZobNHZQSC5+tQLlPsEKuFfdyBxxM/S3ehEXoWJbDuHlRiXCgR2GqxYekWBScsCQqq6rD0M5Hl/t9WgzM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707824111; c=relaxed/simple; bh=FwBUnfMaGLX7DYAsCOrE4wm/EqDxWVBtt7hIhe67rkQ=; h=DKIM-Signature:From:MIME-Version:Date:Message-ID:Subject:To; b=nctH5mnpSe7qHx185UBXC4kEqM+yMoq4OZFZe2M5Q7r5fMwss2iBO4mqhvzdqdI/E84JrB9nQ7VqAWrJYzrzIsHn6OjMxwfN2vNAxHv102GnA6VVJcpFpXTMQ1IvrnmTV6ypjpqC+HsQ1bKKuP8MDf4z96bwHwM/aV/NVy74qws= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (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 0EADE40F7C for ; Tue, 13 Feb 2024 11:35:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1707824107; bh=ZVdFcVG3wVWeW8U24ntLxLJ7MDSjylAocwtz25BxaAQ=; h=From:MIME-Version:In-Reply-To:References:Date:Message-ID:Subject: To:Cc:Content-Type; b=ipywhcCDBTkse70nzEncT99NwegLU9/3ijSzrfQEvkF7Dr5hNuwBlWgTcAe5YZqcC 1GJEWbdRe3KDJ5f1AKvtqG4myBIImBdjKHPqVL+s4/+dk8FrDuc3VLHguSjsCLC6Uj CnqYJFxyW2jj7a66PcTbScPOTddJaXc0CshTwdK4W47tiQcYZdSeClsy4FZ7bZvB85 ZxsZFcWtGv1Nv4VjXcZuyvSOKw2ynJSq10RTUIEfnQCz4cvW+A7q4kF0/4SkLjHszJ FKOBK8KRly2mAcsr2CQ0VRI4Sgl/7shQmLLDirgh5cb5LwaEZ5yUxiFJ+cBuLjebuz dOUqj+cabCloA== Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-5dc1548ac56so3441566a12.3 for ; Tue, 13 Feb 2024 03:35:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707824104; x=1708428904; 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=ZVdFcVG3wVWeW8U24ntLxLJ7MDSjylAocwtz25BxaAQ=; b=X+eCAUEqYn00iRgfi/e2pCFo5Vl2VM1WfgBXHnv6SBTg9l+ajZrrkUOjUZnx8R9RBg 2YQ7nuwk3hhInaukjvrcQigXMiyo50Y6qDVDfiwbg2uZcHx2qWUr/waim4lK5T3jBQAT iGgjgrLl9idItPBs7ok9fpTkI1W2dmsNbCdYuzXs5oY/UkFyRNlYJjqvIENGhFjuGtuq 2MI9k6XKJNbqkDx2MSQVJkPumKjFuZh9uYhvx0BTt/zI8YwgAADsvrf7SEpSj2R1zqPe 8nWd9/NcXhCUTkg/JCTqG3Bl1qAxGlm21Nkhaj2s6PPcUHX4wYvoWWGA4J+ZsHpwZ0c7 lfvw== X-Gm-Message-State: AOJu0YwPXNWWdAxvfqQp/rtik9IMeDIjU3ISfzJkqXybUXwFgAqYgv7x zArMsJ3lUE5F3kiOUpLE5uIKzhAnnuMmcFKnvaw4jt2JsWjfW3zXB8iL6wTj+p1QyRDl+yEU3ZP dZhkMhS8kLixHhpEfekIUVEds0D0X0cosbk5/TdDrIP6gS47oeg+fGWW75+VknEMKyeEQqUrbjH Pyz51KWEF5lWu/NZBPJQRzNiL1PRuntAJc77+FK9U2Hgd/L0vegty1LKse X-Received: by 2002:a05:6a21:3942:b0:19e:cce1:ed7e with SMTP id ac2-20020a056a21394200b0019ecce1ed7emr5761894pzc.62.1707824103931; Tue, 13 Feb 2024 03:35:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFQg1iCL0yt/ve1E74Jx4CpHRqDnOb5GQ1VZrWUgsRuKRbV/8nfDxkQhujRq/60qh9vSTg4qe6+aRk7rjE7LKs= X-Received: by 2002:a05:6a21:3942:b0:19e:cce1:ed7e with SMTP id ac2-20020a056a21394200b0019ecce1ed7emr5761882pzc.62.1707824103586; Tue, 13 Feb 2024 03:35:03 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 13 Feb 2024 03:35:03 -0800 From: Simon Chopin User-Agent: Dodo MIME-Version: 1.0 In-Reply-To: <87mssir1u6.fsf@oldenburg.str.redhat.com> References: <87mssir1u6.fsf@oldenburg.str.redhat.com> Date: Tue, 13 Feb 2024 03:35:03 -0800 Message-ID: Subject: RE: [PATCH] Linux: Switch back to assembly syscall wrapper for prctl (bug 29770) To: Florian Weimer Cc: libc-alpha@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,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 ven. 02 f=C3=A9vr. 2024 22:30:25, Florian Weimer wrote: > Commit ff026950e280bc3e9487b41b460fb31bc5b57721 ("Add a C wrapper for > prctl [BZ #25896]") replaced the assembler wrapper with a C function. > However, the C variadic function implementation has a different ABI > on powerpc64le-linux-gnu. Switch back to the assembler implementation > on most targets and only keep 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. Codewise it all looks good to me, but I have a perhaps dumb question: at this point, aren't we breaking ABI again? Presumably, binaries have been compiled against the varargs ABI, which AFAICT has been shipped in RHEL 9 and Ubuntu 22.04 among others, which have been out for a while now. > > Notes: > > This is just a repost of my previous patch. I still think it is the > right thing to do. We now have a second case where the varargs > implementation causes stack corruption on powerpc64le-linux-gnu. This > time it's the libasan interceptor for prctl: > > libasan uses incorrect prctl prototype > > > Thanks, > Florian > > --- > 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(-) > > 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: 7c8df0b9441e34928f2d7d70531e3d55e016c32e >