pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Be more paranoid in ruleutils.c's get_variable(). 4+ messages / 1 participants [nested] [flat]
* pgsql: Be more paranoid in ruleutils.c's get_variable(). @ 2016-07-01 15:40 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2016-07-01 15:40 UTC (permalink / raw) To: pgsql-committers Be more paranoid in ruleutils.c's get_variable(). We were merely Assert'ing that the Var matched the RTE it's supposedly from. But if the user passes incorrect information to pg_get_expr(), the RTE might in fact not match; this led either to Assert failures or core dumps, as reported by Chris Hanks in bug #14220. To fix, just convert the Asserts to test-and-elog. Adjust an existing test-and-elog elsewhere in the same function to be consistent in wording. (If we really felt these were user-facing errors, we might promote them to ereport's; but I can't convince myself that they're worth translating.) Back-patch to 9.3; the problematic code doesn't exist before that, and a quick check says that 9.2 doesn't crash on such cases. Michael Paquier and Thomas Munro Report: <20160629224349.1407.32667@wrigleys.postgresql.org> Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/0daeba0e927bfcb3d0ed9d510b84e555fc1e2741 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Be more paranoid in ruleutils.c's get_variable(). @ 2016-07-01 15:40 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2016-07-01 15:40 UTC (permalink / raw) To: pgsql-committers Be more paranoid in ruleutils.c's get_variable(). We were merely Assert'ing that the Var matched the RTE it's supposedly from. But if the user passes incorrect information to pg_get_expr(), the RTE might in fact not match; this led either to Assert failures or core dumps, as reported by Chris Hanks in bug #14220. To fix, just convert the Asserts to test-and-elog. Adjust an existing test-and-elog elsewhere in the same function to be consistent in wording. (If we really felt these were user-facing errors, we might promote them to ereport's; but I can't convince myself that they're worth translating.) Back-patch to 9.3; the problematic code doesn't exist before that, and a quick check says that 9.2 doesn't crash on such cases. Michael Paquier and Thomas Munro Report: <20160629224349.1407.32667@wrigleys.postgresql.org> Branch ------ REL9_5_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/40d0bd8d5e0fa86ece5f8ad9489adab0a30dca9a Modified Files -------------- src/backend/utils/adt/ruleutils.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Be more paranoid in ruleutils.c's get_variable(). @ 2016-07-01 15:40 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2016-07-01 15:40 UTC (permalink / raw) To: pgsql-committers Be more paranoid in ruleutils.c's get_variable(). We were merely Assert'ing that the Var matched the RTE it's supposedly from. But if the user passes incorrect information to pg_get_expr(), the RTE might in fact not match; this led either to Assert failures or core dumps, as reported by Chris Hanks in bug #14220. To fix, just convert the Asserts to test-and-elog. Adjust an existing test-and-elog elsewhere in the same function to be consistent in wording. (If we really felt these were user-facing errors, we might promote them to ereport's; but I can't convince myself that they're worth translating.) Back-patch to 9.3; the problematic code doesn't exist before that, and a quick check says that 9.2 doesn't crash on such cases. Michael Paquier and Thomas Munro Report: <20160629224349.1407.32667@wrigleys.postgresql.org> Branch ------ REL9_4_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/b25d87f91d39eb8aff259766141ddd2d2d374b41 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Be more paranoid in ruleutils.c's get_variable(). @ 2016-07-01 15:40 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2016-07-01 15:40 UTC (permalink / raw) To: pgsql-committers Be more paranoid in ruleutils.c's get_variable(). We were merely Assert'ing that the Var matched the RTE it's supposedly from. But if the user passes incorrect information to pg_get_expr(), the RTE might in fact not match; this led either to Assert failures or core dumps, as reported by Chris Hanks in bug #14220. To fix, just convert the Asserts to test-and-elog. Adjust an existing test-and-elog elsewhere in the same function to be consistent in wording. (If we really felt these were user-facing errors, we might promote them to ereport's; but I can't convince myself that they're worth translating.) Back-patch to 9.3; the problematic code doesn't exist before that, and a quick check says that 9.2 doesn't crash on such cases. Michael Paquier and Thomas Munro Report: <20160629224349.1407.32667@wrigleys.postgresql.org> Branch ------ REL9_3_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/b0f20c2ea5f429a4a7bea01e2f721364bf0bd043 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2016-07-01 15:40 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2016-07-01 15:40 pgsql: Be more paranoid in ruleutils.c's get_variable(). Tom Lane <tgl@sss.pgh.pa.us> 2016-07-01 15:40 pgsql: Be more paranoid in ruleutils.c's get_variable(). Tom Lane <tgl@sss.pgh.pa.us> 2016-07-01 15:40 pgsql: Be more paranoid in ruleutils.c's get_variable(). Tom Lane <tgl@sss.pgh.pa.us> 2016-07-01 15:40 pgsql: Be more paranoid in ruleutils.c's get_variable(). 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