pgsql: Add locking around SSL_context usage in libpq

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема pgsql: Add locking around SSL_context usage in libpq
Дата
Msg-id E1V4lVg-0006Be-P9@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Add locking around SSL_context usage in libpq

I've been working with Nick Phillips on an issue he ran into when
trying to use threads with SSL client certificates.  As it turns out,
the call in initialize_SSL() to SSL_CTX_use_certificate_chain_file()
will modify our SSL_context without any protection from other threads
also calling that function or being at some other point and trying to
read from SSL_context.

To protect against this, I've written up the attached (based on an
initial patch from Nick and much subsequent discussion) which puts
locks around SSL_CTX_use_certificate_chain_file() and all of the other
users of SSL_context which weren't already protected.

Nick Phillips, much reworked by Stephen Frost

Back-patch to 9.0 where we started loading the cert directly instead of
using a callback.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/9d7f66bc6c620f8c7548fc65d0e8e160615d5267

Modified Files
--------------
src/interfaces/libpq/fe-secure.c |   56 ++++++++++++++++++++++++++++++++++++--
1 file changed, 53 insertions(+), 3 deletions(-)


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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: pgsql: Add locking around SSL_context usage in libpq
Следующее
От: Stephen Frost
Дата:
Сообщение: pgsql: Add locking around SSL_context usage in libpq