pgsql: Avoid repeated name lookups during table and index DDL.

Поиск
Список
Период
Сортировка
От Robert Haas
Тема pgsql: Avoid repeated name lookups during table and index DDL.
Дата
Msg-id E1WFPlT-0000hC-65@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Avoid repeated name lookups during table and index DDL.

If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts.  At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed against a
different table than the index creation, allowing for a privilege
escalation attack.

This changes the calling convention for DefineIndex, CreateTrigger,
transformIndexStmt, transformAlterTableStmt, CheckIndexCompatible
(in 9.2 and newer), and AlterTable (in 9.1 and older).  In addition,
CheckRelationOwnership is removed in 9.2 and newer and the calling
convention is changed in older branches.  A field has also been added
to the Constraint node (FkConstraint in 8.4).  Third-party code calling
these functions or using the Constraint node will require updating.

Report by Andres Freund.  Patch by Robert Haas and Andres Freund,
reviewed by Tom Lane.

Security: CVE-2014-0062

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/b5c574399ee7306bee3650f0907a07e42be82b33

Modified Files
--------------
src/backend/bootstrap/bootparse.y   |   15 +++-
src/backend/catalog/index.c         |   13 ++--
src/backend/catalog/pg_constraint.c |   19 +++++
src/backend/commands/alter.c        |    4 +-
src/backend/commands/indexcmds.c    |   25 ++++---
src/backend/commands/tablecmds.c    |  134 ++++++++++++++++++++++-------------
src/backend/commands/trigger.c      |   25 +++++--
src/backend/nodes/copyfuncs.c       |    1 +
src/backend/nodes/equalfuncs.c      |    1 +
src/backend/nodes/outfuncs.c        |    1 +
src/backend/parser/parse_utilcmd.c  |   56 ++++++---------
src/backend/tcop/utility.c          |   52 +++++++++++---
src/include/catalog/index.h         |    1 +
src/include/catalog/pg_constraint.h |    1 +
src/include/commands/defrem.h       |    2 +-
src/include/commands/tablecmds.h    |    2 +-
src/include/commands/trigger.h      |    2 +-
src/include/nodes/parsenodes.h      |    2 +
src/include/parser/parse_utilcmd.h  |    5 +-
src/include/tcop/utility.h          |    2 +-
20 files changed, 233 insertions(+), 130 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Noah Misch
Дата:
Сообщение: pgsql: Prevent privilege escalation in explicit calls to PL validators.
Следующее
От: Noah Misch
Дата:
Сообщение: pgsql: Prevent privilege escalation in explicit calls to PL validators.