public inbox for [email protected]
help / color / mirror / Atom feedFrom: Nathan Bossart <[email protected]>
To: Andres Freund <[email protected]>
Cc: Heikki Linnakangas <[email protected]>
Cc: Mats Kindahl <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: [email protected]
Subject: Re: glibc qsort() vulnerability
Date: Wed, 7 Feb 2024 16:21:24 -0600
Message-ID: <20240207222124.GA382832@nathanxps13> (raw)
In-Reply-To: <[email protected]>
References: <CA+14426g2Wa9QuUpmakwPxXFWG_1FaY0AsApkvcTBy-YfS6uaw@mail.gmail.com>
<[email protected]>
<20240206205305.GB3891538@nathanxps13>
<[email protected]>
<CA+14425TqyUZ3-O7zYsW6u85yY5diCz-p_TPQ2bZovn-N-fQ9A@mail.gmail.com>
<[email protected]>
<[email protected]>
On Wed, Feb 07, 2024 at 01:48:57PM -0800, Andres Freund wrote:
> Now, in most cases this won't matter, the sorting isn't performance
> critical. But I don't think it's a good idea to standardize on a generally
> slower pattern.
>
> Not that that's a good test, but I did quickly benchmark [1] this with
> intarray. There's about a 10% difference in performance between using the
> existing compASC() and one using
> return (int64) *(const int32 *) a - (int64) *(const int32 *) b;
>
>
> Perhaps we could have a central helper for this somewhere?
Maybe said helper could use __builtin_sub_overflow() and fall back to the
slow "if" version only if absolutely necessary. The assembly for that
looks encouraging, but I still need to actually test it...
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com
view thread (16+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: glibc qsort() vulnerability
In-Reply-To: <20240207222124.GA382832@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