From: Noah Misch <noah@leadboat.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Ronan Dunklau <ronan.dunklau@aiven.io>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Subject: Re: Converting contrib SQL functions to new style
Date: Mon, 6 Jan 2025 11:04:28 -0800
Message-ID: <20250106190428.ec.nmisch@google.com> (raw)
In-Reply-To: <ZzMSJkiNZhimjXWx@paquier.xyz>
References: <3395418.1618352794@sss.pgh.pa.us>
<3133933.1730855116@sss.pgh.pa.us>
<ZysEEDZqsnP7GTKA@paquier.xyz>
<5829980.DvuYhMxLoT@aivenlaptop>
<ZywSnWzXskAxSDew@paquier.xyz>
<ZzMSJkiNZhimjXWx@paquier.xyz>
On Tue, Nov 12, 2024 at 05:30:30PM +0900, Michael Paquier wrote:
> 0004 for pg_freespace is fine regarding that for example as we have
> calls of pg_freespace(regclass) in its sql/. I've applied it to begin
> with something.
That commit (3f323eb) contains a generate_series(int, bigint) call. Following
https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATTERNS
is enough in v17, but it wouldn't be enough after that commit. An attacker
can achieve persistent capture of the inexact call:
set search_path = pg_catalog;
create or replace function public.generate_series(int, bigint) returns bigint
language plpgsql as $$
BEGIN
RAISE NOTICE 'owned';
RETURN 0;
END
$$;
create extension pg_freespacemap schema public;
select public.pg_freespace(0);
\sf public.pg_freespace(regclass)
Per postgr.es/m/3489827.1618411777@sss.pgh.pa.us and
postgr.es/m/1471865.1734212070@sss.pgh.pa.us one requirement for migrating to
SQL-standard function bodies is removing these inexact-match function and
operator calls. Here, one could either write pg_catalog.generate_series or
make the argument types match exactly.
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: noah@leadboat.com, michael@paquier.xyz, ronan.dunklau@aiven.io, tgl@sss.pgh.pa.us, peter.eisentraut@enterprisedb.com
Subject: Re: Converting contrib SQL functions to new style
In-Reply-To: <20250106190428.ec.nmisch@google.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox