Fix crash in REINDEX CONCURRENTLY due to DDLs run in index functions ReindexRelationConcurrently() keeps track of the OIDs of the relations it processes across all its phases, relying on session locks to protect them. A function called from an index predicate or expression could drop one of the indexes being processed by a REINDEX CONCURRENTLY, causing a crash during the swap phase due to a relation gone missing.
The relations being reindexed, on which are taken the session locks, are now pinned during the build and validation phases so as no manipulation of their definition can happen in the session running a REINDEX CONCURRENTLY. Reported-by: Florent Saudel <[email protected]> Author: Michael Paquier <[email protected]> Backpatch-through: 14 Security: CVE-2026-116336 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/061cc0ee6f017ba6b937c61a50c91a758b9a95a8 Author: Michael Paquier <[email protected]> Modified Files -------------- src/backend/commands/indexcmds.c | 62 ++++++++++++++++++++++++++++++ src/test/regress/expected/create_index.out | 27 +++++++++++++ src/test/regress/sql/create_index.sql | 21 ++++++++++ 3 files changed, 110 insertions(+)
