agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedFrom: Nathan Bossart <nathandbossart@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Mats Kindahl <mats@timescale.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: glibc qsort() vulnerability
Date: Thu, 8 Feb 2024 14:07:37 -0600
Message-ID: <20240208200737.GA504276@nathanxps13> (raw)
In-Reply-To: <20240208195954.vlpoii4ftoow2of4@awork3.anarazel.de>
References: <20240208004207.aoyrtv577nmhrivy@awork3.anarazel.de>
<20240208015211.GA445153@nathanxps13>
<20240208020637.3irwi5vph4fbxw2f@awork3.anarazel.de>
<CA+hUKGLbC4O56rtFM69Tx6StT3PcVio9K2GisjZp=z6O20Q3sw@mail.gmail.com>
<CA+hUKGJaOM5ULeXboxV+fGkU-pYHotL5A10hYxdu8_kwRcVEgQ@mail.gmail.com>
<20240208025620.GC445153@nathanxps13>
<CA+14424k0MbdkJuSSLrr1==PYK+oL5Gtq7siTsMgCs+KcCrEvA@mail.gmail.com>
<20240208183835.GA503311@nathanxps13>
<1074897.1707417842@sss.pgh.pa.us>
<20240208195954.vlpoii4ftoow2of4@awork3.anarazel.de>
On Thu, Feb 08, 2024 at 11:59:54AM -0800, Andres Freund wrote:
> On 2024-02-08 13:44:02 -0500, Tom Lane wrote:
>> Are we okay with using macros that (a) have double evaluation hazards
>> and (b) don't enforce the data types being compared are the same?
>> I think static inlines might be a safer technology.
>
> +1
Agreed on static inlines.
> I'd put these static inlines into common/int.h. I don't think this is common
> enough to warrant being in c.h. Probably also doesn't hurt to have a not 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]nsigned
> in the name, an efficient implementation for signed might not be the same as
> for unsigned. And if we use static inlines, we need to do so for correct
> semantics anyway.
Seems reasonable to me.
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com
view thread (64+ messages) latest in thread
Message-ID: <20240208200737.GA504276@nathanxps13>
Permalink: ../20240208200737.GA504276@nathanxps13/
Also on: postgresql.org/message-id/20240208200737.GA504276@nathanxps13
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: nathandbossart@gmail.com, andres@anarazel.de, tgl@sss.pgh.pa.us, mats@timescale.com, thomas.munro@gmail.com, hlinnaka@iki.fi, pgsql-hackers@lists.postgresql.org
Subject: Re: glibc qsort() vulnerability
In-Reply-To: <20240208200737.GA504276@nathanxps13>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox