pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Handle composite type changes in ExecEvalFieldStore[De]Form
4+ messages / 1 participants
[nested] [flat]

* pgsql: Handle composite type changes in ExecEvalFieldStore[De]Form
@ 2026-11-09 14:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Noah Misch @ 2026-11-09 14:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Handle composite type changes in ExecEvalFieldStore[De]Form

The composite type may be modified during execution, e.g. between
deforming and forming a value, but the executor code ignored that and
could have deformed/formed the tuple with a mismatching descriptor. The
consequences could be severe, including reading/writing memory, etc.

Fixed by remembering the descriptor in ExecInitExprRec(), and using it
when deforming and forming tuples later, instead of looking up a new
descriptor. This is the same approach already used for RowExpr.

This means attributes added after initializing the descriptor will be
treated as NULL, and dropped attributes will be removed from the tuple.

Technically, this is an ABI break. It modifies the ExprEvalStep, which
is part of the ABI. The meaning of one pointer (replacing rowcache with
tupdesc) changes, and ncolumns gets removed. Neither changes the layout
or size of the struct, and so should be backwards compatible. It could
have a bigger impact on custom JIT providers, but we've not found any.

Reported-by: OpenAI Codex Security
Reported-by: Bronson Yen <bronson@calif.io>
Reported-by: Mehmet D. INCE <mehmet@mehmetince.net>
Author: Tomas Vondra <tomas@vondra.me>
Co-Authored-by: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Reviewed-by: Andres Freund <andres@anarazel.de>
Security: CVE-2026-116306
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3beee6e77c8f7df9c1b8b94199d92d0dbba68063
Author: Tomas Vondra <tomas.vondra@postgresql.org>

Modified Files
--------------
src/backend/executor/execExpr.c        |  31 +++++---
src/backend/executor/execExprInterp.c  |  26 +------
src/include/executor/execExpr.h        |   5 +-
src/test/regress/expected/rowtypes.out | 132 +++++++++++++++++++++++++++++++++
src/test/regress/sql/rowtypes.sql      | 131 ++++++++++++++++++++++++++++++++
5 files changed, 286 insertions(+), 39 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Handle composite type changes in ExecEvalFieldStore[De]Form
@ 2026-11-09 14:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Noah Misch @ 2026-11-09 14:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Handle composite type changes in ExecEvalFieldStore[De]Form

The composite type may be modified during execution, e.g. between
deforming and forming a value, but the executor code ignored that and
could have deformed/formed the tuple with a mismatching descriptor. The
consequences could be severe, including reading/writing memory, etc.

Fixed by remembering the descriptor in ExecInitExprRec(), and using it
when deforming and forming tuples later, instead of looking up a new
descriptor. This is the same approach already used for RowExpr.

This means attributes added after initializing the descriptor will be
treated as NULL, and dropped attributes will be removed from the tuple.

Technically, this is an ABI break. It modifies the ExprEvalStep, which
is part of the ABI. The meaning of one pointer (replacing rowcache with
tupdesc) changes, and ncolumns gets removed. Neither changes the layout
or size of the struct, and so should be backwards compatible. It could
have a bigger impact on custom JIT providers, but we've not found any.

Reported-by: OpenAI Codex Security
Reported-by: Bronson Yen <bronson@calif.io>
Reported-by: Mehmet D. INCE <mehmet@mehmetince.net>
Author: Tomas Vondra <tomas@vondra.me>
Co-Authored-by: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Reviewed-by: Andres Freund <andres@anarazel.de>
Security: CVE-2026-116306
Backpatch-through: 14

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2ac7e6e8a56587e8976b1ebb3c8cf9e1de98346d
Author: Tomas Vondra <tomas.vondra@postgresql.org>

Modified Files
--------------
src/backend/executor/execExpr.c        |  31 +++++---
src/backend/executor/execExprInterp.c  |  26 +------
src/include/executor/execExpr.h        |   5 +-
src/test/regress/expected/rowtypes.out | 132 +++++++++++++++++++++++++++++++++
src/test/regress/sql/rowtypes.sql      | 131 ++++++++++++++++++++++++++++++++
5 files changed, 286 insertions(+), 39 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Handle composite type changes in ExecEvalFieldStore[De]Form
@ 2026-11-09 14:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Noah Misch @ 2026-11-09 14:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Handle composite type changes in ExecEvalFieldStore[De]Form

The composite type may be modified during execution, e.g. between
deforming and forming a value, but the executor code ignored that and
could have deformed/formed the tuple with a mismatching descriptor. The
consequences could be severe, including reading/writing memory, etc.

Fixed by remembering the descriptor in ExecInitExprRec(), and using it
when deforming and forming tuples later, instead of looking up a new
descriptor. This is the same approach already used for RowExpr.

This means attributes added after initializing the descriptor will be
treated as NULL, and dropped attributes will be removed from the tuple.

Technically, this is an ABI break. It modifies the ExprEvalStep, which
is part of the ABI. The meaning of one pointer (replacing rowcache with
tupdesc) changes, and ncolumns gets removed. Neither changes the layout
or size of the struct, and so should be backwards compatible. It could
have a bigger impact on custom JIT providers, but we've not found any.

Reported-by: OpenAI Codex Security
Reported-by: Bronson Yen <bronson@calif.io>
Reported-by: Mehmet D. INCE <mehmet@mehmetince.net>
Author: Tomas Vondra <tomas@vondra.me>
Co-Authored-by: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Reviewed-by: Andres Freund <andres@anarazel.de>
Security: CVE-2026-116306
Backpatch-through: 14

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4ccea70a1817fe740bf15e9411947b88d737c61d
Author: Tomas Vondra <tomas.vondra@postgresql.org>

Modified Files
--------------
src/backend/executor/execExpr.c        |  31 +++++---
src/backend/executor/execExprInterp.c  |  26 +------
src/include/executor/execExpr.h        |   5 +-
src/test/regress/expected/rowtypes.out | 132 +++++++++++++++++++++++++++++++++
src/test/regress/sql/rowtypes.sql      | 131 ++++++++++++++++++++++++++++++++
5 files changed, 286 insertions(+), 39 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Handle composite type changes in ExecEvalFieldStore[De]Form
@ 2026-11-09 14:22 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Noah Misch @ 2026-11-09 14:22 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Handle composite type changes in ExecEvalFieldStore[De]Form

The composite type may be modified during execution, e.g. between
deforming and forming a value, but the executor code ignored that and
could have deformed/formed the tuple with a mismatching descriptor. The
consequences could be severe, including reading/writing memory, etc.

Fixed by remembering the descriptor in ExecInitExprRec(), and using it
when deforming and forming tuples later, instead of looking up a new
descriptor. This is the same approach already used for RowExpr.

This means attributes added after initializing the descriptor will be
treated as NULL, and dropped attributes will be removed from the tuple.

Technically, this is an ABI break. It modifies the ExprEvalStep, which
is part of the ABI. The meaning of one pointer (replacing rowcache with
tupdesc) changes, and ncolumns gets removed. Neither changes the layout
or size of the struct, and so should be backwards compatible. It could
have a bigger impact on custom JIT providers, but we've not found any.

Reported-by: OpenAI Codex Security
Reported-by: Bronson Yen <bronson@calif.io>
Reported-by: Mehmet D. INCE <mehmet@mehmetince.net>
Author: Tomas Vondra <tomas@vondra.me>
Co-Authored-by: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Reviewed-by: Andres Freund <andres@anarazel.de>
Security: CVE-2026-116306
Backpatch-through: 14

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/357a99a4d4d13aa5b8d50252dc12d0dac1a3e702
Author: Tomas Vondra <tomas.vondra@postgresql.org>

Modified Files
--------------
src/backend/executor/execExpr.c        |  31 +++++---
src/backend/executor/execExprInterp.c  |  26 +------
src/include/executor/execExpr.h        |   5 +-
src/test/regress/expected/rowtypes.out | 132 +++++++++++++++++++++++++++++++++
src/test/regress/sql/rowtypes.sql      | 131 ++++++++++++++++++++++++++++++++
5 files changed, 286 insertions(+), 39 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2026-11-09 14:22 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 14:21 pgsql: Handle composite type changes in ExecEvalFieldStore[De]Form Noah Misch <noah@leadboat.com>
2026-11-09 14:21 pgsql: Handle composite type changes in ExecEvalFieldStore[De]Form Noah Misch <noah@leadboat.com>
2026-11-09 14:21 pgsql: Handle composite type changes in ExecEvalFieldStore[De]Form Noah Misch <noah@leadboat.com>
2026-11-09 14:22 pgsql: Handle composite type changes in ExecEvalFieldStore[De]Form 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