pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Defend against stack overrun in a few more places. 7+ messages / 1 participants [nested] [flat]
* pgsql: Defend against stack overrun in a few more places. @ 2022-08-24 17:02 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2022-08-24 17:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Defend against stack overrun in a few more places. SplitToVariants() in the ispell code, lseg_inside_poly() in geo_ops.c, and regex_selectivity_sub() in selectivity estimation could recurse until stack overflow; fix by adding check_stack_depth() calls. So could next() in the regex compiler, but that case is better fixed by converting its tail recursion to a loop. (We probably get better code that way too, since next() can now be inlined into its sole caller.) There remains a reachable stack overrun in the Turkish stemmer, but we'll need some advice from the Snowball people about how to fix that. Per report from Egor Chindyaskin and Alexander Lakhin. These mistakes are old, so back-patch to all supported branches. Richard Guo and Tom Lane Discussion: https://postgr.es/m/1661334672.728714027@f473.i.mail.ru Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/f25bed3801e1e500850a9f3b29a003c644d4bd6d Modified Files -------------- src/backend/regex/regc_lex.c | 5 +++-- src/backend/tsearch/spell.c | 4 ++++ src/backend/utils/adt/geo_ops.c | 3 +++ src/backend/utils/adt/like_support.c | 4 ++++ 4 files changed, 14 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Defend against stack overrun in a few more places. @ 2022-08-24 17:02 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2022-08-24 17:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Defend against stack overrun in a few more places. SplitToVariants() in the ispell code, lseg_inside_poly() in geo_ops.c, and regex_selectivity_sub() in selectivity estimation could recurse until stack overflow; fix by adding check_stack_depth() calls. So could next() in the regex compiler, but that case is better fixed by converting its tail recursion to a loop. (We probably get better code that way too, since next() can now be inlined into its sole caller.) There remains a reachable stack overrun in the Turkish stemmer, but we'll need some advice from the Snowball people about how to fix that. Per report from Egor Chindyaskin and Alexander Lakhin. These mistakes are old, so back-patch to all supported branches. Richard Guo and Tom Lane Discussion: https://postgr.es/m/1661334672.728714027@f473.i.mail.ru Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3d3c05c70fc7c1ce7794ebff55aa251a589de851 Modified Files -------------- src/backend/regex/regc_lex.c | 5 +++-- src/backend/tsearch/spell.c | 4 ++++ src/backend/utils/adt/geo_ops.c | 3 +++ src/backend/utils/adt/like_support.c | 4 ++++ 4 files changed, 14 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Defend against stack overrun in a few more places. @ 2022-08-24 17:02 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2022-08-24 17:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Defend against stack overrun in a few more places. SplitToVariants() in the ispell code, lseg_inside_poly() in geo_ops.c, and regex_selectivity_sub() in selectivity estimation could recurse until stack overflow; fix by adding check_stack_depth() calls. So could next() in the regex compiler, but that case is better fixed by converting its tail recursion to a loop. (We probably get better code that way too, since next() can now be inlined into its sole caller.) There remains a reachable stack overrun in the Turkish stemmer, but we'll need some advice from the Snowball people about how to fix that. Per report from Egor Chindyaskin and Alexander Lakhin. These mistakes are old, so back-patch to all supported branches. Richard Guo and Tom Lane Discussion: https://postgr.es/m/1661334672.728714027@f473.i.mail.ru Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/444ec169a7def141f9520c1111a31c8a5dda22ce Modified Files -------------- src/backend/regex/regc_lex.c | 5 +++-- src/backend/tsearch/spell.c | 4 ++++ src/backend/utils/adt/geo_ops.c | 3 +++ src/backend/utils/adt/like_support.c | 4 ++++ 4 files changed, 14 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Defend against stack overrun in a few more places. @ 2022-08-24 17:02 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2022-08-24 17:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Defend against stack overrun in a few more places. SplitToVariants() in the ispell code, lseg_inside_poly() in geo_ops.c, and regex_selectivity_sub() in selectivity estimation could recurse until stack overflow; fix by adding check_stack_depth() calls. So could next() in the regex compiler, but that case is better fixed by converting its tail recursion to a loop. (We probably get better code that way too, since next() can now be inlined into its sole caller.) There remains a reachable stack overrun in the Turkish stemmer, but we'll need some advice from the Snowball people about how to fix that. Per report from Egor Chindyaskin and Alexander Lakhin. These mistakes are old, so back-patch to all supported branches. Richard Guo and Tom Lane Discussion: https://postgr.es/m/1661334672.728714027@f473.i.mail.ru Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2d1f1523ce830bd59c10cf144993fdd0bba50478 Modified Files -------------- src/backend/regex/regc_lex.c | 5 +++-- src/backend/tsearch/spell.c | 4 ++++ src/backend/utils/adt/geo_ops.c | 3 +++ src/backend/utils/adt/like_support.c | 4 ++++ 4 files changed, 14 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Defend against stack overrun in a few more places. @ 2022-08-24 17:02 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2022-08-24 17:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Defend against stack overrun in a few more places. SplitToVariants() in the ispell code, lseg_inside_poly() in geo_ops.c, and regex_selectivity_sub() in selectivity estimation could recurse until stack overflow; fix by adding check_stack_depth() calls. So could next() in the regex compiler, but that case is better fixed by converting its tail recursion to a loop. (We probably get better code that way too, since next() can now be inlined into its sole caller.) There remains a reachable stack overrun in the Turkish stemmer, but we'll need some advice from the Snowball people about how to fix that. Per report from Egor Chindyaskin and Alexander Lakhin. These mistakes are old, so back-patch to all supported branches. Richard Guo and Tom Lane Discussion: https://postgr.es/m/1661334672.728714027@f473.i.mail.ru Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/599a487b093acb23ae1da7fe29eb0b6a4c26cc2c Modified Files -------------- src/backend/regex/regc_lex.c | 5 +++-- src/backend/tsearch/spell.c | 4 ++++ src/backend/utils/adt/geo_ops.c | 3 +++ src/backend/utils/adt/like_support.c | 4 ++++ 4 files changed, 14 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Defend against stack overrun in a few more places. @ 2022-08-24 17:02 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2022-08-24 17:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Defend against stack overrun in a few more places. SplitToVariants() in the ispell code, lseg_inside_poly() in geo_ops.c, and regex_selectivity_sub() in selectivity estimation could recurse until stack overflow; fix by adding check_stack_depth() calls. So could next() in the regex compiler, but that case is better fixed by converting its tail recursion to a loop. (We probably get better code that way too, since next() can now be inlined into its sole caller.) There remains a reachable stack overrun in the Turkish stemmer, but we'll need some advice from the Snowball people about how to fix that. Per report from Egor Chindyaskin and Alexander Lakhin. These mistakes are old, so back-patch to all supported branches. Richard Guo and Tom Lane Discussion: https://postgr.es/m/1661334672.728714027@f473.i.mail.ru Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/310d734efb3bb541953893a800bab4ed1b968908 Modified Files -------------- src/backend/regex/regc_lex.c | 5 +++-- src/backend/tsearch/spell.c | 4 ++++ src/backend/utils/adt/geo_ops.c | 3 +++ src/backend/utils/adt/selfuncs.c | 3 +++ 4 files changed, 13 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Defend against stack overrun in a few more places. @ 2022-08-24 17:02 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2022-08-24 17:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Defend against stack overrun in a few more places. SplitToVariants() in the ispell code, lseg_inside_poly() in geo_ops.c, and regex_selectivity_sub() in selectivity estimation could recurse until stack overflow; fix by adding check_stack_depth() calls. So could next() in the regex compiler, but that case is better fixed by converting its tail recursion to a loop. (We probably get better code that way too, since next() can now be inlined into its sole caller.) There remains a reachable stack overrun in the Turkish stemmer, but we'll need some advice from the Snowball people about how to fix that. Per report from Egor Chindyaskin and Alexander Lakhin. These mistakes are old, so back-patch to all supported branches. Richard Guo and Tom Lane Discussion: https://postgr.es/m/1661334672.728714027@f473.i.mail.ru Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/f5157a9acc9d0c2b3d4a95b2967eae97451b671d Modified Files -------------- src/backend/regex/regc_lex.c | 5 +++-- src/backend/tsearch/spell.c | 4 ++++ src/backend/utils/adt/geo_ops.c | 3 +++ src/backend/utils/adt/selfuncs.c | 3 +++ 4 files changed, 13 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2022-08-24 17:02 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-08-24 17:02 pgsql: Defend against stack overrun in a few more places. Tom Lane <tgl@sss.pgh.pa.us> 2022-08-24 17:02 pgsql: Defend against stack overrun in a few more places. Tom Lane <tgl@sss.pgh.pa.us> 2022-08-24 17:02 pgsql: Defend against stack overrun in a few more places. Tom Lane <tgl@sss.pgh.pa.us> 2022-08-24 17:02 pgsql: Defend against stack overrun in a few more places. Tom Lane <tgl@sss.pgh.pa.us> 2022-08-24 17:02 pgsql: Defend against stack overrun in a few more places. Tom Lane <tgl@sss.pgh.pa.us> 2022-08-24 17:02 pgsql: Defend against stack overrun in a few more places. Tom Lane <tgl@sss.pgh.pa.us> 2022-08-24 17:02 pgsql: Defend against stack overrun in a few more places. 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