Re: BUG #16070: A double-free bug ininterfaces/libpq/fe-secure-openssl.c

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: BUG #16070: A double-free bug ininterfaces/libpq/fe-secure-openssl.c
Дата
Msg-id 20191021032537.GG1542@paquier.xyz
обсуждение исходный текст
Ответ на Re: BUG #16070: A double-free bug in interfaces/libpq/fe-secure-openssl.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #16070: A double-free bug in interfaces/libpq/fe-secure-openssl.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Sun, Oct 20, 2019 at 10:17:11AM -0400, Tom Lane wrote:
> I don't really believe this; if there were a double-free problem here,
> we'd surely have noticed it long since.

Yeah.

> Taking a look at the OpenSSL source code, it looks like engine_free_util
> decrements a reference count and doesn't actually delete anything until
> that's gone to zero.  So maybe the refcount is 2 at the beginning of
> this sequence?

The docs of OpenSSL mention the use of both successively, where
ENGINE_free() does the cleanup after ENGINE_by_id(), and
ENGINE_finish() cleans up after ENGINE_init():
https://www.openssl.org/docs/man1.1.0/man3/ENGINE_finish.html

And an actual issue is that we have no coverage for it:
https://coverage.postgresql.org/src/interfaces/libpq/fe-secure-openssl.c.gcov.html
--
Michael

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Re: BUG #16068: Collate of 'Norwegian Bokmål' is problematic
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #16070: A double-free bug in interfaces/libpq/fe-secure-openssl.c