From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: find_or_make_matching_shared_tupledesc: Fix possible use-after-f
Date: Mon, 09 Nov 2026 14:22:02 +0000
Message-ID: <E1xQQG2-000000003ln-3J1G@gemulon.postgresql.org> (raw)
find_or_make_matching_shared_tupledesc: Fix possible use-after-free.
Previously, the following sequence of events was possible: (1) new
anonymous-record typmod gets entered into shared_typmod_table;
(2) another process resolves the typmod and stores a pointer to the
associated TupleDesc; (3) the first process realizes that the
TupleDesc duplicates one that already has some other typmod assigned
to it and frees the TupleDesc; (4) later, the other process
accesses the now-freed storage, interprets it as a TupleDesc, and
uses it to deform a tuple.
It is likely that an attacker can control the new contents of the
freed memory to a sufficient degree to achieve arbitrary code
execution; hence, this is a security vulnerability.
Reported-by: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Security: CVE-2026-116304
Backpatch-through: 14
Branch
------
REL_17_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/a4d40a6ae9f0c0d68a26ea625d50f9a22e0cfc41
Author: Robert Haas <rhaas@postgresql.org>
Modified Files
--------------
src/backend/utils/cache/typcache.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: noah@leadboat.com
Subject: Re: pgsql: find_or_make_matching_shared_tupledesc: Fix possible use-after-f
In-Reply-To: <E1xQQG2-000000003ln-3J1G@gemulon.postgresql.org>
References: <E1xQQG2-000000003ln-3J1G@gemulon.postgresql.org>
* 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