Re: [PATCH] fix race condition in libpq (related to ssl connections)

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Aleksander Alekseev <aleksander(at)timescale(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Willi Mann <w(dot)mann(at)celonis(dot)de>
Subject: Re: [PATCH] fix race condition in libpq (related to ssl connections)
Date: 2023-11-27 03:03:45
Message-ID: ZWQHEdF1_NOI4jOS@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 24, 2023 at 04:48:58PM +0900, Michael Paquier wrote:
> I've looked at this idea, and finished by being unhappy with the error
> handling that we are currently assuming in my_SSL_set_fd() in the
> event of an error in the bio method setup, which would be most likely
> an OOM, so let's use ssl_config_mutex in my_BIO_s_socket(). Another
> thing is that I have minimized the manipulation of my_bio_methods in
> the setup routine.

I've spent more time on that today, and the patch I've posted on
Friday had a small mistake in the non-HAVE_BIO_METH_NEW path when
saving the BIO_METHODs causing the SSL tests to fail with older
OpenSSL versions. I've fixed that and the patch was straight-forward,
so applied it down to v12. I didn't use Willi's patch at the end,
still credited him as author as his original patch is rather close to
the result committed and it feels that he has spent a good deal of
time on this issue.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-11-27 03:34:59 Re: New instability in stats regression test
Previous Message Kyotaro Horiguchi 2023-11-27 03:00:42 Re: initdb --no-locale=C doesn't work as specified when the environment is not C