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 1fk5JA-0000on-F9 for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jul 2018 10:21:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fk5J8-0001UL-Ia for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jul 2018 10:21:42 +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 1fk5J7-0001UE-GA for pgsql-hackers@lists.postgresql.org; Mon, 30 Jul 2018 10:21:42 +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 1fk5J4-0003vl-Ju for pgsql-hackers@lists.postgresql.org; Mon, 30 Jul 2018 10:21:40 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D1E9A21D06; Mon, 30 Jul 2018 06:21:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 30 Jul 2018 06:21:37 -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=+/T0H3+TcIOPGacTvIw1wVsA6BRqdLMCZdpoPgtflfM=; b=B2fx1EwZ Ts3PUj8N1KDtcGLFSgHILlu2H1dQOIjOQExOiWlx7F9JKhjb196FX0jdCrXlRfh8 PFgfhuMKcD07pM0JIA+w8Ted6WlpGrMUSGOsiWOO8WMoYfEMHlJ7tIxaUlTU/WFN ZaFMzK0mgJnbNPw9gsKldWM6OUsJYHIJmLkoseaB413mQyb2exJM8Rke77Il5Wm/ aiF7Ad8ZB9RQfmD6/CpeaLt6UNGVsvEBCOdOHoiOr/s98Voom/fOKkjPXhzrjfnb tE2BlsYxjJuzJLTcNAJG/GqzcHxBJUx1L17JrF/SAA3ZpJ0K7VexpE/TGin0VKvj /7P3cIcs837hNA== 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=+/T0H3+TcIOPGacTvIw1wVsA6BRqd LMCZdpoPgtflfM=; b=bubiy+zx1QBNWwE5WemfwPNadXS2vIbvZu+w6OjPOwGL/ qbQhQmXlqOeeoAcFts778wIUf5h9/gfrTxz+Nc2soudXCvnNaYeIYXZuvPaUiRDH 0d84iN4j1GUnQNMxU4pohzwjlSDdg8/f0kDYN3viQT5KTN++sUNiAz6GsCmn54uK ivSo6EpOhfeeVIvivh9kXvGIOIxII1JOdK6EzUQbEQw6Ep4olc9D3YU510ePCFMz hiNGjNtO4XXv+e1s8aJ4WKq8DCx1T9Kuc3lLRGW7wTvLYvBELb9Z/LA0cmqkoNWH H7pVL/GpuKS1YWUHAVKITrmxAAgLetI3jVfARJZ/w== X-ME-Proxy: X-ME-Sender: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 74671E454E; Mon, 30 Jul 2018 06:21:34 -0400 (EDT) Date: Mon, 30 Jul 2018 19:21:31 +0900 From: Michael Paquier To: Kyotaro HORIGUCHI Cc: bossartn@amazon.com, andres@anarazel.de, pgsql-hackers@lists.postgresql.org, robertmhaas@gmail.com, schnjere@amazon.com, pgsql-hackers@postgresql.org, lalbin@scharp.org Subject: Re: BUG #15182: Canceling authentication due to timeout aka Denial of Service Attack Message-ID: <20180730102131.GC2878@paquier.xyz> References: <20180728001012.GC1882@paquier.xyz> <6D3CBDB6-C358-49F0-8D00-32E58AD2D3D3@amazon.com> <20180730003422.GA2878@paquier.xyz> <20180730.175354.32712514.horiguchi.kyotaro@lab.ntt.co.jp> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ey/N+yb7u/X9mFhi" Content-Disposition: inline In-Reply-To: <20180730.175354.32712514.horiguchi.kyotaro@lab.ntt.co.jp> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --ey/N+yb7u/X9mFhi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jul 30, 2018 at 05:53:54PM +0900, Kyotaro HORIGUCHI wrote: > I feel that just being a database owner doesn't justify to cause > this problem innocently. Catalog owner is also doubious but we > can carefully configure the ownerships to avoid the problem since > only superuser can change it. So I vote +1 for the revised patch. Thanks for the review. Yes that sucks that being just a database or a schema owner allows such a user to take an exclusive lock on shared catalogs. Please note that depending on the order of the relations, authentication may or may not be blocked depending on what kind of locks the second session takes. > | Parameters > ... > | SYSTEM > | Recreate all indexes on system catalogs within the current > | database. *Indexes on shared system catalogs are included*. > | Indexes on user tables are not processed. This form > | of REINDEX cannot be executed inside a transaction block. This looks correct to me, shared catalogs are included, and the "notes" section clealy mentions that being an owner of the shared catalog is required. > This apparently changes the documented behavior and the problem > seems to be a result of a rather malicious/intentional > combination of operatoins (especially named vacuum on a shared > catalog). I vote -0.5 to backpatch unless we categorize this as a > security issue. Ask that to any vendors doing shared hosting of Postgres :) A backpatch looks like the correct course of events to me. Anybody here is free to express his/her concerns of course. -- Michael --ey/N+yb7u/X9mFhi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlte5qsACgkQnvQgOdby QH3nSxAAoHM/M6+/8wleBqSIKfL4AA6tFSO/7N6lq0e+6vuwNMg+S8lS/+dbSdGe QI9218vNioJ1hdpVIcUJPslf+lgaSQj7NArJ004Rb6quBzfyn1ZUs/KVO9AsW+c9 vDnATuztYzi03LrfECcmx5/Pmmq7ak9tY9TAsJyAlUNFTXJPp27TMwkEIi3rMZgD /0iEdzgac/bWLaPtTcimBBAKH+yr1PIUCKXwFViFsDpjdDOpjltM8/SeOdfL1bUG ru3FVY+CpQmCYkHGDsKDfc6lRxsjncm/U18OAXbxm+dN4TollbXa0UhGZdyMc/np vBo7T9hzRaDZUfGbea5SFF1o+RuYTMpBWG+I5GQZ0iZMegfANc/xTHUWL+nskZT0 nGA24s8dxEtvaySf36VKu0ytgf6SDuE0DVZDBCgzcXt2Q74UFBxBXT7wboIkEZH8 xLp9yGQRVt2GxOXrfkBub4TtLmBE/cY8LNNubsFeIWS5cOpklg+EEk+iwaE71ZBf vjG+ndJjBRkfjV/kGWWoqtGHaC0ZLCyFPFdiJZWJ8Bnm1J63IOwW3F0wA8o5WCTI jMr4RHhT+1jyLt+Yu1R2nfF64yFLyHR24MgAyZzyE7QfCnuEn5Vvg9MSvrNgLpso gBrkNwOgUuRj/CJkC1f3TDkbbFN+wA6ypmuDXN8peD7ZVX2hdKo= =YMcX -----END PGP SIGNATURE----- --ey/N+yb7u/X9mFhi--