| From: | Noah Misch <noah(at)leadboat(dot)com> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Avoid using a dangling pointer in expanded-record domain checks. |
| Date: | 2026-11-09 14:22:00 |
| Message-ID: | E1xQQG0-000000003gj-2GHF@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
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(at)sss(dot)pgh(dot)pa(dot)us>
Backpatch-through: 14
Security: CVE-2026-120150
Branch
------
REL_18_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/2d91c1c78aea39285c85fae29c5737a4106eeaf0
Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Modified Files
--------------
src/backend/utils/adt/expandedrecord.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Noah Misch | 2026-11-09 14:22:01 | pgsql: Introduce attribute versioning to prevent unsafe deforming |
| Previous Message | Noah Misch | 2026-11-09 14:21:59 | pgsql: Reject pseudo-types in extended statistics expressions. |