pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Harden Memoization code against broken data types 2+ messages / 1 participants [nested] [flat]
* pgsql: Harden Memoization code against broken data types @ 2022-06-08 00:39 David Rowley <drowley@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: David Rowley @ 2022-06-08 00:39 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Harden Memoization code against broken data types Bug #17512 highlighted that a suitably broken data type could cause the backend to crash if either the hash function or equality function were in someway non-deterministic based on their input values. Such a data type could cause a crash of the backend due to some code which assumes that we'll always find a hash table entry corresponding to an item in the Memoize LRU list. Here we remove the assumption that we'll always find the entry corresponding to the given LRU list item and add run-time checks to verify we have found the given item in the cache. This is not a fix for bug #17512, but it will turn the crash reported by that bug report into an internal ERROR. Reported-by: Ales Zeleny Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CAApHDvpxFSTwvoYWT7kmFVSZ9zLAeHb=S9vrz=RExMgSkQNWqw@mail.gmail.com Backpatch-through: 14, where Memoize was added. Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/fa5185b26c45afb8407bca2941bec95e0aef862b Modified Files -------------- src/backend/executor/nodeMemoize.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Harden Memoization code against broken data types @ 2022-06-08 00:40 David Rowley <drowley@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: David Rowley @ 2022-06-08 00:40 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Harden Memoization code against broken data types Bug #17512 highlighted that a suitably broken data type could cause the backend to crash if either the hash function or equality function were in someway non-deterministic based on their input values. Such a data type could cause a crash of the backend due to some code which assumes that we'll always find a hash table entry corresponding to an item in the Memoize LRU list. Here we remove the assumption that we'll always find the entry corresponding to the given LRU list item and add run-time checks to verify we have found the given item in the cache. This is not a fix for bug #17512, but it will turn the crash reported by that bug report into an internal ERROR. Reported-by: Ales Zeleny Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CAApHDvpxFSTwvoYWT7kmFVSZ9zLAeHb=S9vrz=RExMgSkQNWqw@mail.gmail.com Backpatch-through: 14, where Memoize was added. Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/cbcea3b91dcd242473dfdc5464dcfb53dae2bdf4 Modified Files -------------- src/backend/executor/nodeMemoize.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2022-06-08 00:40 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-06-08 00:39 pgsql: Harden Memoization code against broken data types David Rowley <drowley@postgresql.org> 2022-06-08 00:40 pgsql: Harden Memoization code against broken data types David Rowley <drowley@postgresql.org>
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