Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fupNm-0000rd-Lh for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Aug 2018 01:34:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fupNj-00060m-5g for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Aug 2018 01:34:51 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fupNi-00060f-1g for pgsql-hackers@lists.postgresql.org; Wed, 29 Aug 2018 01:34:50 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fupNe-000672-He for pgsql-hackers@lists.postgresql.org; Wed, 29 Aug 2018 01:34:48 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 892DC20DB5; Tue, 28 Aug 2018 21:34:45 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 28 Aug 2018 21:34:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=sOp6lPy+tOVssYAXKBLN3Tz8uM+N+2WvB2QgzxFKZmM=; b=zXqQ4tQa ho1FEr9rDs00qR6PDA+ODBEDTWxtn8nhjoZ8v70KOkNEQN2JbN8NRun0naEcTAfb X3JpsVeecXlWiME4ZJJiVXCGfsh0Er+xKrjASLVCC3fZqCIQkNJSroIU6Bg7+iCd dXCxZpchA84BVkZ3iZnAOENsiNwxrxMyIDpcvix2jg5LSVJjh0bV4u1tbOZngFkZ wzIXZfszkohSOKCgmA/uct1UWGLiOplgDdOnIOwJmVVY7qm5YeXatLAA9HqZ6dCJ vwBZhyZjJeXeQjvwTokY38rTkV2hOW8SBvPn2QN/9Qs+yU8flGwYN+Q1j+MV1wCY 5CfozmYKPeKQdA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=sOp6lPy+tOVssYAXKBLN3Tz8uM+N+ 2WvB2QgzxFKZmM=; b=bBwvjPH1os/DlywUbFmyV69FtQZnvCEbXVCx4wqkzPa1G sBjYYpo0vVGmG/aQsQkJT3NW4S97XETtZDyCuJbLHkXdZie7my3aYOLAGy1NAx/G 4PSxBUk9HHTNhDXkek5TGFBv3NYZh3fXN0VASHLMkDGIRfkOplTBuq1WIqtZk2Aq Dk9yvq9gs76ZPsU9FUmQC2At6sCnAvkTWnVm+4T2qVzEUNLakUJKt+6AvOuRyqt7 kkBgfD25m+VfS64smlaJO3fYXFMiCQJME+pRG0G2FNHnIX3IkdvqBtQ9WE4Kzzzw VHONT28n5Uh3dMjLeftjEsEzF0TRYTTHw+9wdoyGw== X-ME-Proxy: X-ME-Sender: Received: from paquier.xyz (unknown [66.201.48.83]) by mail.messagingengine.com (Postfix) with ESMTPA id 0957210291; Tue, 28 Aug 2018 21:34:42 -0400 (EDT) Date: Tue, 28 Aug 2018 18:34:41 -0700 From: Michael Paquier To: "Bossart, Nathan" Cc: Kyotaro HORIGUCHI , "andres@anarazel.de" , "pgsql-hackers@lists.postgresql.org" , "robertmhaas@gmail.com" , "Schneider, Jeremy" , "pgsql-hackers@postgresql.org" , "lalbin@scharp.org" Subject: Re: BUG #15182: Canceling authentication due to timeout aka Denial of Service Attack Message-ID: <20180829013441.GO29157@paquier.xyz> References: <20180726204127.GA1754@paquier.xyz> <3D4F2733-92AE-4B74-8912-3C611B027721@amazon.com> <20180727023123.GE1754@paquier.xyz> <20180727.123702.77822416.horiguchi.kyotaro@lab.ntt.co.jp> <20180727041542.GH1754@paquier.xyz> <62728D88-85A0-4A9A-A4F8-67D96C1179E0@amazon.com> <20180811095003.GA2900@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="88pBQ1/6ie/nQzMF" Content-Disposition: inline In-Reply-To: <20180811095003.GA2900@paquier.xyz> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --88pBQ1/6ie/nQzMF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi all, Here is a summary of what has happened since this thread has been created. Three problems reported on this thread have been solved and resulted in different commits for early lock lookups: - VACUUM FULL, patched on 12~: https://www.postgresql.org/message-id/20180812222142.GA6097@paquier.xyz Commit a556549: Improve VACUUM and ANALYZE by avoiding early lock queue - TRUNCATE, patched on 12~: https://www.postgresql.org/message-id/20180806165816.GA19883@paquier.xyz Commit f841ceb: Improve TRUNCATE by avoiding early lock queue - REINDEX, patched on 11~: https://www.postgresql.org/message-id/20180805211059.GA2185@paquier.xyz Commit 661dd23: Restrict access to reindex of shared catalogs for non-privileged users Please note that I have been very conservative with the different fixes as v11 is getting very close to release. The patch for REINDEX is a behavior change which will not get further down anyway. It would still be nice to get a second lookup at the code and look if there are other suspicious calls of relation_open or such which could allow non-privileged users to pile up locks and cause more DOS problems. Thanks, -- Michael --88pBQ1/6ie/nQzMF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAluF+DEACgkQnvQgOdby QH3qSxAAnkZoKCKVNUnnoSsQAPLMnZxK0ilBkfhbrN8hnCBpGMuLM5O6tvB3k2PV AEi4mlmIbNMkFzSo0j4arbKpwrU73gjjIX9ULtvv6Q8GC3P7rt2tw4jYVDGuDZHR egnifVgNAFFIwIG4YvP28jn/snCs9cGCsgQ8aPeqmLtTYhrGXLDJitei4lH9I9c3 0Zw33K6iYqt4oBx1Sn3szJymLmNXinPgri0/fx0xo2WdtMIHg0pBv2AJpxCclo2k L/jiCwhmLIgeMYiI9HiFCizy1cio9ooBco7O6Elcw7+O/eBvkhKzLT268bFoqPP5 Sr2Pto8E9yzY6MQdDX8hqU3RiFYU7sYxuqtOzcgAwzRZiaNK22NjN/yAD/WQaBCp gfLIhL2o++DZDFu7OabUUWrYytJQrNdA16QehDCgAsCnVlQ8j8e6FguKQa29cRHg lEiDjM4NSiZtNtOkbhS3oPL/F4JX3oDIeUOxxT6keFW5BVTdNEXMyDeGkQN34/iK 2yEzky/Lal9XvYwzM4T2vBBkoZvfb7zq3EKtLfHf7AJKwXh1SLNPfJow39+/JApq l/rKa4hP7rzCEBculMd+BWOBLKxPg/OjJ4ZU/X82qc+EG6/xj+RkJjDzCjp0sTr/ zw9B6GxuZn4wa1Af7FNRf8UYrLC/fH2zQr+s6TCwq+RGEG6gzxQ= =GGlT -----END PGP SIGNATURE----- --88pBQ1/6ie/nQzMF--