pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Don't believe MinMaxExpr is leakproof without checking.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Don't believe MinMaxExpr is leakproof without checking.
@ 2019-01-02 21:34 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2019-01-02 21:34 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't believe MinMaxExpr is leakproof without checking.

MinMaxExpr invokes the btree comparison function for its input datatype,
so it's only leakproof if that function is.  Many such functions are
indeed leakproof, but others are not, and we should not just assume that
they are.  Hence, adjust contain_leaked_vars to verify the leakproofness
of the referenced function explicitly.

I didn't add a regression test because it would need to depend on
some particular comparison function being leaky, and that's a moving
target, per discussion.

This has been wrong all along, so back-patch to supported branches.

Discussion: https://postgr.es/m/31042.1546194242@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/68a13f28bebc9eb70cc6988bfa2daaf4500f519f

Modified Files
--------------
src/backend/optimizer/util/clauses.c | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)



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

* pgsql: Don't believe MinMaxExpr is leakproof without checking.
@ 2019-01-02 21:34 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2019-01-02 21:34 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't believe MinMaxExpr is leakproof without checking.

MinMaxExpr invokes the btree comparison function for its input datatype,
so it's only leakproof if that function is.  Many such functions are
indeed leakproof, but others are not, and we should not just assume that
they are.  Hence, adjust contain_leaked_vars to verify the leakproofness
of the referenced function explicitly.

I didn't add a regression test because it would need to depend on
some particular comparison function being leaky, and that's a moving
target, per discussion.

This has been wrong all along, so back-patch to supported branches.

Discussion: https://postgr.es/m/31042.1546194242@sss.pgh.pa.us

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/099063340bb1f82cc3e156e5558f6c456b41bfa5

Modified Files
--------------
src/backend/optimizer/util/clauses.c | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)



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

* pgsql: Don't believe MinMaxExpr is leakproof without checking.
@ 2019-01-02 21:34 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2019-01-02 21:34 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't believe MinMaxExpr is leakproof without checking.

MinMaxExpr invokes the btree comparison function for its input datatype,
so it's only leakproof if that function is.  Many such functions are
indeed leakproof, but others are not, and we should not just assume that
they are.  Hence, adjust contain_leaked_vars to verify the leakproofness
of the referenced function explicitly.

I didn't add a regression test because it would need to depend on
some particular comparison function being leaky, and that's a moving
target, per discussion.

This has been wrong all along, so back-patch to supported branches.

Discussion: https://postgr.es/m/31042.1546194242@sss.pgh.pa.us

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/64edc788b4a509427eb407b0d8faac75bac5e02b

Modified Files
--------------
src/backend/optimizer/util/clauses.c | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)



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

* pgsql: Don't believe MinMaxExpr is leakproof without checking.
@ 2019-01-02 21:34 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2019-01-02 21:34 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't believe MinMaxExpr is leakproof without checking.

MinMaxExpr invokes the btree comparison function for its input datatype,
so it's only leakproof if that function is.  Many such functions are
indeed leakproof, but others are not, and we should not just assume that
they are.  Hence, adjust contain_leaked_vars to verify the leakproofness
of the referenced function explicitly.

I didn't add a regression test because it would need to depend on
some particular comparison function being leaky, and that's a moving
target, per discussion.

This has been wrong all along, so back-patch to supported branches.

Discussion: https://postgr.es/m/31042.1546194242@sss.pgh.pa.us

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c27c3993ef6dbdff1f196670877a47f374d884ad

Modified Files
--------------
src/backend/optimizer/util/clauses.c | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)



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

* pgsql: Don't believe MinMaxExpr is leakproof without checking.
@ 2019-01-02 21:34 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2019-01-02 21:34 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't believe MinMaxExpr is leakproof without checking.

MinMaxExpr invokes the btree comparison function for its input datatype,
so it's only leakproof if that function is.  Many such functions are
indeed leakproof, but others are not, and we should not just assume that
they are.  Hence, adjust contain_leaked_vars to verify the leakproofness
of the referenced function explicitly.

I didn't add a regression test because it would need to depend on
some particular comparison function being leaky, and that's a moving
target, per discussion.

This has been wrong all along, so back-patch to supported branches.

Discussion: https://postgr.es/m/31042.1546194242@sss.pgh.pa.us

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f8b9b809729298e874e593a4d52b1b1282862f78

Modified Files
--------------
src/backend/optimizer/util/clauses.c | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)



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

* pgsql: Don't believe MinMaxExpr is leakproof without checking.
@ 2019-01-02 21:34 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2019-01-02 21:34 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't believe MinMaxExpr is leakproof without checking.

MinMaxExpr invokes the btree comparison function for its input datatype,
so it's only leakproof if that function is.  Many such functions are
indeed leakproof, but others are not, and we should not just assume that
they are.  Hence, adjust contain_leaked_vars to verify the leakproofness
of the referenced function explicitly.

I didn't add a regression test because it would need to depend on
some particular comparison function being leaky, and that's a moving
target, per discussion.

This has been wrong all along, so back-patch to supported branches.

Discussion: https://postgr.es/m/31042.1546194242@sss.pgh.pa.us

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d6b37cdb6ec903545df78994806a8d9526e74fb0

Modified Files
--------------
src/backend/optimizer/util/clauses.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)



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


end of thread, other threads:[~2019-01-02 21:34 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-01-02 21:34 pgsql: Don't believe MinMaxExpr is leakproof without checking. Tom Lane <tgl@sss.pgh.pa.us>
2019-01-02 21:34 pgsql: Don't believe MinMaxExpr is leakproof without checking. Tom Lane <tgl@sss.pgh.pa.us>
2019-01-02 21:34 pgsql: Don't believe MinMaxExpr is leakproof without checking. Tom Lane <tgl@sss.pgh.pa.us>
2019-01-02 21:34 pgsql: Don't believe MinMaxExpr is leakproof without checking. Tom Lane <tgl@sss.pgh.pa.us>
2019-01-02 21:34 pgsql: Don't believe MinMaxExpr is leakproof without checking. Tom Lane <tgl@sss.pgh.pa.us>
2019-01-02 21:34 pgsql: Don't believe MinMaxExpr is leakproof without checking. 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