Re: [GENERAL] Security implications of (plpgsql) functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] Security implications of (plpgsql) functions
Дата
Msg-id 25182.1035218681@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [GENERAL] Security implications of (plpgsql) functions  (Joe Conway <mail@joeconway.com>)
Ответы Re: [GENERAL] Security implications of (plpgsql) functions
Список pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> Is there any way to recognize infinite recursion by analyzing the saved 
> execution tree -- i.e. can we assume that a function that calls itself, with 
> the same arguments with which it was called, constitutes infinite recursion?

A bulletproof solution would be equivalent to solving the halting
problem, I believe.  The test you mentioned is easily defeated by
recursing between two functions.  Also, a would-be instigator of
DOS doesn't need *infinite* recursion; it could be quite finite and
still blow out your stack.  For example ask for factorial(10million)
where factorial is defined in the traditional recursive way...
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: [GENERAL] Security implications of (plpgsql) functions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Please help