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 1fhpxn-0003uj-IW for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Jul 2018 05:34:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fhpxm-0005n0-1X for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Jul 2018 05:34:22 +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 1fhpxl-0005ms-IY for pgsql-hackers@lists.postgresql.org; Tue, 24 Jul 2018 05:34:21 +0000 Received: from mail-qt0-x231.google.com ([2607:f8b0:400d:c0d::231]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fhpxh-0001zd-Fl for pgsql-hackers@postgresql.org; Tue, 24 Jul 2018 05:34:19 +0000 Received: by mail-qt0-x231.google.com with SMTP id e19-v6so3004889qtp.8 for ; Mon, 23 Jul 2018 22:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=ZmJZkJd1kKZckvjCOOw/S05ptXF8nwJzbfrWFm3zr5k=; b=dO2aLM+iASElZ4K9RFUk83N3XE+i8Y3XyeVTRlR4JymTF/2tHVT2ck3jk9mVSGD5Kt 1pHaT4jSOX9ZEAv/Cy569J3PKyhJTszaf3rN2UXnEHmjAVsN2twAfg4gdE5llTQRHXur HZy0+Xtg1ofl3RdMDXXNXfJf487F9kapEiPDGnMmhChYkBvl9F6NCX6EcEPy9Yi4QPUk u87DKjO6r7YAvjE9GAC8TRD+fXv3m3x/HLj+yeKs6UuiiqWlTsNI+xg4Gf1KX0CbTPLu kTXsjIWws5Tf22PrUFUErF2YyAaZN8qzmVb3onZWKEuyMIjpdH1bze+7XFEUaKhk2UMf D4tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=ZmJZkJd1kKZckvjCOOw/S05ptXF8nwJzbfrWFm3zr5k=; b=h0K4f+mGpUH/EfaDymc8njVCuSrn/bQJxkQjOtUbnFEeB05REZzER6kXC4gQc43cha Eprw1JqiW4dzcyLCSKr+y3ClC5gcPNuvBzbbY6x2tIPNLUD83yFwwk+0h6iqAxzY6Ht5 +Pvjgt8akzBtTEX8rGFoU4ML22yZfEJ983nGbf6Li2jPp2T3SRjQm7ZaUPO9jrgGUJZx mqL+p/stvAd4ga+XY4pgmV8RU7wGSPfK/XxilbRIQHD4M1KwkC8XlrNgMDsvEr5NicRM tr8Dnf+vclGzEameXKEA1XOhVpeKzJvDlOtamm/UL3bQFZJdoUzEtJN0YYe7BT9EYXsI blzA== X-Gm-Message-State: AOUpUlHOKBJC8bHE66M45t1335VINWE0SCQXSeAYS8A+VAuftwVWZQA8 HAt6Pjs7LOpeqKtvMEr7g/Qy8w== X-Google-Smtp-Source: AAOMgpeJbrAsGbyJ6WLfmey6QoCpdWL3NECm3SNqQQJB7sYhFHOhbrdxFq7+cW0d/Cz3eqwVuv/0VQ== X-Received: by 2002:a0c:9a0f:: with SMTP id p15-v6mr13284410qvd.126.1532410455909; Mon, 23 Jul 2018 22:34:15 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([179.56.48.71]) by smtp.gmail.com with ESMTPSA id o80-v6sm8680263qki.19.2018.07.23.22.34.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 22:34:15 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id D84D7D1D; Tue, 24 Jul 2018 01:34:13 -0400 (-04) Date: Tue, 24 Jul 2018 01:34:13 -0400 From: Alvaro Herrera To: Michael Paquier Cc: Robert Haas , Jeremy Schneider , PostgreSQL-development , "Albin, Lloyd P" Subject: Re: BUG #15182: Canceling authentication due to timeout aka Denial of Service Attack Message-ID: <20180724053413.lxrl72gvh55eiz3e@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180724041403.GF4035@paquier.xyz> User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-Jul-24, Michael Paquier wrote: > On Mon, Jul 23, 2018 at 11:29:33AM -0400, Robert Haas wrote: > > ExecuteTruncate needs to be refactored to use RangeVarGetRelidExtended > > with a non-NULL callback rather than heap_openrv, and > > expand_vacuum_rel needs to use RangeVarGetRelidExtended with a > > callback instead of RangeVarGetRelid. See > > cbe24a6dd8fb224b9585f25b882d5ffdb55a0ba5 as an example of what to do. > > I fixed a large number of cases of this problem back around that time, > > but then ran out of steam and had to move onto other things before I > > got them all. Patches welcome. > > Thanks for pointing those out, I looked at both code paths recently for > some other work... The amount of work does not consist just in using > for example RangeVarCallbackOwnsRelation for VACUUM and TRUNCATE. I don't think we're forced to reuse the existing callbacks -- maybe write a specific callback for each case, if really needed. But anyway like Andres I don't think this is related to allow_system_table_mods at all; you just need to do the checks in the right order, no? But I don't see why RangeVarCallbackOwnsTable isn't sufficient. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services