From patchwork Tue Sep 24 09:05:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1988821 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=FXO23s6T; 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 4XCYqy5r7bz1xsN for ; Tue, 24 Sep 2024 19:06:06 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 041CD3858403 for ; Tue, 24 Sep 2024 09:06:04 +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.133.124]) by sourceware.org (Postfix) with ESMTP id 93DE13858D26 for ; Tue, 24 Sep 2024 09:05:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 93DE13858D26 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 93DE13858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727168747; cv=none; b=fXX/9+4EFUrtPmxpQznZoCGap/Fh48L83KKMqX9OfyJ6q5qfDgR+IdS+LuXko+UiDFszuO7kFk4nGjFKPWFla7Of60xPefg6S3KLfJAucz1mZyQMEn4kKE1CU5K3N1tMgkTOXqpfCSUigPxIgbEwBKkH7eT6bKftInifNK1phqk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727168747; c=relaxed/simple; bh=y3sj2EViK6Z3RvUF6ywM3xkcFlE4t+lUC50JQ9RojJc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=EhpNlisXuMn02c6ZdVla6+twl/lShRuUXdBDX0pYMYl9NzQ8BHoLZdjcmATy5ZjadGLDoFzpn46WyYgMmb+919Gahb9L2+WJHBnn6vo3xPKxHAnV9QJAmeN/oeSrO2CHs6+f4qhCnCnYg12+T0+74IDqEZonEVlLk+jEY3YOSMU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727168746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=wRojX4iu9DbZnLnd14khJBuhz8IGk3AL8rnxgYXX65A=; b=FXO23s6TwGwOmchGuvU12xdEVmU2YEsh2c2W4Xh6sFvMof3z3EV4jS0Z2v4Ym5HTJ57Ze+ leHHAdSV//WboNUrOcuo640b+EQihcjFfwWU6HiKewjNTeuHrMSwGBtLJXk+xYOzItRrte 6ClGqpdT6VGnDNW2vIcukWRL+vSmFxM= 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-322-RxDmkLTQNIq9QgPXczKgug-1; Tue, 24 Sep 2024 05:05:44 -0400 X-MC-Unique: RxDmkLTQNIq9QgPXczKgug-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.17]) (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 E42BC19030A7 for ; Tue, 24 Sep 2024 09:05:43 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.225.92]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 00D1F1956048 for ; Tue, 24 Sep 2024 09:05:42 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH] nptl: Fall back to setresuid32 in tst-setuid2 Date: Tue, 24 Sep 2024 11:05:39 +0200 Message-ID: <87o74dfml8.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.17 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 On sparcv9-linux-gnu, __NR_setresuid is not defined. Use __NR_setresuid32 instead. (Presumably, setresuid was once the 16-bit variant of the system call.) --- nptl/tst-setuid2.c | 5 +++++ 1 file changed, 5 insertions(+) base-commit: 16a59571e4e9fd019d3fc23a2e7d73c1df8bb5cb diff --git a/nptl/tst-setuid2.c b/nptl/tst-setuid2.c index 33d4e39fff..205f1459a3 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_setresuid long ret = syscall (__NR_setresuid, 2001, 2002, 2003); +#else + /* Needed on sparcv9, which does not have the setresuid system call. */ + long ret = syscall (__NR_setresuid32, 2001, 2002, 2003); +#endif if (ret != 0) FAIL ("setresuid (2001, 2002, 2003): %ld", ret); }