Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7Ruw-005SDe-T7 for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Nov 2023 03:04:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r7Ruv-00AIZq-BQ for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Nov 2023 03:04:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7Ruv-00AIZi-23 for pgsql-hackers@lists.postgresql.org; Mon, 27 Nov 2023 03:04:13 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7Ruo-007X7h-9p for pgsql-hackers@lists.postgresql.org; Mon, 27 Nov 2023 03:04:11 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id EDA913200A5F; Sun, 26 Nov 2023 22:04:04 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sun, 26 Nov 2023 22:04:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1701054244; x=1701140644; bh=eI Po+iwa23oLGFMELQdzPWp1h0CpENuwgtjbZKnB/mk=; b=O2OJ1/bcGoXfsJ3gsj M5AcgHeFeHx0SP87VQ71MagqxYXriaO8UGcKjiO+zxpTvykjeg8ymEZwE8OVsUV/ Q+7hYSM3HVVvIG+qbKBTft1COjGCF4RUQwM+CDW6xDb2++am7gxzhxFBKb/J47Nh 9n21NDDEjf2ZTfAhvG3yHxnmnrDnH2FbsAs4D2lg3PmVyxA4MQjYme6IkwJgsIpU FBL/GgyOg30MxxoaKa+cCmLNl1skVN75AfOO3buCJbF7Lxh22p5aLVuu9RUNwIKh w+de9iML153hkrEMho6EcFp7TCHghnBlv96kfr0x+m5sp3c3ypZycAlckchY1hWy NiOA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1701054244; x=1701140644; bh=eIPo+iwa23oLG FMELQdzPWp1h0CpENuwgtjbZKnB/mk=; b=SUp0qpaDeXmHkg15iUPJH/J+LXy0+ sAOt0ilUaSCc5rFxGp+7e8JVodYw+sU3+toB93O5TYAv1RazkKMymkUt2i4HUU3v ufjig2bJs/WILgRKw3GO7Hd7pkJp4Nu4dorwNPrZxqjc/88cMeNC2+XBD+w9p1u4 Rhkf+eYrEg09lFuSVOgGko2m7zfgPHRLk9YeJ6dMZ8JPsn2OLZcgEqw1zj6eWXeS 6DrQHQ9uW8F/i7Xwfb7UMPgRbvhJVVGtBiiKL07J12g0EGa4Y4u61T6oWDvCoqoC wUJDqL/ZX2rdfmMZQhOPg8vVIv8hW0a7oAU4Ii9pU0fPlOlqzauIJnNhw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeitddgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 26 Nov 2023 22:04:02 -0500 (EST) Date: Mon, 27 Nov 2023 12:03:45 +0900 From: Michael Paquier To: Aleksander Alekseev Cc: PostgreSQL Hackers , Willi Mann Subject: Re: [PATCH] fix race condition in libpq (related to ssl connections) Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="AaCIYPY9iGc0oVav" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --AaCIYPY9iGc0oVav Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --AaCIYPY9iGc0oVav Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmVkBxEACgkQnvQgOdby QH2oxA//dnKYTCvlDZdEO8xNikl0y//srmjC/ctIZbs2onXeiaW7cJsVBiAxxe4l j9fPjvOkPj9e9ePDuLV0EvSl1bbRkPaBkHTce6Zw0HA0sKK4Nt9VMYdUJG6eg5ab OLHSEvER1KKLGOqC0YqZiA5y1Aa7jW/HBoqt9GhngKKfLxxfyMeFUH54hciz9nOB frOHSEz6yexW+UodAuaLxjghe/Cn0IQxwm4T1JPHpDIZToNA6d4VYPjnDz41VPQ9 UYucDC7GeS5TAoqjBEzsU9Oh56fZ03dqvvn6rAcJLUt6/l3ZEhWw6XiEMVEblH7b Vb8sWNSL+ew3vrBkBmeOF7681Iq0pRt6zsWDvw60eFlSn8ktK9CVumlCIsgNNmAD dbgbrjnaVfnpyGmCwzuO3HO7Lz932IOsTX+EQ/mm4G7D1QgSRhY+/lzmIVYEK0lt 8bdae4/9Y9O1/ZkUANXYSwXAe/6a5EK+/jcen/w7GBcTQWm5H21ucL2KyFktrpI0 P80L+CaSRGzmN4XbRjRFWJyvlrJvMMo6JHr1a/rtio9+dY9vxF0i1yLMJ0SgsYM8 z/GvFYH1C8/2JK1AJxI2dz9k3Wx/nPTBFqBGSOfo88hJEnrwv1enjeWQPG+9VNE7 WO1/i+T4Iw0fTwSwdPWFAH81QpUQuQB211rcnTdJwFAn2UEAoyc= =B32P -----END PGP SIGNATURE----- --AaCIYPY9iGc0oVav--