pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Avoid using a dangling pointer in expanded-record domain checks. 3+ messages / 1 participants [nested] [flat]
* pgsql: Avoid using a dangling pointer in expanded-record domain checks. @ 2026-11-09 14:21 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 3+ messages in thread From: Noah Misch @ 2026-11-09 14:21 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Avoid using a dangling pointer in expanded-record domain checks. @ 2026-11-09 14:21 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 3+ messages in thread From: Noah Misch @ 2026-11-09 14:21 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/05740dd40803d35d99d33d69e1654e06e9350ca3 Author: Tom Lane <tgl@sss.pgh.pa.us> Modified Files -------------- src/backend/utils/adt/expandedrecord.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Avoid using a dangling pointer in expanded-record domain checks. @ 2026-11-09 14:22 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 3+ messages in thread From: Noah Misch @ 2026-11-09 14:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2d91c1c78aea39285c85fae29c5737a4106eeaf0 Author: Tom Lane <tgl@sss.pgh.pa.us> Modified Files -------------- src/backend/utils/adt/expandedrecord.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2026-11-09 14:22 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-11-09 14:21 pgsql: Avoid using a dangling pointer in expanded-record domain checks. Noah Misch <noah@leadboat.com> 2026-11-09 14:21 pgsql: Avoid using a dangling pointer in expanded-record domain checks. Noah Misch <noah@leadboat.com> 2026-11-09 14:22 pgsql: Avoid using a dangling pointer in expanded-record domain checks. Noah Misch <noah@leadboat.com>
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