pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix choice of comparison operators for cross-type hashed subplan 3+ messages / 1 participants [nested] [flat]
* pgsql: Fix choice of comparison operators for cross-type hashed subplan @ 2019-08-05 15:20 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2019-08-05 15:20 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix choice of comparison operators for cross-type hashed subplans. Commit bf6c614a2 rearranged the lookup of the comparison operators needed in a hashed subplan, and in so doing, broke the cross-type case: it caused the original LHS-vs-RHS operator to be used to compare hash table entries too (which of course are all of the RHS type). This leads to C functions being passed a Datum that is not of the type they expect, with the usual hazards of crashes and unauthorized server memory disclosure. For the set of hashable cross-type operators present in v11 core Postgres, this bug is nearly harmless on 64-bit machines, which may explain why it escaped earlier detection. But it is a live security hazard on 32-bit machines; and of course there may be extensions that add more hashable cross-type operators, which would increase the risk. Reported by Andreas Seltenreich. Back-patch to v11 where the problem came in. Security: CVE-2019-10209 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/4766dce0dd1a1a26db253dfc81773a2c55cd2555 Modified Files -------------- src/backend/executor/nodeSubplan.c | 15 ++++++++++----- src/test/regress/expected/subselect.out | 24 ++++++++++++++++++++++++ src/test/regress/sql/subselect.sql | 10 ++++++++++ 3 files changed, 44 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix choice of comparison operators for cross-type hashed subplan @ 2019-08-05 15:20 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2019-08-05 15:20 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix choice of comparison operators for cross-type hashed subplans. Commit bf6c614a2 rearranged the lookup of the comparison operators needed in a hashed subplan, and in so doing, broke the cross-type case: it caused the original LHS-vs-RHS operator to be used to compare hash table entries too (which of course are all of the RHS type). This leads to C functions being passed a Datum that is not of the type they expect, with the usual hazards of crashes and unauthorized server memory disclosure. For the set of hashable cross-type operators present in v11 core Postgres, this bug is nearly harmless on 64-bit machines, which may explain why it escaped earlier detection. But it is a live security hazard on 32-bit machines; and of course there may be extensions that add more hashable cross-type operators, which would increase the risk. Reported by Andreas Seltenreich. Back-patch to v11 where the problem came in. Security: CVE-2019-10209 Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/de4b75c1549ac0baf45b4bcb8d49e2fac90ac43a Modified Files -------------- src/backend/executor/nodeSubplan.c | 15 ++++++++++----- src/test/regress/expected/subselect.out | 24 ++++++++++++++++++++++++ src/test/regress/sql/subselect.sql | 10 ++++++++++ 3 files changed, 44 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix choice of comparison operators for cross-type hashed subplan @ 2019-08-05 15:20 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2019-08-05 15:20 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix choice of comparison operators for cross-type hashed subplans. Commit bf6c614a2 rearranged the lookup of the comparison operators needed in a hashed subplan, and in so doing, broke the cross-type case: it caused the original LHS-vs-RHS operator to be used to compare hash table entries too (which of course are all of the RHS type). This leads to C functions being passed a Datum that is not of the type they expect, with the usual hazards of crashes and unauthorized server memory disclosure. For the set of hashable cross-type operators present in v11 core Postgres, this bug is nearly harmless on 64-bit machines, which may explain why it escaped earlier detection. But it is a live security hazard on 32-bit machines; and of course there may be extensions that add more hashable cross-type operators, which would increase the risk. Reported by Andreas Seltenreich. Back-patch to v11 where the problem came in. Security: CVE-2019-10209 Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a034418cfc85fffa300d4d44792561c09e76f68b Modified Files -------------- src/backend/executor/nodeSubplan.c | 15 ++++++++++----- src/test/regress/expected/subselect.out | 24 ++++++++++++++++++++++++ src/test/regress/sql/subselect.sql | 10 ++++++++++ 3 files changed, 44 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2019-08-05 15:20 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-08-05 15:20 pgsql: Fix choice of comparison operators for cross-type hashed subplan Tom Lane <tgl@sss.pgh.pa.us> 2019-08-05 15:20 pgsql: Fix choice of comparison operators for cross-type hashed subplan Tom Lane <tgl@sss.pgh.pa.us> 2019-08-05 15:20 pgsql: Fix choice of comparison operators for cross-type hashed subplan Tom Lane <tgl@sss.pgh.pa.us>
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