From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid using a dangling pointer in expanded-record domain checks.
Date: Mon, 09 Nov 2026 14:21:51 +0000
Message-ID: <E1xQQFr-000000003MG-02Jd@gemulon.postgresql.org> (raw)
Avoid using a dangling pointer in expanded-record domain checks.
build_dummy_expanded_header() sets up the expanded record's dummy
child to have eoh_context equal to the parent's er_short_term_cxt.
If some operation on the dummy record causes creation of a short-term
context belonging to the dummy record itself, that will be a child
of the parent's er_short_term_cxt, which means it will get deleted
when we reset the parent's er_short_term_cxt at the end of the callers
of build_dummy_expanded_header(). So the next time through, we'll try
to use a dangling context pointer, which often will now be pointing
at some other unrelated context. That at least risks a crash, and
it's reported to be exploitable for arbitrary code execution.
To fix, just clear the potentially-dangling pointer in the next
usage cycle.
Reported-by: Claude and Ada Logics
Author: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 14
Security: CVE-2026-120150
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/b93d8a554da5d9da56dab632b54d31dd05beea49
Author: Tom Lane <tgl@sss.pgh.pa.us>
Modified Files
--------------
src/backend/utils/adt/expandedrecord.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
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: Avoid using a dangling pointer in expanded-record domain checks.
In-Reply-To: <E1xQQFr-000000003MG-02Jd@gemulon.postgresql.org>
References: <E1xQQFr-000000003MG-02Jd@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