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 1fkYhl-0004aD-SZ for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Jul 2018 17:45:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fkYhj-0007EG-5K for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Jul 2018 17:45:03 +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 1fkYhi-0007Dx-24 for pgsql-hackers@lists.postgresql.org; Tue, 31 Jul 2018 17:45:02 +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 1fkYhe-0004Y6-OA for pgsql-hackers@lists.postgresql.org; Tue, 31 Jul 2018 17:45:00 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id BF38E21F6B; Tue, 31 Jul 2018 13:44:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 31 Jul 2018 13:44:57 -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=ZheS0gW6c52KxVvdbtcyNI2XUYaujSrfYcYFIDK23j8=; b=UgC6drYv Pc+t/JbQlXeQiNPPImuHqsErmc3g4gEpFlsDCfUenr0QqaTaml8MZNZ02oGDgsrH Q6tUXw91iVlUf041fdsnyUS/VzIv7Dv0wixDzCuZHNNjzJV2IsjecC9lHimMqtaW J8dnZcUnXjdR4EPGKGzbVyec40l/xHfIGtlolm/X/iXtPdBVfhjxUUM9NSg97eGF iG3PpZibFbgNQ5QAeU78nHEvPHLXjg/g+9wxL5Tzd99pV9MMm98Ck2CPRmtrpfA0 UNHaAX2k3dk2qAca5Va17JRL7nTZ3bbryzQ7GPHjwDu31IvCWg47KhMJGrXv3evX SGFJYTZ0UKbjeQ== 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=ZheS0gW6c52KxVvdbtcyNI2XUYauj SrfYcYFIDK23j8=; b=FFPSzzN0lYNGFnFl7XzaiWwjV7wsupzoE1kEoSTcisbp2 8t2R+ggAIIsnXrra4yVSpYT7w3XbxAln7IczQm24SIxltSkCTKSsx2yqyXUfykP6 Amow5HwYJNd7CCzV/iv74vsRGlmSMTLa1kSz5R8RaFZs0aYxzRvP+4Gm8jqzUjY8 iQ2nCZHvU42fufhcn7xXNOtN8wFEypZ8lG0HL/LUcJVK4UwTKsO21LRhy99U9U54 c0BJk+H/LaTgXy0DUwXT2wFX4NXw2N5UQfSmChgHfq1HY7QOSfUhhk364FQtc71L iOXotP1SeA6xyaHTZ0gO+YirRjofDqby7QzdeZ+Pw== X-ME-Proxy: X-ME-Sender: Received: from paquier.xyz (77-246-194-58.cust.suomicom.net [77.246.194.58]) by mail.messagingengine.com (Postfix) with ESMTPA id CF13910276; Tue, 31 Jul 2018 13:44:54 -0400 (EDT) Date: Wed, 1 Aug 2018 02:44:52 +0900 From: Michael Paquier To: Robert Haas Cc: Kyotaro HORIGUCHI , "Bossart, Nathan" , Andres Freund , PostgreSQL Hackers , Jeremy Schneider , "pgsql-hackers@postgresql.org" , "Albin, Lloyd P" Subject: Re: BUG #15182: Canceling authentication due to timeout aka Denial of Service Attack Message-ID: <20180731174452.GA32583@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> <20180730102131.GC2878@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 31, 2018 at 10:34:57AM -0400, Robert Haas wrote: > Just as a general statement, I don't think we should, as part of a > patch for the issue discussed on this thread, make any changes AT ALL > to who has permission to perform which operations. We *certainly* > should not back-patch such changes, but we really also should not make > them on master unless they are discussed on a separate thread with a > clear subject line and agreed by a clear consensus. Well, perhaps spawning one thread for each command would make the most sense then? I am feeling a bit of confusion here. There have been three cases discussed up to now: 1) TRUNCATE, which results in a patch that has no behavioral changes. 2) VACUUM [FULL], where we are also heading toward a patch that has no behavioral change per the last arguments exchanged, where we make sure that permission checks are done before acquiring any locks. 3) REINDEX, where a database or a schema owner is able to take an exclusive lock on a shared catalog with limited permissions. That sucks as this block calls to load_critical_index, but I would be ready to buy to not back-patch such a change if the consensus reached is to not skip shared catalogs if a database/schema owner has no ownership on the shared catalog directly. > This patch should only be about detecting cases where we lack > permission earlier, before we try to acquire a lock. Yeah, the REINDEX case is the only one among the three where the set of relations worked on changes. Please note that ownership checks happen in this case for indexes, tables, database and schemas before taking a lock on them. Databases/systems and schemas just check for ownership of respectively the database and the schema. I'll be happy to create one thread per patch if that helps. Thinking about it this would attract more attention to each individual problem reported. -- Michael --G4iJoqBmSsgzjUCe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAltgoBQACgkQnvQgOdby QH3xhhAAmeQqeVc52DUPhu33Tek5XhkAq0rzJYiuGyr9nwlPAZZFX0djvNKcMOrd 9b4Dg/FH/vtRkiBnxvPXDhdBbaZM00J38pjmSd9i/Lfi19+bv53p1+DFzl60VgYF t1VGCaNilbRqLzDpt0DvTKDMmlxNYjOHWRIbAvnMiQ8VVFFc4TTe35mkqEYXjHJl /vcieNdt2vNbE20WJp0Ei3/ureBE6LvRKSbQ5MuieUBB7WmPeG96Gql3l2iYEqGf OVh9YXByfQ4+KwGcj65dhD0sgciG5q+CdoCLZp3Du0gquvfcuWJKODhnHMXydS1r lVLE7NixqvIdJvWAUMBQ0TKjqkEDqD18eiC+wptDlW5fqPcqQ/E862GPSCDmr+i3 BrICETIJmVSOfEHQ7W1hej29fBDyaL/+7DYbP3Ll9+DmSCH2PXAzTUBROac+/0fq k6T2g8USTdiTSfLJEUfX0JGeTLhf9dNCJDpvuvG/FO+s3rPp+lamZ7ePEJbyK/L4 YvIbC3DDNEDHxfegoJTPxIN7vk+816hU72x4MS/rDgMQjKgtT9C3ctia4h8reVr4 VyHiLpx8iwqj0Db5DfM+JffPxn8yI9m4e+ZODkQp1uOUS8zVfZzMXtjspmY9f3bV we7bjOFl4pj35JODEGwVKH3sPmy28myYfBobPjngF84olRxK9qM= =VCYh -----END PGP SIGNATURE----- --G4iJoqBmSsgzjUCe--