From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by sourceware.org (Postfix) with ESMTPS id B90323858C66 for ; Mon, 12 Feb 2024 17:25:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B90323858C66 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=owlfolio.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=owlfolio.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B90323858C66 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=66.111.4.27 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707758752; cv=none; b=myGzYDV/RzseBfjamVTVmnndttmgRYtmc/nucjsMzRvR0uxA3SrGM3lgyjxDGIrV+7A0ny6zswbkasqp3/DPagLXNSio8RFZ/ENFgIl1xX+TOaka8Z/DZRZO1nzfoGOA1IdRut5z3Vc//1BWRioluuCYKjk7bL6z6tnpT/aP5qs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707758752; c=relaxed/simple; bh=XBVb65vEbCXVuDYrkvV6GQHFP81frfXCzhYkExuYNqs=; h=DKIM-Signature:DKIM-Signature:MIME-Version:Message-Id:Date:From: To:Subject; b=B0yqC7zOjJ0QxGUzqMN2mN/7GFkAP1rG1kJpHvptA22mxO/IkI1Veg9nhUfuv+OaFtp7VnCRyGrASg9KqppeITsrH6zpOaV60vUaVdgYJbZ0fmYuG1LvdlECQlW6X+cFgUTMm/UMVl02SVhkVpXNhELyB/ogu69vBJlnsrd9TRE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C276F5C00C1; Mon, 12 Feb 2024 12:25:48 -0500 (EST) Received: from imap45 ([10.202.2.95]) by compute5.internal (MEProxy); Mon, 12 Feb 2024 12:25:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=owlfolio.org; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1707758748; x=1707845148; bh=Jy1n/TC6HW obUxNv4beNcqLz3fWU6Z+4TOz9NTIXB1s=; b=h665TDmaaPw9VIgoTUj2vDje8R s36tacUzsh0mTaP4snRAL4XorRw24N8+NrUH/UdjOrNC66E4ProRsLlSEbPsgSNZ pZwS2mGfwQgduNOh1lgyNQg6kxmJr80gKViJU5Xx47ns9LnPeMmk8Sbk5P8byuoq eHF8O/fZul9zM8xDobX6H5Ayye/XSfI5aEgxM+9Y8kFTqnmXgEs5V1LM1IX29PFG 5rmBGa4+ReI37H3LdP5iOgjeQyZJ828NthLcVfTaSvgCmaYbpL8J2LTROGVIO0Cy RZnZy1G3PCVo7Irjg67hOwpwVf7vhocXRswzLOcjWqMYmgyc62dcAOLZ7mOg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1707758748; x=1707845148; bh=Jy1n/TC6HWobUxNv4beNcqLz3fWU 6Z+4TOz9NTIXB1s=; b=iMsejMaVQqBjcL3K23UbZpvtVk83njYHu5rzqyUn5dGg AQQizH5k2O88X/4g5bjarAc2MYwV4f3MOauAnM+o3cG/6s3dHlAwglKGd6flegw5 Oi3eG2kIrxae1zIiJYrosB1Kr1vHXQz9iW387C//f2bxsquSWn+vYysppBV7VqH/ hM4r1x3wyY+ynxqMaEKWwG3hiyDR4Y0iXJkQAMk0n2mSNan80CZhJLgbaJUKqtQJ w3c4Hd+vFPQwLUoz8KvStWcbayGIJiXvfjy2TmSzKw38pXPaaF4djKoVGMWwXXCs 1oL6TEm0GfacE/mORz1bru2HO294zLptfmFJzUMeUQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefgdellecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdgkrggt khcuhggvihhnsggvrhhgfdcuoeiirggtkhesohiflhhfohhlihhordhorhhgqeenucggtf frrghtthgvrhhnpefhleefheduhfelgeehgeejveehueeihedvgfeuueetteelieeiteeh fefhleduieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpeiirggtkhesohiflhhfohhlihhordhorhhg X-ME-Proxy: Feedback-ID: i876146a2:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 76F8F272007C; Mon, 12 Feb 2024 12:25:48 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-144-ge5821d614e-fm-20240125.002-ge5821d61 MIME-Version: 1.0 Message-Id: In-Reply-To: <18d9e1b74fd.108074ea744834.1983132793117906544@zohomail.com> References: <20240208152224.11031-2-safinaskar@zohomail.com> <87wmr9ahfv.fsf@oldenburg3.str.redhat.com> <20240212144439.GO22081@brightrain.aerifal.cx> <18d9e1b74fd.108074ea744834.1983132793117906544@zohomail.com> Date: Mon, 12 Feb 2024 12:25:27 -0500 From: "Zack Weinberg" To: "Askar Safin" Cc: "GNU libc development" Subject: Re: [PATCH v2] Add public function syscall_no_errno Content-Type: text/plain X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,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: On Mon, Feb 12, 2024, at 11:16 AM, Askar Safin wrote: > ---- On Mon, 12 Feb 2024 18:44:31 +0400 Rich Felker wrote --- > > Yes, there are a very small number of such syscalls -- getuid and > > getgid are the only relevant ones AFAICT -- but the author of this > > proposal is missing the point > > Okay, I declare defeat I have a question for you: Do glibc's existing getuid() and getgid() functions correctly handle IDs in the [-4095, -1] range (perhaps better described as the [4294963201, 4294967295] range) ? It appears to me from binary code inspection that they do -- here's the assembly dump of getuid() on x86-64: (gdb) disas getuid Dump of assembler code for function __GI_getuid: 0x00000000000cf940 <+0>: mov $0x66,%eax 0x00000000000cf945 <+5>: syscall 0x00000000000cf947 <+7>: ret End of assembler dump. But I am not having any luck figuring out what bit of glibc's *source* code tells the syscall stub generator not to emit the code to check for error returns for these syscalls, so it's plausible to me that there is a bug in here somewhere, possibly only on lesser-used architectures. If you know of a case where we get this wrong, please tell us about it so we can fix it. zw