From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id CE5853858C2C for ; Tue, 13 Feb 2024 12:24:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CE5853858C2C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CE5853858C2C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707827088; cv=none; b=GZ+qk6c7NjGXsWBVRJTk2tXP+l+Z1RhWS1YWqK/euGrbF7wiLmLhk7fFphz0vyXop3IVVsKgYmZbbaMiaZyZ0tOwnUql3PHd1/PaKysjV4x5O5EETkCWT49DPsS82VTYl5y1s4h8ZTRAu+MlYoVhq95sqE+tIj4GJW9P42FI+dw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707827088; c=relaxed/simple; bh=0/ZkZKB1DW2wNKeF5/m2BYsXNKymWelSNz3bMGxKOcg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=tpxRxeZzDe0thHygztL17ZbXiWhQmAhzKtZ9fqTDShh3dJ4pUaIkNUyJoDkzgX8W9BD2dzQHMyDUBoDCubD58NOHLZDwN/RySGuOPesqAmSVT4Sy+VvbsmU/WazoMen3GyqJPxzRz+0UjtN8o2H6gmK8dn9Cc4KGtlibi57gzOw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707827086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9HTKwNFyalzp0UJkj2wofDhQJMdo+10SbtpMyC6yDzk=; b=fSZ4Bj0hU45LEZs5HMYMnYXBNRRah//QxKCmUXRii5IG5uj5e48LfgJzCZFV+TZ0tgVJb2 JPCO5aeNzJ8fsRRWn81Tj1yCnz8tSzJ2kC+yYnIpltJj1DOzbb4OF2J6Ckm+uFmOFGnbHZ aR6p3LAM4rLzBRcpvmtiFvu887ge8mk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-683-zzamiOo_P_yGBgL1Y_GkIw-1; Tue, 13 Feb 2024 07:24:45 -0500 X-MC-Unique: zzamiOo_P_yGBgL1Y_GkIw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 112A38C46C2; Tue, 13 Feb 2024 12:24:45 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.193]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1E996112132A; Tue, 13 Feb 2024 12:24:43 +0000 (UTC) From: Florian Weimer To: Andreas Schwab Cc: Simon Chopin , libc-alpha@sourceware.org Subject: Re: [PATCH] Linux: Switch back to assembly syscall wrapper for prctl (bug 29770) References: <87mssir1u6.fsf@oldenburg.str.redhat.com> <87jzn8inp6.fsf@oldenburg.str.redhat.com> Date: Tue, 13 Feb 2024 13:24:42 +0100 In-Reply-To: (Andreas Schwab's message of "Tue, 13 Feb 2024 13:12:48 +0100") Message-ID: <87a5o4imb9.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: * Andreas Schwab: > On Feb 13 2024, Florian Weimer wrote: > >> =E2=80=9C >> 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. Switch back to the assembler >> implementation on most targets and only keep the C implementation for >> x86-64 x32. >> =E2=80=9D > > That does not explain why the compiler did not set up the parameter save > area even though the declaration in is varadic. Do I > understand correctly that some software uses a private declaration that > is prototyped but non-variadic? Yes, GCC and LLVM upstream contain an unprototyped prctl function declaration somewhere: libasan uses incorrect prctl prototype=20 This is not the only piece of software with this problem. It's easier to fix this in glibc than to figure out how to change the libasan sanitizer to change the prototype there, so that's why I prefer this approach. Thanks, Florian