Re: Use-after-free in 12- EventTriggerAlterTableEnd

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Use-after-free in 12- EventTriggerAlterTableEnd
Дата
Msg-id 1093133.1603826467@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Use-after-free in 12- EventTriggerAlterTableEnd  (Arseny Sher <a.sher@postgrespro.ru>)
Список pgsql-hackers
Arseny Sher <a.sher@postgrespro.ru> writes:
> Valgrind on our internal buildfarm complained about use-after-free
> during currentEventTriggerState->commandList manipulations, e.g. lappend
> in EventTriggerCollectSimpleCommand. I've discovered that the source of
> problem is EventTriggerAlterTableEnd not bothering to switch into its
> own context before appending to the list. ced138e8cba fixed this in
> master and 13 but wasn't backpatched further, so I see the problem in
> 12-.

Yeah, that clearly should have been back-patched --- the fact that it
accidentally didn't fail in the most common case wasn't a good reason
for leaving the bug in place.  I'm not excited about the test case
ced138e8cba added though, so I think your proposed patch is fine.
Will push shortly.

            regards, tom lane



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

Предыдущее
От: Anastasia Lubennikova
Дата:
Сообщение: Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits
Следующее
От: John Naylor
Дата:
Сообщение: cutting down the TODO list thread