From patchwork Tue Sep 24 10:44:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1988867 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=F80fpqYt; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XCc296gZXz1xsn for ; Tue, 24 Sep 2024 20:45:05 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8EE3A385828B for ; Tue, 24 Sep 2024 10:45:03 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 12EDE3858D26 for ; Tue, 24 Sep 2024 10:44:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 12EDE3858D26 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 12EDE3858D26 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=1727174688; cv=none; b=sZDeLeTy+WJq22+JjQDTL+jjw3+oCmOE18OpM6AXlYAF8RawCGpwcZrsDV0jm8QoPl3r3mKySR4lPXGaoLo8oCySE92iuCN3oBxF7ewSpaM/8uQ2KTICd9JmsK0fl8kWy4Sc4spGr7vp0ILeYwQxELsYzWNhM8HjMX+vd6v4fuw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727174688; c=relaxed/simple; bh=WyHkaKchHw/CqL5LcUIlO+0A6BGBLnoPry0oHzc+gmc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=uhr1onPcmFqRHya7xZ89KUh1t4rn4yAeXYgnwOnPb+fPWnh6da3xtuqiiA1BPvbfMYYF78LAYCAUnwS52yHDVilKI5JzN/UoEQs9CKd7jrLY9smE/mrl/rUilDouJRlYu8JtZyGiYk0gpCXcED7D/oMbqy+B6ftXWKq8KoQoS08= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727174686; 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; bh=uqLqOrQwprngooWhHM0BCPLOHFMVtuA8EJ5Ae+kvcgU=; b=F80fpqYtDv4NiwnygVhFTM0xEVrMyek2qmROc4HhULbrHxqINA25gYhG6KkUVNfHhI3OU3 6KcLVqAY58QJ1OajBFVPGEtguQHEc2oqf/mBoCsNgLWNUT0dtBt3ZITqHH7d0cvKzyKKtk N7lCLswNTWiMSa2KSm1n67EUOQjKDow= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-523-Gd0qpFXTOqqw__7Kroc05w-1; Tue, 24 Sep 2024 06:44:43 -0400 X-MC-Unique: Gd0qpFXTOqqw__7Kroc05w-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.40]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8E0731903056; Tue, 24 Sep 2024 10:44:42 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.225.92]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4751519560AA; Tue, 24 Sep 2024 10:44:41 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Andreas Schwab Subject: [PATCH v2] nptl: Prefer setresuid32 in tst-setuid2 Date: Tue, 24 Sep 2024 12:44:38 +0200 Message-ID: <87cyktfi09.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org Use the setresuid32 system call if it is available, prefering it over setresuid. If both system calls exist, setresuid is the 16-bit variant. This fixes a build failure on sparcv9-linux-gnu. --- nptl/tst-setuid2.c | 5 +++++ 1 file changed, 5 insertions(+) base-commit: 079ebf7624e7fd0ad7fe94a7176a2e132c996d86 diff --git a/nptl/tst-setuid2.c b/nptl/tst-setuid2.c index 33d4e39fff..c410423010 100644 --- a/nptl/tst-setuid2.c +++ b/nptl/tst-setuid2.c @@ -76,7 +76,12 @@ run_on_thread (void (*func) (void)) static void change_thread_ids (void) { +#ifdef __NR_setresuid32 + /* Prefer 32-bit setresuid32 over 16-bit setresuid. */ + long ret = syscall (__NR_setresuid32, 2001, 2002, 2003); +#else long ret = syscall (__NR_setresuid, 2001, 2002, 2003); +#endif if (ret != 0) FAIL ("setresuid (2001, 2002, 2003): %ld", ret); }