pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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:21:48 +0000
Message-ID: <E1xQQFo-000000003Gi-269f@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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3bb99318e56c7048044fcf5e3e0f269fe00c9b54
Author: Robert Haas <rhaas@postgresql.org>

Modified Files
--------------
src/backend/utils/cache/typcache.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1xQQFo-000000003Gi-269f@gemulon.postgresql.org>
Permalink:  ../E1xQQFo-000000003Gi-269f@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xQQFo-000000003Gi-269f@gemulon.postgresql.org

 · 

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 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: <E1xQQFo-000000003Gi-269f@gemulon.postgresql.org>
  References: <E1xQQFo-000000003Gi-269f@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