Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rYBBR-00EkHZ-RP for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Feb 2024 20:39:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rYBBQ-0036FM-Vq for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Feb 2024 20:39:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rYBBQ-0036FE-Mm for pgsql-hackers@lists.postgresql.org; Thu, 08 Feb 2024 20:39:44 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rYBBO-006BaI-G4 for pgsql-hackers@lists.postgresql.org; Thu, 08 Feb 2024 20:39:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 418KdTXf1242427; Thu, 8 Feb 2024 15:39:29 -0500 From: Tom Lane To: Nathan Bossart cc: Andres Freund , Mats Kindahl , Thomas Munro , Heikki Linnakangas , pgsql-hackers@lists.postgresql.org Subject: Re: glibc qsort() vulnerability In-reply-to: <20240208200737.GA504276@nathanxps13> References: <20240208004207.aoyrtv577nmhrivy@awork3.anarazel.de> <20240208015211.GA445153@nathanxps13> <20240208020637.3irwi5vph4fbxw2f@awork3.anarazel.de> <20240208025620.GC445153@nathanxps13> <20240208183835.GA503311@nathanxps13> <1074897.1707417842@sss.pgh.pa.us> <20240208195954.vlpoii4ftoow2of4@awork3.anarazel.de> <20240208200737.GA504276@nathanxps13> Comments: In-reply-to Nathan Bossart message dated "Thu, 08 Feb 2024 14:07:37 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1242425.1707424769.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 08 Feb 2024 15:39:29 -0500 Message-ID: <1242426.1707424769@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nathan Bossart writes: > On Thu, Feb 08, 2024 at 11:59:54AM -0800, Andres Freund wrote: >> I'd put these static inlines into common/int.h. I don't think this is c= ommon >> enough to warrant being in c.h. Probably also doesn't hurt to have a no= t quite >> as generic name as INT_CMP, I'd not be too surprised if that's defined = in some >> library. >> = >> I think it's worth following int.h's pattern of including [s]igned/[u]n= signed >> in the name, an efficient implementation for signed might not be the sa= me as >> for unsigned. And if we use static inlines, we need to do so for correc= t >> semantics anyway. > Seems reasonable to me. +1 here also. regards, tom lane